-
Notifications
You must be signed in to change notification settings - Fork 204
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: dcql alpha #2098
base: main
Are you sure you want to change the base?
feat: dcql alpha #2098
Conversation
🦋 Changeset detectedLatest commit: af89f1a The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Signed-off-by: Martin Auer <[email protected]>
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.
Very nice!
for (const credentialQueryId of firstFullFillableOption) { | ||
const credential = dcqlQueryResult.credential_matches[credentialQueryId] | ||
|
||
if (credential.success && credential.record.type === 'MdocRecord' && 'namespaces' in credential.output) { |
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.
I usually prefer adding a diferentiator key that then also defiens the type of credential.
So credential has a format key and if it is mso_mdoc then output has namespaces.
} | ||
|
||
// TODO: this IS WRONG | ||
private createPresentationFrame(obj: Record<string, JsonValue>): IPresentationFrame { |
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 this used?
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.
Yes for SdJwt presentations. Will fix it in the weekend
packages/openid4vc/src/openid4vc-holder/OpenId4vcSiopHolderService.ts
Outdated
Show resolved
Hide resolved
packages/openid4vc/src/openid4vc-holder/OpenId4vcSiopHolderService.ts
Outdated
Show resolved
Hide resolved
packages/openid4vc/src/openid4vc-verifier/OpenId4VcSiopVerifierService.ts
Outdated
Show resolved
Hide resolved
…ax for oid4vp Signed-off-by: Timo Glastra <[email protected]>
…se` and `SdJwtVc` to allow for easier type narrowing Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Martin Auer <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
Signed-off-by: Timo Glastra <[email protected]>
if (result.success) { | ||
if (result.output.credential_format === 'vc+sd-jwt') { | ||
const sdJwtVcRecord = credentialRecords[result.input_credential_index] as SdJwtVcRecord | ||
agentContext.dependencyManager |
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.
The return value of this call is not used
const transformValue = (value: unknown): unknown => { | ||
if (typeof value !== 'function' && typeof value !== 'object') return value | ||
return isToJsonable(value) ? value.toJson() : 'unknown json representation' | ||
} | ||
|
||
const mdoc = Mdoc.fromBase64Url(record.base64Url) | ||
|
||
const namespaces = Object.fromEntries( | ||
Object.entries(mdoc.issuerSignedNamespaces).map(([key, namespace]) => [ | ||
key, | ||
Object.fromEntries(Object.entries(namespace).map(([k, v]) => [k, transformValue(v)])), | ||
]) | ||
) |
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.
here you still convert to json? shouldn't this be handled by dcql?
const claims = agentContext.dependencyManager | ||
.resolve(SdJwtVcService) | ||
.applyDisclosuresForPayload(sdJwtVcRecord.compactSdJwtVc, result.output.claims) | ||
return [ | ||
credential_query_id, | ||
{ | ||
...result, | ||
output: { ...result.output, claims }, | ||
record: credentialRecords[result.input_credential_index], | ||
}, | ||
] |
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 returns the whole sd jwt vc. not the claims.
So should do claims.prettyClaims
No description provided.