tl;dr: I’d like activities published automatically (as a reaction to some other activity) to be able to state which activity triggered them. Looking for a property to use for this.
I’ll try to write this post as simply as I can, but I expect it may still be confusing and difficult to read. If it is, please let me know and I’ll clarify things or add a diagram etc. whatever can help me be understood
- I’m working on ForgeFed
- I’m designing and implementing a simple OCAP model/prototype for remote collaboration on repos, issues, PRs, etc. since (AFAIK) there’s no standard OCAP mechanism on the fediverse yet
- I’d like it to be possible for implementations to understand (and display to the user) why a certain capability/delegation was sent to them, which human action is the reason for this capability being given to them
- There are chains of automated delegations, so it’s not obvious what the original cause of the delegation is, without explicitly stating it (and anyway, stating it clearly is a lot nicer than having the implementation dig and infer and guess)
What an OCAP looks like right now (not final, suggestions welcome):
- type: Grant
- attributedTo: sender who is giving the access
- target: recipient who is receiving access
- context: The collaboratively editable resource/document/object, into which access is being granted
- object: The kind of access being given, the role of the recipient within the resource
- Alice is a member of group A
- Bob is a member of group B
- Alice sends a Grant activity, inviting group B to have some access to a resource managed by group A:
id: https://example.dev/grant1 type: Grant attributedTo: Alice target: Group B context: (Some resource managed by group A) object: Collaborator role
So, Alice is giving Group B access to resource as a collaborator. More precisely, Alice is giving this access to the members of Group B, to be collaborators on the resource.
Now group B delegates this access to its members, by sending its own Grant activity, to Bob. This new Grant tells Bob he now has collaborator access to a certain resource. But Bob would like to know, why he’s receiving this access from the Group B actor. And Group B provides him with this info, in 2 pieces:
- The Grant that group B sent has a parentCapability, pointing to the grant that Alice sent
- The Grant that group B sent has some “reason” property pointing to the fact that Bob is a member of group B, perhaps by pointing to the activity that added him there
From this info Bob can deduce: Group B received access to such and such resource, and it’s delegated to me because I’m a member of group B.
The question is, which property to use for pointing to the reason that the automated delegation was sent? Examples for reasons:
- When a user creates a new group, the group sends back a
Grantgiving this user admin access to the group, so the “reason” would be the ID URI of the
- If Group B is invited to have access to all the resources under group A (using a Grant activity of course), then whenever there’s a new resource created under group A, it needs to delegate access, sending a Grant to group B (which in turn delegates to its members). The “reasons” for the Grants that group A sends to group B are the original Grant that invited group B to access all of A’s resources, and the
Createthat created the new resource
- Bob is being given access to a resource because he’s a member of group B, so the “reason” is the Grant that added Bob to group B
I wanted to (ab)use the
context property but realized I’m already using it to specify the resource into which access is being granted. So I looked at the standard AS2 properties, and the only relevant thing I could find it
inReplyTo. But I find it slightly confusing, because in this scenario it’s not an actual reply back to the sender, but rather a reaction possibly pointing to some other recipient.
I’m considering to just define custom properties for this. Instead of “object” and “context” use something like “role” and “resource”, in some AP extension vocabulary, perhaps ForgeFed itself if there’s no better place (perhaps a FEP is the best place?). And similarly I’d define a custom property for the “reason”. Maybe something like “inReactionTo” or just “reason”.
Another option perhaps: To use
context for the reason(s) and find some other property to specify the resource in Grant activities.
Thoughts, suggestions, ideas?
Thank you for reading <3