Skip to content

Commit

Permalink
fix: updated version of vci and fixed the libs for it
Browse files Browse the repository at this point in the history
  • Loading branch information
sksadjad committed May 23, 2024
1 parent cece763 commit de1d6aa
Show file tree
Hide file tree
Showing 13 changed files with 13,056 additions and 9,427 deletions.
4 changes: 2 additions & 2 deletions packages/oid4vci-holder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"build:clean": "tsc --build --clean && tsc --build"
},
"dependencies": {
"@sphereon/oid4vci-client": "0.10.4-unstable.49+e6eaf17",
"@sphereon/oid4vci-common": "0.10.4-unstable.49+e6eaf17",
"@sphereon/oid4vci-client": "0.10.4-unstable.52+125cb81",
"@sphereon/oid4vci-common": "0.10.4-unstable.52+125cb81",
"@sphereon/ssi-sdk-ext.did-utils": "0.18.0",
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.18.0",
"@sphereon/ssi-sdk.contact-manager": "workspace:*",
Expand Down
3 changes: 2 additions & 1 deletion packages/oid4vci-holder/src/agent/OID4VCIHolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ export class OID4VCIHolder implements IAgentPlugin {
})
if ('credential_definition' in issuanceOpt) {
const credentialResponse = await client.acquireCredentials({
credentialTypes: issuanceOpt.credential_definition.type,
//fixme: this isn't the correct way to handle this. the type is wrong. we're not correctly handling moving from Record<string, CredentialConfigSupport>
credentialType: issuanceOpt.id ?? issuanceOpt.credential_definition.type[0],
proofCallbacks: callbacks,
format: issuanceOpt.format,
// TODO: We need to update the machine and add notifications support for actual deferred credentials instead of just waiting/retrying
Expand Down
4 changes: 2 additions & 2 deletions packages/oid4vci-holder/src/link-handler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
private readonly stateNavigationListener:
| ((oid4vciMachine: OID4VCIMachineInterpreter, state: OID4VCIMachineState, navigation?: any) => Promise<void>)
| undefined
private noStateMachinePersistence: boolean;
private noStateMachinePersistence: boolean

constructor(
args: Pick<GetMachineArgs, 'stateNavigationListener'> & {
Expand Down Expand Up @@ -54,7 +54,7 @@ export class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
cleanupAllOtherInstances: true,
cleanupOnFinalState: true,
singletonCheck: true,
noRegistration: this.noStateMachinePersistence
noRegistration: this.noStateMachinePersistence,
})
} else {
interpreter.start()
Expand Down
6 changes: 3 additions & 3 deletions packages/oid4vci-issuer-rest-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"start:dev": "ts-node __tests__/RestAPI.ts"
},
"dependencies": {
"@sphereon/oid4vci-common": "0.10.4-unstable.49+e6eaf17",
"@sphereon/oid4vci-issuer": "0.10.4-unstable.49+e6eaf17",
"@sphereon/oid4vci-issuer-server": "0.10.4-unstable.49+e6eaf17",
"@sphereon/oid4vci-common": "0.10.4-unstable.52+125cb81",
"@sphereon/oid4vci-issuer": "0.10.4-unstable.52+125cb81",
"@sphereon/oid4vci-issuer-server": "0.10.4-unstable.52+125cb81",
"@sphereon/ssi-express-support": "workspace:*",
"@sphereon/ssi-sdk.kv-store-temp": "workspace:*",
"@sphereon/ssi-sdk.oid4vci-issuer": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createObjects, getConfig } from '../../agent-config/dist'
import { createObjects, getConfig } from '../../agent-config/src'

jest.setTimeout(60000)

Expand All @@ -13,17 +13,16 @@ const setup = async (): Promise<boolean> => {
agent = localAgent
nock('https://ssi-backend.sphereon.com/webapp/')
.post(`/credential-offers`, {
credential_configuration_ids: ['dbc2023'],
grants: {
'urn:ietf:params:oauth:grant-type:pre-authorized_code': {
'pre-authorized_code': '1234',
user_pin_required: false,
},
},
credentials: ['dbc2023'],
})
.times(4)
.reply(200, {
uri: 'openid-credential-offer://?credential_offer=%7B%22grants%22%3A%7B%22urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Apre-authorized_code%22%3A%7B%22pre-authorized_code%22%3A%221234%22%2C%22user_pin_required%22%3Afalse%7D%7D%2C%22credentials%22%3A%5B%22dbc2023%22%5D%2C%22credential_issuer%22%3A%22https%3A%2F%2Fdbc2023.test.sphereon.com%2Fissuer%2Fdbc2023%22%7D',
uri: 'openid-credential-offer://?credential_offer=%7B%22grants%22%3A%7B%22urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Apre-authorized_code%22%3A%7B%22pre-authorized_code%22%3A%221234%22%2C%22%7D%2C%22credential_configuration_ids%22%3A%5B%22dbc2023%22%5D%2C%22credential_issuer%22%3A%22https%3A%2F%2Fdbc2023.test.sphereon.com%2Fissuer%2Fdbc2023%22%7D',
})
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Server } from 'http'
import { IAgent, createAgent, IAgentOptions } from '@veramo/core'
import { AgentRestClient } from '@veramo/remote-client'
import { AgentRouter, RequestWithAgentRouter } from '@veramo/remote-server'
import { createObjects, getConfig } from '../../agent-config/dist'
import { createObjects, getConfig } from '../../agent-config/src'
import { IOID4VCIRestClient } from '../src'
import issuanceRestClientAgentLogic from './shared/issuanceRestClientAgentLogic'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
grants: {
'urn:ietf:params:oauth:grant-type:pre-authorized_code': {
'pre-authorized_code': '1234',
user_pin_required: false,
},
},
credential_configuration_ids: ['dbc2023'],
Expand All @@ -37,7 +36,6 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
grants: {
'urn:ietf:params:oauth:grant-type:pre-authorized_code': {
'pre-authorized_code': '1234',
user_pin_required: false,
},
},
credential_configuration_ids: ['dbc2023'],
Expand Down
2 changes: 1 addition & 1 deletion packages/oid4vci-issuer-rest-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"generate-plugin-schema": "ts-node ../../packages/dev/bin/sphereon.js dev generate-plugin-schema"
},
"dependencies": {
"@sphereon/oid4vci-common": "0.10.4-unstable.49+e6eaf17",
"@sphereon/oid4vci-common": "0.10.4-unstable.52+125cb81",
"@sphereon/ssi-types": "workspace:*",
"@veramo/core": "4.2.0",
"cross-fetch": "^3.1.8"
Expand Down
2 changes: 1 addition & 1 deletion packages/oid4vci-issuer-store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build:clean": "tsc --build --clean && tsc --build"
},
"dependencies": {
"@sphereon/oid4vci-common": "0.10.4-unstable.49+e6eaf17",
"@sphereon/oid4vci-common": "0.10.4-unstable.52+125cb81",
"@sphereon/ssi-sdk-ext.did-utils": "0.19.0",
"@sphereon/ssi-sdk.kv-store-temp": "workspace:*",
"@veramo/core": "4.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/oid4vci-issuer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"build:clean": "tsc --build --clean && tsc --build"
},
"dependencies": {
"@sphereon/oid4vci-common": "0.10.4-unstable.49+e6eaf17",
"@sphereon/oid4vci-issuer": "0.10.4-unstable.49+e6eaf17",
"@sphereon/oid4vci-common": "0.10.4-unstable.52+125cb81",
"@sphereon/oid4vci-issuer": "0.10.4-unstable.52+125cb81",
"@sphereon/ssi-sdk-ext.did-utils": "0.19.0",
"@sphereon/ssi-sdk.core": "workspace:*",
"@sphereon/ssi-sdk.kv-store-temp": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/oid4vci-issuer/src/functions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IssuerMetadata, Jwt, JwtVerifyResult, OID4VCICredentialFormat, UniformCredentialRequest } from '@sphereon/oid4vci-common'
import { CredentialRequest, IssuerMetadata, Jwt, JwtVerifyResult, OID4VCICredentialFormat } from '@sphereon/oid4vci-common'
import { CredentialDataSupplier, CredentialIssuanceInput, CredentialSignerCallback, VcIssuer, VcIssuerBuilder } from '@sphereon/oid4vci-issuer'
import { getAgentResolver, getDID, getFirstKeyWithRelation, getIdentifier, getKey, IDIDOptions, toDID } from '@sphereon/ssi-sdk-ext.did-utils'
import { ICredential, W3CVerifiableCredential } from '@sphereon/ssi-types'
Expand Down Expand Up @@ -123,7 +123,7 @@ export function getAccessTokenSignerCallback(

export function getCredentialSignerCallback(didOpts: IDIDOptions, context: IRequiredContext): CredentialSignerCallback<DIDDocument> {
async function issueVCCallback(args: {
credentialRequest: UniformCredentialRequest
credentialRequest: CredentialRequest
credential: CredentialIssuanceInput
jwtVerifyResult: JwtVerifyResult<DIDDocument>
format?: OID4VCICredentialFormat
Expand Down
4 changes: 2 additions & 2 deletions packages/oid4vci-issuer/src/types/IOID4VCIIssuer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
CredentialDataSupplierInput,
CredentialOfferSession,
CredentialIssuerMetadataOpts,
CredentialRequestV1_0_11,
CredentialRequest,
CredentialResponse,
Grant,
JsonLdIssuerCredentialDefinition,
Expand Down Expand Up @@ -47,7 +47,7 @@ export interface ICreateOfferArgs extends IIssuerInstanceArgs {
}

export interface IIssueCredentialArgs extends IIssuerInstanceArgs {
credentialRequest: CredentialRequestV1_0_11
credentialRequest: CredentialRequest
credential?: ICredential
credentialDataSupplier?: CredentialDataSupplier
credentialDataSupplierInput?: CredentialDataSupplierInput
Expand Down
Loading

0 comments on commit de1d6aa

Please sign in to comment.