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: OpenID Resolver Refactor #1323

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/legacy/core/App/modules/openid/resolver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
DidKey,
JwaSignatureAlgorithm,
JwkDidCreateOptions,
KeyBackend,
KeyDidCreateOptions,
KeyType,
SdJwtVcRecord,
Expand All @@ -12,7 +13,11 @@ import {
W3cCredentialRepository,
getJwkFromKey,
} from '@credo-ts/core'
import { OpenId4VciCredentialFormatProfile, OpenId4VciCredentialSupportedWithId, OpenId4VciSupportedCredentialFormats } from '@credo-ts/openid4vc'
import {
OpenId4VciCredentialFormatProfile,
OpenId4VciCredentialSupportedWithId,
OpenId4VciSupportedCredentialFormats,
} from '@credo-ts/openid4vc'
import { extractOpenId4VcCredentialMetadata, setOpenId4VcCredentialMetadata } from './metadata'

export type OpenID4VCIParam = {
Expand Down Expand Up @@ -103,6 +108,7 @@ export const receiveCredentialFromOpenId4VciOffer = async ({ agent, data, uri }:
if (supportsJwk && credentialFormat === OpenId4VciCredentialFormatProfile.SdJwtVc) {
const key = await agent.wallet.createKey({
keyType,
keyBackend: KeyBackend.SecureElement,
})
return {
method: 'jwk',
Expand Down Expand Up @@ -156,7 +162,6 @@ export const receiveCredentialFromOpenId4VciOffer = async ({ agent, data, uri }:
return record
}


export async function storeCredential(agent: Agent, credentialRecord: W3cCredentialRecord | SdJwtVcRecord) {
if (credentialRecord instanceof W3cCredentialRecord) {
await agent.dependencyManager.resolve(W3cCredentialRepository).save(agent.context, credentialRecord)
Expand Down
Loading