Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActivityStreams 2.0 #1483

Merged
merged 128 commits into from Apr 27, 2018

Conversation

Projects
None yet
6 participants
@strugee
Copy link
Member

commented Oct 26, 2017

Resolves #851

@coveralls

This comment has been minimized.

Copy link

commented Nov 5, 2017

Coverage Status

Coverage decreased (-3.7%) to 70.08% when pulling a6bfb17 on as2 into 5bf9335 on master.

@@ -303,7 +311,7 @@ var getObject = function(req, res, next) {
next(err);
} else {
obj.sanitize();
res.json(obj);
res.json(wantAS2(req) ? as2(obj) : obj);

This comment has been minimized.

Copy link
@vxcamiloxv

vxcamiloxv Nov 6, 2017

Member

I thinks this could be put in a function like "handleAS2" for prevent repeating code (line 547 is the same code)

This comment has been minimized.

Copy link
@strugee

strugee Nov 6, 2017

Author Member

Nice catch, thanks 👍

Fixed this locally, will push soon

@coveralls

This comment has been minimized.

Copy link

commented Nov 6, 2017

Coverage Status

Coverage decreased (-3.7%) to 70.088% when pulling 58af0b5 on as2 into 5bf9335 on master.

2 similar comments
@coveralls

This comment has been minimized.

Copy link

commented Nov 6, 2017

Coverage Status

Coverage decreased (-3.7%) to 70.088% when pulling 58af0b5 on as2 into 5bf9335 on master.

@coveralls

This comment has been minimized.

Copy link

commented Nov 6, 2017

Coverage Status

Coverage decreased (-3.7%) to 70.088% when pulling 58af0b5 on as2 into 5bf9335 on master.

@coveralls

This comment has been minimized.

Copy link

commented Nov 6, 2017

Coverage Status

Coverage decreased (-3.7%) to 70.082% when pulling 7f934e4 on as2 into 5bf9335 on master.

@strugee

This comment has been minimized.

Copy link
Member Author

commented Nov 6, 2017

The tentative plan is to capitalize all verbs that have been straight up dropped and rename verbs when they have been fully renamed or subsumed by another Activity type. We'll do the same for object types, but we'll use Tombstones specially.

Here's the complete list of differences between AS1 and AS2 verb vocabularies:

  • Dropped: access
  • Renamed: share -> Announce
  • Not dropped and I think it doesn't have different semantics: add
  • Dropped: agree
  • Dropped: append
  • Dropped: approve
  • Dropped: archive
  • Dropped: assign
  • Dropped: at
  • Subsumed: attach by Add
  • Dropped: attend
  • Dropped: author verb (note: more specific form of AS1 create)
  • Dropped: authorize
  • Dropped: borrow
  • Dropped: build
  • Dropped: cancel
  • Dropped: close
  • Dropped: complete
  • Dropped: confirm
  • Dropped: consume (maybe subsumed by others?)
  • Dropped: checkin
  • Dropped: deliver
  • Dropped: deny
  • Dropped: disagree
  • Dropped: experience
  • Subsumed: favorite by like
  • Dropped: find
  • Renamed: flag-as-inappropriate to Flag
  • Dropped: give
  • Dropped: host
  • Dropped: insert
  • Dropped: install
  • Dropped: interact
  • Dropped: lose
  • Dropped: make-friend
  • Dropped: open
  • Subsumed: play by View
  • Dropped: present
  • Dropped: purchase
  • Dropped: qualify
  • Dropped: receive
  • Dropped: remove-friend
  • Dropped: replace
  • Dropped: request
  • Dropped: request-friend
  • Dropped: resolve
  • Dropped: return
  • Dropped: retract
  • Subsumed: rsvp-maybe by TentativeAccept
  • Subsumed: rsvp-no by Reject
  • Subsumed: rsvp-yes by Accept
  • Dropped: satisfy
  • Dropped: save
  • Dropped: schedule
  • Dropped: search
  • Dropped: sell
  • Dropped: send
  • Renamed: share to Announce
  • Dropped: sponsor
  • Dropped: start
  • Subsumed: stop-following by Undo
  • Subsumed: submit with a target by Add (maybe?)
  • Subsumed: submit without a target by Create
  • Dropped: tag
  • Dropped: terminate
  • Dropped: tie
  • Subsumed: unfavorite by Undo
  • Subsumed: unlike by Undo
  • Subsumed: unsatisfy by Undo
  • Subsumed: unsave by Undo
  • Subsumed: unshare by Undo
  • Dropped: use
  • Subsumed: watch by View
  • Dropped: win
  • Added: Arrive
  • Added: Block
  • Added: Move
  • Added: Offer
  • Added: TentativeReject
  • Added: TentativeAccept
  • Added: Travel

And here's the list of object type vocabulary differences:

  • Dropped: alert
  • Dropped: badge
  • Dropped: binary
  • Dropped: bookmark
  • Dropped: comment (subsumed by Note...???)
  • Dropped: device
  • Dropped: file
  • Dropped: game
  • Dropped: group
  • Dropped: issue
  • Dropped: job
  • Dropped: offer
  • Dropped: permission
  • Dropped: process
  • Dropped: product
  • Dropped: question
  • Dropped: review
  • Dropped: role (subsumed by Relationship, maybe?)
  • Dropped: task
  • Dropped: team
  • Added: Document
  • Added: Profile
  • Added: Relationship
  • Added: Tombstone
  • Added: Mention
@coveralls

This comment has been minimized.

Copy link

commented Nov 6, 2017

Coverage Status

Coverage decreased (-0.01%) to 73.79% when pulling d6ad7d1 on as2 into 5bf9335 on master.

@detrout

This comment has been minimized.

Copy link
Contributor

commented Nov 7, 2017

Thats a lot of changes... is there a way to tell a client that terms are deprecated and give them a chance to adapt? Did the endpoint change or is there a version number so a client can tell that it wont work now?

Just thoughts... Not sure whats truly necessary for activity streams migration

lib/as2.js Outdated
as2["@id"] = as2.id;
delete as2.id;

if (as2.verb === "post") {

This comment has been minimized.

Copy link
@vxcamiloxv

vxcamiloxv Nov 7, 2017

Member

If you change the verb, need to change this #L145 or change the name of Activity.prototype.apply[Method]

This comment has been minimized.

Copy link
@strugee

strugee Nov 7, 2017

Author Member

Don't need to change anything outside of this file since this runs so late in the request-response cycle. Basically everywhere else doesn't have to care.

This comment has been minimized.

Copy link
@vxcamiloxv

vxcamiloxv Nov 7, 2017

Member

You only change the output/response?

What will happened with the petitions?, if comes the request with AS2, it transform to AS1 before process/save?

This comment has been minimized.

Copy link
@strugee

strugee Nov 7, 2017

Author Member

@vxcamiloxv we don't support AS2 submissions yet but when we do that'll be how it works. At least for the time being.

Eventually we'll want to move to AS2 storage but. Not yet. We want the API to stabilize, etc.

This comment has been minimized.

Copy link
@vxcamiloxv

vxcamiloxv Nov 7, 2017

Member

I think will be strange (and confusing), if the input is AS1 and the output AS2, for the external apps could be more work (migrate the output and later the input) and probability cause more side effects and more errors.

I think is better one big change a not change by parts, is better one migration than 2 big migrations in a short period of time, mostly when is related with the input/output of a API

This comment has been minimized.

Copy link
@strugee

strugee Nov 8, 2017

Author Member

@vxcamiloxv I would agree with you except that AS2 output is opt-in. So if clients don't want to deal with the hassle of consuming two different formats in input and output (I certainly wouldn't), they don't have to. They can just wait for AS2 input to ship too.

This comment has been minimized.

Copy link
@vxcamiloxv

vxcamiloxv Nov 8, 2017

Member

Ha ok, yes, probably they will wait for full implementation

@strugee

This comment has been minimized.

Copy link
Member Author

commented Nov 7, 2017

@detrout endpoints do HTTP content negotiation. Clients only get this representation if they specifically ask for AS2 in the Accept header.

@strugee

This comment has been minimized.

Copy link
Member Author

commented Nov 7, 2017

So to be clear, this is fully backwards-compatible and will ship as semver-minor.

@strugee

This comment has been minimized.

Copy link
Member Author

commented Nov 9, 2017

Since writing this vocab plan I've found https://github.com/snarfed/granary (/cc @snarfed); we should try to align with that processing model. Otherwise I think this is ready to implement.

@puckipedia

This comment has been minimized.

Copy link

commented Nov 17, 2017

So quick note: It seems there's no @context in the AS2 representation. Together with this, the AS2 context defines type to be an alias of @type and idto alias @id, so those should be used instead as well :)

for the rest, I'm more than willing to test stuff against Kroeg for interop testing :P

@strugee strugee referenced this pull request Nov 22, 2017

Open

AS2 vocab translation coordination/funkiness #116

1 of 4 tasks complete
@coveralls

This comment has been minimized.

Copy link

commented Nov 22, 2017

Coverage Status

Coverage increased (+0.1%) to 73.908% when pulling 9828f3c on as2 into f0d30e2 on master.

@strugee strugee force-pushed the as2 branch 2 times, most recently from b58ff4e to 3df16ad Dec 4, 2017

@coveralls

This comment has been minimized.

Copy link

commented Dec 4, 2017

Coverage Status

Coverage decreased (-3.7%) to 70.087% when pulling 3df16ad on as2 into a5b7b9b on master.

@coveralls

This comment has been minimized.

Copy link

commented Dec 4, 2017

Coverage Status

Coverage increased (+0.2%) to 74.224% when pulling e596168 on as2 into 3637b31 on master.

@strugee strugee force-pushed the as2 branch 2 times, most recently from 4c83afc to 93b2c92 Jan 26, 2018

@strugee

This comment has been minimized.

Copy link
Member Author

commented Feb 7, 2018

Here's the current list of TODOs:

  • Normalize well-known Public collection ids
  • Write a compatibility @context for dropped vocabulary terms
  • Properly output Undo activitites

strugee added some commits Aug 27, 2017

Drop deprecated properties
If people complain, we can readd these. But better to start with them
gone and add them later, rather than have to go through a full
semver-major cycle in order to remove them later.

Also, these were dropped for a reason. There was no actual evidence of
`upstreamDuplicates` and `downstreamDuplicates` being used, and
`title` was deprecated for similar reasons. So it just doesn't seem
worth supporting them.

evanp added some commits Apr 7, 2018

Use OAuth 2.0 with ActivityPub actor route
Test using OAuth 2.0 with the actor route. This required the following
changes:

- Bearer tokens in the configuration file format
- Loosen anyReadAuth() to allow OAuth 2.0
- Change the profile route to do content negotiation
- Change Actor test to provide a bearer token
@strugee

This comment has been minimized.

Copy link
Member Author

commented Apr 9, 2018

@evanp to answer your question on IRC - I'm down to merge this whenever provided that a) tests are passing and b) nothing is half-implemented or whatever. I'll try to do a code review tonight 👍

@vxcamiloxv vxcamiloxv dismissed a stale review Apr 20, 2018

avoid problems

@evanp evanp merged commit 0e18d5b into master Apr 27, 2018

4 checks passed

Node Security No known vulnerabilities found
Details
ci/dockercloud Your tests passed in Docker Cloud
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 74.33%
Details

@strugee strugee deleted the as2 branch Jul 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.