Skip to content

Conversation

@cykoder
Copy link
Member

@cykoder cykoder commented Nov 14, 2025

No description provided.

@cykoder cykoder changed the title Delegation engine with cedar Delegation engine with optional Cedar authorization Nov 14, 2025
issuanceDate: new Date().toISOString(),
credentialSubject: {
id: DELEGATE_DID,
[MAY_CLAIM_IRI]: ['creditScore'],
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Member Author

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',
Copy link
Contributor

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?

Copy link
Member Author

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
Copy link
Contributor

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

Copy link
Member Author

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]
Copy link
Contributor

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

Copy link
Member Author

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 */
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

@mike-parkhill mike-parkhill left a 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

@cykoder cykoder merged commit 5c8a5d7 into master Dec 1, 2025
12 of 13 checks passed
@cykoder cykoder deleted the feat/delegation-engine-with-cedar branch December 1, 2025 20:26
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.

3 participants