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

feat: Allow the same resource scheme for multiple plugins #4

Merged
merged 1 commit into from Oct 27, 2023

Conversation

matheus23
Copy link
Member

Pretty much what it says on the tin.

I moved on to using the same resource for all capabilities in the fission server, in anticipation of how the subject works in UCAN 1.0. (I'm basically using the resource field as the subject now.)

This means the only resource scheme that exists is did:..., but I still have separate abilities like all the account abilities account/read, account/manage, etc. and also capability/find, in a different plugin.

Them being different plugins, but having the same scheme means you need to test all plugins to find the first capability that parses.

This is the change this PR makes.

@matheus23 matheus23 self-assigned this Oct 27, 2023
@QuinnWilton
Copy link

This makes sense, thanks! Do you think it should also be possible for multiple plugins to succeed?

@QuinnWilton QuinnWilton merged commit 240549b into quinn-wip-rework Oct 27, 2023
1 of 7 checks passed
@matheus23 matheus23 deleted the matheus23/allow-same-resource-scheme branch October 30, 2023 10:41
@matheus23
Copy link
Member Author

Hmm. Good question 🤔

So far, I haven't needed that.
It can be weird to see that ucan.capabilities() is an interator with more items than in the original UCAN, plus them encoding to the same data. That'd make me go "is that a bug?".
Perhaps if the API were different. Something like find_capabilities and you provide it with the resource, ability and caveat types you expect, and then it filters out the relevant ones. Then it'd be totally fine to have multiple plugins succeed (even desired), although effectively at that point you could also just provide the plugin you're expecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants