Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Jul 25, 2024
1 parent b7eea5f commit 75d348a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 32 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"@sphereon/oid4vci-common": "0.15.1-next.9",
"@sphereon/oid4vci-client": "0.15.1-next.9",
"@sphereon/oid4vci-issuer": "0.15.1-next.9",
"@sphereon/pex": "^4.0.1",
"@noble/hashes": "1.2.0",
"debug": "^4.3.5",
"did-jwt": "6.11.6",
Expand Down
7 changes: 4 additions & 3 deletions packages/oid4vci-holder/src/agent/OID4VCIHolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,9 @@ export class OID4VCIHolder implements IAgentPlugin {

// FIXME: This type mapping is wrong. It should use credential_identifier in case the access token response has authorization details
const types = getTypesFromObject(issuanceOpt)
const credentialTypes = issuanceOpt.credentialConfigurationId ?? issuanceOpt.id ?? types
if (!credentialTypes || (Array.isArray(credentialTypes) && credentialTypes.length === 0)) {
const id: string | undefined = 'id' in issuanceOpt && issuanceOpt.id ? (issuanceOpt.id as string) : undefined
const credentialTypes = asArray(issuanceOpt.credentialConfigurationId ?? id ?? types)
if (!credentialTypes || credentialTypes.length === 0) {
return Promise.reject(Error('cannot determine credential id to request'))
}
const credentialResponse = await client.acquireCredentials({
Expand All @@ -632,7 +633,7 @@ export class OID4VCIHolder implements IAgentPlugin {
})

const credential = {
id: issuanceOpt.credentialConfigurationId ?? issuanceOpt.id,
id: issuanceOpt.credentialConfigurationId ?? id,
types: types ?? asArray(credentialTypes),
issuanceOpt,
credentialResponse,
Expand Down
12 changes: 5 additions & 7 deletions packages/oid4vci-holder/src/agent/OID4VCIHolderService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
CredentialResponse,
CredentialsSupportedDisplay,
getSupportedCredentials,
getTypesFromCredentialSupported,
getTypesFromObject,
MetadataDisplay,
OpenId4VCIVersion,
Expand All @@ -27,7 +28,7 @@ import {
WrappedVerifiableCredential,
} from '@sphereon/ssi-types'
import { IIdentifier, IVerifyCredentialArgs, TKeyType, VerifiableCredential } from '@veramo/core'
import { _ExtendedIKey } from '@veramo/utils'
import { _ExtendedIKey, asArray } from '@veramo/utils'
import { createJWT, Signer } from 'did-jwt'
import { translate } from '../localization/Localization'
import {
Expand Down Expand Up @@ -74,11 +75,8 @@ export const getCredentialBranding = async (args: GetCredentialBrandingArgs): Pr
)

const defaultCredentialType = 'VerifiableCredential'
const credentialTypes: Array<string> = ('types' in credentialsConfigSupported // TODO credentialsConfigSupported.types is deprecated
? (credentialsConfigSupported.types as string[])
: 'credential_definition' in credentialsConfigSupported
? credentialsConfigSupported.credential_definition.type
: [defaultCredentialType]) ?? [configId]
const configSupportedTypes = getTypesFromCredentialSupported(credentialsConfigSupported)
const credentialTypes: Array<string> = configSupportedTypes.length === 0 ? asArray(defaultCredentialType) : configSupportedTypes

const filteredCredentialTypes = credentialTypes.filter((type: string): boolean => type !== defaultCredentialType)
credentialBranding[filteredCredentialTypes[0]] = localeBranding // TODO for now taking the first type
Expand Down Expand Up @@ -385,7 +383,7 @@ export const getCredentialConfigsSupportedBySingleTypeOrId = async (
allSupported = {} satisfies Record<string, CredentialConfigurationSupported>
offerSupported.forEach((supported) => {
if (supported.id) {
allSupported[supported.id] = supported
allSupported[supported.id as string] = supported
return
}
const id = createIdFromTypes(supported)
Expand Down
2 changes: 1 addition & 1 deletion packages/oid4vci-issuer-rest-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"devDependencies": {
"@decentralized-identity/ion-sdk": "^0.6.0",
"@sphereon/did-uni-client": "^0.6.3",
"@sphereon/pex": "3.3.3",
"@sphereon/pex": "^4.0.1",
"@sphereon/pex-models": "^2.2.4",
"@sphereon/ssi-sdk-ext.did-provider-jwk": "0.23.1-next.5",
"@sphereon/ssi-sdk-ext.key-manager": "0.23.1-next.5",
Expand Down
25 changes: 4 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 75d348a

Please sign in to comment.