Commit Graph

501 Commits

Author SHA1 Message Date
Cory Slep 72022bfe14 Add unit tests for federated remove 2020-07-04 10:00:48 +02:00
Cory Slep 4c60792b09 Add unit tests for federated add 2020-07-04 09:42:25 +02:00
Cory Slep 110d8bd3e5 Add unit tests for federated follows 2020-07-03 18:44:52 +02:00
Cory Slep 8af6ed9d4f Add unit tests for federated deletes 2020-07-03 18:06:52 +02:00
Cory Slep a1ac83aee8 Add unit tests for federated updates 2020-07-03 17:50:08 +02:00
Cory Slep c994dc39f0 Add tests and fix shadowing bug in Accept handling 2020-07-02 23:03:01 +02:00
Cory Slep d11b96b9ed Implement 18 more tests in the federation callbacks. 2020-07-02 22:10:35 +02:00
Cory Slep f2a497bdc2 Fix broken unit tests. 2020-07-02 21:15:02 +02:00
Cory J Slep 95bfff952e
Merge pull request #128 from BenLubar-PR/toot-grammar
Toot grammar
2020-05-26 08:08:58 +02:00
Cory J Slep d6627c1750
Merge pull request #132 from Sigafoos/bugfix/s_inbox_outbox
Replace 'inbox' with 'outbox' when appropriate
2020-05-26 08:08:33 +02:00
Cory J Slep 91fc2338f2
Merge pull request #135 from kissen/fix/likecallback
Fix: Use correct database method to get actor IRI
2020-05-26 08:06:34 +02:00
Cory J Slep ceedc04ee1
Merge pull request #134 from kissen/master
Fix nil derefences
2020-05-26 08:05:49 +02:00
Cory J Slep 28e35e3541
Merge pull request #137 from BenLubar-PR/generate
add file to allow `go generate` to update generated code
2020-05-26 08:04:50 +02:00
Ben Lubar 908aa3e9ae
add file to allow `go generate` to update generated code 2020-05-09 12:34:32 -05:00
Ben Lubar aa98aaa1cf
Implement ForgeFed vocabulary.
Caveat: the "description" property is probably wrong; it should match the definition of the ActivityPub(!) "source" property which is currently not in go-fed.
2020-05-08 19:09:02 -05:00
Andreas Schärtl 2efc3220fa Fix: Use correct database method to get actor IRI 2020-04-01 15:02:36 +02:00
Andreas Schärtl 01a23ee4d1 Fix: Avoid nil-derferences when dealing with Create side-effects 2020-04-01 14:50:36 +02:00
Andreas Schärtl 5f6df51cb8 Fix: Avoid nil-dereferences when wrapping object in Create activity 2020-04-01 14:50:34 +02:00
Sevki e7c3ac2533
Id => ID
`Id` is causing the linters to complain when implementing the db interface.
from the go project https://github.com/golang/go/wiki/CodeReviewComments#initialisms
> This rule also applies to "ID" when it is short for "identifier" (which is pretty much all cases when it's not the "id" as in "ego", "superego"), so write "appID" instead of "appId".
2020-03-20 15:37:09 +00:00
Dan Conley f502dfd041
Replace 'inbox' with 'outbox' when appropriate
As I was ~~wholesale copying~~ using the `database` interface definition
as a reference while creating my Federating implementation I noticed
some instances of a variable being named `inboxIRI` in an outbox method.
2020-02-28 21:55:38 -05:00
Cory Slep de06e3ccdc Lenient delivery to followers.
When delivering content, do not fail the whole process if a single
recipient is unavailable. Instead, skip delivering to that individual
actor.
2020-02-04 22:33:52 +01:00
Ben Lubar b27393e8dd
add toot-namespaced types and objects except toot:focalPoint for #122 2019-12-04 16:30:01 -06:00
Ben Lubar ffcaafbd9f
regenerate streams package with no changes to avoid messy diffs 2019-12-04 16:30:01 -06:00
Cory Slep e8a7301360 Make caller of handlers responsible for authorization 2019-11-11 00:43:52 +01:00
Cory Slep b977c30ce5 Add apcore as a client: toot own horn 2019-10-23 22:29:48 +02:00
Cory Slep 9acafe5f97 Sort @context when testing
Eliminates flakiness.
2019-10-23 19:06:19 +02:00
Cory Slep 84ee361478 Fix tests for the PublicKey and PropertyValue
There is still a context-order-dependent stability issue in the tests
impacting the PublicKey test, which must be fixed.

The fix for the PropertyValue test involved wrapping an
ActivityStreamsObject directly (instead of a Type). Note that only
serialization is supported in this case.
2019-10-22 23:42:56 +02:00
Cory Slep 3fc23c8c61 Remove debugging print statement 2019-10-21 22:34:16 +02:00
Cory Slep 0acf044b02 Merge remote-tracking branch 'refs/remotes/origin/master'
Pretty sure I just merged new code that would make Ben cry.
2019-10-21 22:22:30 +02:00
Cory Slep 82ca5994b4 Generate the new code update syntax.
This is a breaking change.

Sorry.

But it is for the long-term health.

Better now, than next year.

Expect a major version bump for next release.
2019-10-21 22:12:44 +02:00
Cory Slep 07df3adee5 "id" and "type" are JSONLD, not ActivityStream, properties
This was a fucking nightmare, as expected. All because the PublicKey
type is not really a derivation of the ActivityStreams "Object", which I
had been hackily relying on for things to inherit the JSONLD "id" and
"type" properties.

This breaks the "id" and "type" JSONLD properties into first-class
properties known within the tool, which for now is a patchy job of duct
tape to cover the leaks.

If someone wants "PublicKey" to have more default supported properties,
I will kindly ask them to fork a code generation that suits them. This
took way too much effort to treat PublicKey like a grab bag.

This isn't the fix for, but is on the road to fixing, the known bug
about aggressive deserialization of "PublicKey" into other types. In
fact, this is on the way to *correctly* fix it without a horrible patch
in the generated code (imagine being hacky in []jen.Code{...}, that's
too much poo to put into the meta code).

The things I do to support incomplete ontologies and major Federation
players that, for whatever reason on this god-forsaken planet, decided
to adopt the ontology and type everything except "PublicKey" (I don't
count "endpoints" because that is a pile of steaming poo for another
different reason in addition to this one, and is completely optional).
2019-10-21 22:06:37 +02:00
Cory J Slep 9cdc46afd4
Merge pull request #125 from BenLubar-PR/lint
Fix linter warnings; mark generated files as generated
2019-10-21 20:35:27 +02:00
Cory J Slep 00c504a6f2
Merge pull request #126 from BenLubar-PR/subtests
Simplify table-based tests using subtests
2019-10-21 20:34:35 +02:00
Ben Lubar 8d7b0196cd
add standard generated code header
doing this as a separate commit to avoid messy diffs for the important part of this change
2019-10-19 17:45:12 -05:00
Ben Lubar 05dd8e7024
regenerate streams with new astool 2019-10-19 17:43:37 -05:00
Ben Lubar 3ff5423014
fix linter warnings. 2019-10-19 17:43:21 -05:00
Ben Lubar d8ecddbe23
[streams] simplify table-based tests using subtests 2019-10-19 16:51:58 -05:00
Cory Slep 809fd1f041 Add unit tests for known bugs.
Aggressive PublicKey deserialization and Type masquerading bugs.
2019-10-19 13:30:16 +02:00
Cory Slep 00d19306e4 Fix JSON-LD conformance.
No longer create "default aliases" for JSON-LD vocabularies. This would
break compatibility since the way JSON-LD propagates aliases is pushed
downwards, and not propagated upwards. Since a lot of implementations
don't actually care about JSON-LD, do a lot of hacking to make sure that
others that expect hardcoded contexts and the like will still be able to
handle our output.

Still need to hook together the "well known alias" so it can generate
contexts that match the community, but that will be for things like the
custom mastodon and litepub extensions.

I don't want to ever have to work with JSON-LD in a static language ever
ever again. This is shit code.
2019-10-09 21:25:44 +02:00
Cory Slep 138e620834 Regenerate code with example fixes. 2019-10-09 19:59:41 +02:00
Cory J Slep c61e64cede
Merge pull request #120 from walfie/fix-type
Fix some `type`s in examples
2019-10-09 19:57:59 +02:00
Walfie e0b45cb7aa Fix some `type`s in examples
Also fixes spacing of some bracketed items
2019-10-01 19:28:03 -04:00
Cory Slep cd97d44b99 Fix exmaple spec 2019-09-26 20:38:25 +02:00
Cory Slep e084b904b1 Regenerate types using proper aliasing 2019-09-26 20:32:32 +02:00
Cory Slep b5a6786f9e Fix astool bug to properly alias properties and types 2019-09-26 20:31:48 +02:00
Cory J Slep bf196748f9
Merge pull request #118 from Zauberstuhl/security-v1
Separate w3id.org/security/v1 from activitystreams vocab

Note: contexts are improperly serializing properties, to be fixed.
2019-09-25 19:44:28 +02:00
Lukas Matt c8e9a9ffc9 Generate streams vocab with astool
./astool/astool -spec astool/activitystreams.jsonld \
  -spec astool/security-v1.jsonld ./streams
2019-09-16 22:49:41 +02:00
Lukas Matt 4db4275adf Revert "Add pseudo-type PublicKey for actor types"
This reverts commit 9b139af408.
2019-09-16 22:48:09 +02:00
Lukas Matt 85d191bffb Add https://w3id.org/security/v1 extension
* update go-mod httpsig
2019-09-16 22:47:07 +02:00
Cory Slep d87793a589 Add context.Context as an output to Authorize interfaces 2019-09-14 16:35:48 +02:00