コミットグラフ

49 コミット

作成者 SHA1 メッセージ 日付
Cory Slep 1c057922ca Fix intransitive activity generated code in vocab.
The sub-types of Intransitive Activity (Arrive, etc) would not satisfy
the vocab.IntransitiveActivityType interface, due to not accounting for
the parent WithoutProperties definition.

This fixes that code generation, so that all Activity subtypes will be
able to be properly converted to vocab.ActivityType or
vocab.IntransitiveActivityType.

Updated the PostOutbox code path to properly handle this distinction
when receiving a C2S IntransitiveActivity.
2018-08-20 23:08:02 +02:00
Cory Slep 387ed4a775 Fix body delivery bytes being incorrectly copied 2018-08-19 23:25:14 +02:00
Cory Slep 3740d4a418 Remove TODO 2018-08-19 11:06:52 +02:00
Cory Slep be4644fbca Examine IRI when origin checking Update/Delete
Before we just always threw an error. Also update tests to check for
both cases.
2018-08-03 22:54:12 +02:00
Cory Slep f82653f709 Don't do an Activity's side effects more than once
If a federated Activity has been seen before, skip handling its side
effects.
2018-08-03 22:30:53 +02:00
Cory Slep 8fa0f2395c Add Like activities to the likes collection.
Previously, it was incorrectly adding the actors to the likes collection.
2018-08-02 22:29:03 +02:00
Cory Slep 107468d8e9 Fix GetInbox failure due to unavailable messages.
When deduplicating IRIs in a user's inbox, the library tries to
dereference the IRI to... obtain the ID. I must have added this when I
had no idea what I was doing. Oh my god, everyone's going to know I am
dumb! Quick, don't read this commit message, I'll just finish typing
this sentence over here.

Well, it's fixed now.
2018-08-01 23:30:20 +02:00
Cory Slep b0c125a7ba Improve media type detection for ActivityPub types 2018-08-01 23:18:41 +02:00
Cory Slep fb16747c4e Migrate Typer and type-detection functions to vocab
This helps ensure that the code to detect specific ActivityStream types
continues to live in the code-generation algorithms, reducing
maintenance burdens.
2018-06-12 23:29:30 +02:00
Cory Slep 1f9eeafca8 Serve tombstone with HTTP status Gone 2018-06-09 00:03:45 +02:00
Cory Slep 2764b67c7e Remove bto & bcc before serving ActivityStream object 2018-06-08 23:45:25 +02:00
Cory Slep da279300a0 Followers, following, likes, liked collections use IRIs.
As part of the IRI normalization effort.
2018-06-06 22:36:49 +02:00
Cory Slep 53c59ed335 Inboxes and outboxes now contain IRIs.
As part of normalization of objects and not embedding them everywhere.
2018-06-06 22:26:48 +02:00
Cory Slep 945c79483a Use IRIs when normalizing recipients.
Part of the IRI auditing for normalization effort.
2018-06-06 22:20:52 +02:00
Cory Slep 2bc987e776 Wrapping in Create for delivery propagates IRIs only.
As part of auditing everywhere an object may become inadvertently
embedded, and prefer normalization of IRIs.
2018-06-06 21:44:10 +02:00
Cory Slep 33c5320c8f Fixes for the first c2s implementation report.
Non Interface Behavior Changes:

- Robust header detection for ActivityPub requests
- No more panic because of a Bto access after a Bcc condition
- PostOutbox Undo activities now required to have matching actors

Interface Behavior Changes:

- PostOutbox activities themselves are now passed to App.Set
- Authentication/Authorization in a SocialAPIVerifier no longer
    shadowed and ignored.
- Add activities can now fetch remote objects (not permanent)

The behavior changes are justified as having been broken bugs that would
have not met a developer's expectations. So including them as part of
the next release maintains major version 0 behavior compatibility.
2018-06-06 00:49:02 +02:00
Cory Slep 62ec7d5278 Fix logic for Accept and Content-Type headers 2018-06-03 01:29:47 +02:00
Cory Slep ba40dc50b4 Use *url.URL instead of url.URL.
He who fights with monsters should be careful lest he thereby become a monster.
And if thou gaze long into an abyss, the abyss will also gaze into thee.
2018-05-29 21:57:39 +02:00
Cory Slep b8a27ed6f7 The App interfaces contain only the needed funcs
This will hopefully clarify what interfaces are needed for which kind of
implementations of ActivityPub are needed.
2018-05-29 00:04:24 +02:00
Cory Slep 96c9afee84 Add Read and ReadWrite when getting data.
This allows implementations to prevent race conditions between
contentious objects.
2018-05-27 22:57:43 +02:00
Cory Slep 353cd20402 Prepend to ordered collections. 2018-05-27 22:16:59 +02:00
Cory Slep bed3dbef16 Change vocab Add methods to Append and Prepend
This allows the reverse chronological order to be set as items are
easily prepended to non-functional activity stream properties.
2018-05-27 17:07:40 +02:00
Cory Slep 2986f7601b Add function to serve ActivityPub object.
This also incorporates some interface changes to permit both HTTP
Signatures and other forms of authentication and authorization when
accessing data. This means support for something like OAuth2 should be
doable in conjunction with HTTP Signatures.

Tests are broken; this commit should not be used as a build point.
2018-05-25 00:23:50 +02:00
Cory Slep b9606f06f2 Fix tests for HTTP Signatures.
Also, bugfix the time.Now calls to use the federator's clock instead.
This is how it should have been done in the beginning, but is necessary
for the tests since the HTTP Signatures by default sign the dates in the
headers. And I noticed said dates were being populated by time.Now
instead of the mock-able Clock.
2018-05-19 22:16:37 +02:00
Cory Slep ecc87da47f Add HTTP Signatures support for user credentials.
Tests are broken in this commit.
2018-05-18 23:31:18 +02:00
Cory Slep 5390174107 Add same-origin and same-actor checks.
These covers server-to-server Update and Delete activities as well as server-to-
server Undo activities, respectively.
2018-05-13 17:18:39 +02:00
Cory Slep c9c986f5a5 Deduplicate adding entries to the inbox.
Deduplication is simply done by the IRI of the activity.
2018-05-13 13:22:46 +02:00
Cory Slep f60bb145cf Deduplicate adding to like/following collections.
We simply prevent adding a duplicate likes, liked, following, or
follower based on the IRI of the element being added to the collection.

Adds corresponding black box tests.

Note that this deduplication does not cover the inbox.
2018-05-13 13:05:12 +02:00
Cory Slep 4bad90902e Add extra integration tests.
These generally include improving the handling of OrderedCollections and
IRIs. Note that improvement to setting IRI'd fetches from the
implementing application were made.

Improve the handing of AutoAccept and AutoReject follows. If there are
no owned objects in the Activity, we prevent sending the automatic reply
in case the implemented application is not checking for ownership of the
object of the original Follow activity.
2018-05-12 23:03:20 +02:00
Cory Slep 6e56e8710e PostOutbox Like tests
Note that some other tests were impacted due to a change to keep
modifications to collections on objects/actors at parity when calling
get and set on the App.
2018-05-12 14:44:07 +02:00
Cory Slep 7b63dca953 Support Inbox Forwarding.
Client libraries can also filter the collections being targeted for the
inbox forwarding.
2018-05-10 12:49:37 +02:00
Cory Slep c5dd064b06 PostInbox adds to actor's Inbox OrderedCollection.
Tests were upated and refactored to use common initialization similar to
how PostOutbox has common intialization.
2018-04-29 15:56:38 +02:00
Cory Slep 2827a4cb1e Do not capture unused IRIs of objects 2018-04-28 17:23:03 +02:00
Cory Slep e3a72c5274 Apply nulls in JSON in PostOutbox Update
This is a much better solution than trying to do some sort of roll-your-
own JSON parser.
2018-04-28 13:47:33 +02:00
Cory Slep 2adcc56581 Add PostOutbox Create unit tests.
Fix normalizing the recipents between the object and the activity. Also
allow the handlers to adjust what gets placed in the outbox, since the
client-to-server API allows the server to modify the object before being
delivered.
2018-04-22 14:02:45 +02:00
Cory Slep a944e2493a Fix pub build. Implement Follow AutoAccept test.
Also refactored the likes/liked add-to-collections logic so that they
are also applicable for following and followers collections. This code
is still as ugly as sin.
2018-04-11 00:10:29 +02:00
Cory Slep 9f42e8c52c Testing for @context and Follow DoNothing/Reject.
Testing the Follow AutoAccept feature requires implementing it similar
to how the likes collections are implemented.
2018-04-08 19:17:08 +02:00
Cory Slep c6c350e4d0 Move the DelivererPool out of ActivityPub.
This simplifies testing and allows other implementations to supply a
basic version instead.
2018-04-04 20:36:23 +02:00
Cory Slep 701475b6e0 Fix bugs with delivering messages.
This was uncovered during writing tests where both the Social and
Federative APIs are enabled. The actorObject interface was overused
partially due to my earlier confusion; the introduction of the internal
actor interface resolved this.

Finally, the HttpClient interface was introduced to be able to mock out
calls in testing. It may also prove useful for future applications using
this library.
2018-04-04 00:23:55 +02:00
Cory Slep 4368380651 Implement Accept in response to a Follow 2018-02-20 22:50:13 +01:00
Cory Slep 07a04262d9 Support likes, liked, blocking, auto-accept/reject follows. 2018-02-20 00:09:29 +01:00
Cory Slep 683a26f6c1 Overhaul of interfaces, begin detailed Activity handling. 2018-02-15 23:38:58 +01:00
Cory Slep bcec31a2a7 Internalize interfaces that should not be public. 2018-02-12 21:19:35 +01:00
Cory Slep d80d47289a Implement POSTing Activity objects to another server. 2018-02-04 18:50:32 +01:00
Cory Slep 7400a3197f Add support for wrapping objects in Create activity. 2018-02-04 18:32:01 +01:00
Cory Slep fe707109c4 Make substantial progress on ActivityPub client & server implmentation 2018-02-04 17:42:22 +01:00
Cory Slep 3662ac5bf9 Outline support for inbox and outbox handlers and routing. 2018-01-31 22:43:13 +01:00
Cory Slep cd8ee5fb47 Complete basic recipient list inbox algorithm. 2018-01-28 21:29:23 +01:00
Cory Slep 9300d8583e Migrate pub to go-fed. 2018-01-26 00:19:21 +01:00