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

Capability definitions without dervies hooks #170

Open
Gozala opened this issue Dec 11, 2022 · 0 comments · May be fixed by #190
Open

Capability definitions without dervies hooks #170

Gozala opened this issue Dec 11, 2022 · 0 comments · May be fixed by #190

Comments

@Gozala
Copy link
Collaborator

Gozala commented Dec 11, 2022

At the moment when we define capabilities we have to provide derives function which is used to compare two capabilities of the same type to decide whether one can be derived from the other. It is annoying to have to define those and requires quite a bit of code.

We could simplify this simply by making schemas also provide includes(capability:A, claim:A): boolean function which could compare two values from the same schema making it unnecessary to do it anything at the capability level.

There is also another class of derives however which works across different capability types (which are discriminated by can field). Things are fuzzier here, because it is no longer obvious how one would include the other, not only can fields differ but also a field set may e.g. in our code base we can derive space/info from store/* and upload/* which is to say size, root etc fields won't exist on space/info yet it should be considered included in any of the upload/*.

  • Perhaps it's ok, we can iterate over all claim fields, if some field isn't set yet was set in the capability it is clearly violates imposed limitation. If capability contains some fields that aren't even defined in claim that's ok because those are unrelated.
    • This would mean that filed name a would not be able to restrict field name b, but that's probably a reasonable limitation.
    • Perhaps we could also allow implementing custom includes logic on schemas in case where you need more complex comparison logic

Last class of derives deals with amplifications. That one capability may be derived from multiple other capabilities. This is a tricky one as it's unclear how includes could be implemented at all.

@Gozala Gozala linked a pull request Dec 15, 2022 that will close this issue
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 a pull request may close this issue.

1 participant