diff --git a/packages/issuer/lib/VcIssuer.ts b/packages/issuer/lib/VcIssuer.ts index 45448710..df7a87d8 100644 --- a/packages/issuer/lib/VcIssuer.ts +++ b/packages/issuer/lib/VcIssuer.ts @@ -35,11 +35,12 @@ import { OpenId4VCIVersion, PRE_AUTH_GRANT_LITERAL, QRCodeOpts, + StatusListOpts, TokenErrorResponse, toUniformCredentialOfferRequest, TxCode, TYP_ERROR, - URIState, + URIState } from '@sphereon/oid4vci-common' import { CompactSdJwtVc, @@ -139,9 +140,9 @@ export class VcIssuer { scheme?: string pinLength?: number qrCodeOpts?: QRCodeOpts, - statusEntryCorrelationId?: string + statusListOpts? :Array }): Promise { - const { credential_configuration_ids, statusEntryCorrelationId } = opts + const { credential_configuration_ids, statusListOpts } = opts const grants = opts.grants ? { ...opts.grants } : {} // for backwards compat, would be better if user sets the prop on the grants directly @@ -214,7 +215,7 @@ export class VcIssuer { ...(userPin && { txCode: userPin }), // We used to use userPin according to older specs. We map these onto txCode now. If both are used, txCode in the end wins, even if they are different ...(opts.credentialDataSupplierInput && { credentialDataSupplierInput: opts.credentialDataSupplierInput }), credentialOffer, - statusEntryCorrelationId + statusListOpts } if (preAuthorizedCode) { @@ -391,7 +392,7 @@ export class VcIssuer { credential, jwtVerifyResult, issuer, - ...(session && {statusEntryCorrelationId: session.statusEntryCorrelationId}) + ...(session && {statusListOpts: session.statusListOpts}) }, signerCallback, ) @@ -671,7 +672,7 @@ export class VcIssuer { jwtVerifyResult: JwtVerifyResult format?: OID4VCICredentialFormat issuer?: string - statusEntryCorrelationId?: string + statusListOpts?: Array }, issuerCallback?: CredentialSignerCallback, ): Promise { diff --git a/packages/issuer/lib/types/index.ts b/packages/issuer/lib/types/index.ts index 637da204..f7301ba9 100644 --- a/packages/issuer/lib/types/index.ts +++ b/packages/issuer/lib/types/index.ts @@ -5,8 +5,8 @@ import { CredentialRequest, CredentialSupplierConfig, JwtVerifyResult, - OID4VCICredentialFormat, - UniformCredentialRequest, + OID4VCICredentialFormat, StatusListOpts, + UniformCredentialRequest } from '@sphereon/oid4vci-common' import { CompactSdJwtVc, @@ -25,7 +25,7 @@ export type CredentialSignerCallback = (opts: { * An implementation that wants to look into the DIDDoc would have to do a cast in the signer callback implementation */ jwtVerifyResult: JwtVerifyResult - statusEntryCorrelationId?: string + statusListOpts? :Array }) => Promise export interface CredentialDataSupplierArgs extends CNonceState { diff --git a/packages/oid4vci-common/lib/types/Generic.types.ts b/packages/oid4vci-common/lib/types/Generic.types.ts index 78be07a2..be1a1aad 100644 --- a/packages/oid4vci-common/lib/types/Generic.types.ts +++ b/packages/oid4vci-common/lib/types/Generic.types.ts @@ -425,3 +425,10 @@ export type NotificationResponseResult = { export interface NotificationErrorResponse { error: NotificationError | string; } + +export interface StatusListOpts { + statusListId: string + statusListCorrelationId: string + statusEntryIndex?: number + statusEntryCorrelationId?: string +} diff --git a/packages/oid4vci-common/lib/types/StateManager.types.ts b/packages/oid4vci-common/lib/types/StateManager.types.ts index 45f2942b..4ad4e37b 100644 --- a/packages/oid4vci-common/lib/types/StateManager.types.ts +++ b/packages/oid4vci-common/lib/types/StateManager.types.ts @@ -1,5 +1,5 @@ import { AssertedUniformCredentialOffer } from './CredentialIssuance.types'; -import { CredentialDataSupplierInput, NotificationRequest } from './Generic.types' +import { CredentialDataSupplierInput, NotificationRequest, StatusListOpts } from './Generic.types' export interface StateType { createdAt: number; @@ -18,7 +18,7 @@ export interface CredentialOfferSession extends StateType { issuerState?: string; //todo: Probably good to hash it here, since it would come in from the client and we could match the hash and thus use the client value preAuthorizedCode?: string; //todo: Probably good to hash it here, since it would come in from the client and we could match the hash and thus use the client value authorizationCode?: string - statusEntryCorrelationId?: string + statusListOpts? :Array } export enum IssueStatus { diff --git a/packages/oid4vci-common/lib/types/v1_0_13.types.ts b/packages/oid4vci-common/lib/types/v1_0_13.types.ts index 52de7d8c..f978e0fa 100644 --- a/packages/oid4vci-common/lib/types/v1_0_13.types.ts +++ b/packages/oid4vci-common/lib/types/v1_0_13.types.ts @@ -17,8 +17,8 @@ import { MetadataDisplay, OID4VCICredentialFormat, ProofTypesSupported, - ResponseEncryption, -} from './Generic.types'; + ResponseEncryption, StatusListOpts +} from './Generic.types' import { QRCodeOpts } from './QRCode.types'; import { AuthorizationServerMetadata, AuthorizationServerType, EndpointMetadata } from './ServerMetadata'; @@ -156,7 +156,7 @@ export interface CredentialOfferRESTRequest extends CredentialOfferV1_0_13 { pinLength?: number; qrCodeOpts?: QRCodeOpts; credentialDataSupplierInput?: CredentialDataSupplierInput; - statusEntryCorrelationId?: string + statusListOpts?: Array } export interface CredentialOfferPayloadV1_0_13 {