-
Notifications
You must be signed in to change notification settings - Fork 22
Delegation engine with optional Cedar authorization #550
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
Conversation
examples/src/delegation.js
Outdated
| issuanceDate: new Date().toISOString(), | ||
| credentialSubject: { | ||
| id: DELEGATE_DID, | ||
| [MAY_CLAIM_IRI]: ['creditScore'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have an example of referencing a nested attribute anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initially i thought of this with just root level claims, but i think itd be useful to support jsonpath based claims too for more complex scenarios. will update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added tests and this example also now uses nested attributes too via jsonpath
|
|
||
| const DELEGATION_TYPE_URIS = new Set([ | ||
| 'DelegationCredential', | ||
| 'https://ld.truvera.io/credentials/delegation#DelegationCredential', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do all delegated credentials need to include this context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isnt a context but an expanded IRI of the type. but the defined context, yes all delegation credentials need it as it defines the extensions we use (root credential id etc)
| return { verified, results: [presentation], credentialResults }; | ||
| } | ||
|
|
||
| // Skip proof validation for unsigned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surprising that we weren't doing this before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we were, i moved it
| C -->|missing context or id| F | ||
| C --> D[Build chains + summaries] | ||
| D -->|cycle or missing link| F | ||
| D --> E[Generate rify premises & rules] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is rify explained elsewhere? I certainly didn't know what it was until you explained it on the call last week
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its not, thought it might be in the existing claim deduction docs but apparently isnt
| @@ -0,0 +1,650 @@ | |||
| /* eslint-disable sonarjs/cognitive-complexity */ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anything we can do with this file so we don't have to disable the complexity check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can refactor a few functions into other functions, but not sure if its really worth the effort. at some point it becomes more complex to read with it all split off (also time investment)
if you feel strongly about it we could do that but im fine with the current cognitive complexity of the methods here
mike-parkhill
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks okay, just a few comments
No description provided.