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: dcql alpha #2098

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

auer-martin
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Nov 21, 2024

🦋 Changeset detected

Latest commit: 25b707e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@credo-ts/openid4vc Minor
@credo-ts/core Minor
@credo-ts/action-menu Minor
@credo-ts/anoncreds Minor
@credo-ts/askar Minor
@credo-ts/bbs-signatures Minor
@credo-ts/cheqd Minor
@credo-ts/drpc Minor
@credo-ts/indy-sdk-to-askar-migration Minor
@credo-ts/indy-vdr Minor
@credo-ts/node Minor
@credo-ts/question-answer Minor
@credo-ts/react-native Minor
@credo-ts/tenants Minor

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 <martin.auer97@gmail.com>
Copy link
Contributor

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

packages/core/src/modules/dcql/DcqlService.ts Show resolved Hide resolved
Comment on lines +53 to +60
const sdJwtVcApi = this.getSdJwtVcApi(agentContext)
const sdJwtVcRecords = formats.has('vc+sd-jwt') ? await sdJwtVcApi.getAll() : []
allRecords.push(...sdJwtVcRecords)

const mdocApi = this.getMdocApi(agentContext)
const mdocRecords = formats.has('mso_mdoc') ? await mdocApi.getAll() : []
allRecords.push(...mdocRecords)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nice thing about dcql is that it is now much easier to preselect a subset of credentials based on doctype and vct.

for (const credentialQueryId of firstFullFillableOption) {
const credential = dcqlQueryResult.credential_matches[credentialQueryId]

if (credential.success && credential.record.type === 'MdocRecord' && 'namespaces' in credential.output) {
Copy link
Contributor

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used?

Copy link
Contributor Author

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/core/src/modules/dcql/DcqlService.ts Show resolved Hide resolved
packages/openid4vc/tests/openid4vc.e2e.test.ts Outdated Show resolved Hide resolved
…ax for oid4vp

Signed-off-by: Timo Glastra <timo@animo.id>
…se` and `SdJwtVc` to allow for easier type narrowing

Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
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.

2 participants