Skip to content

Commit ad12217

Browse files
committed
chore: statusListOpts support in CredentialOfferRESTRequest and CredentialSignerCallback
1 parent f935d94 commit ad12217

File tree

5 files changed

+22
-14
lines changed

5 files changed

+22
-14
lines changed

packages/issuer/lib/VcIssuer.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ import {
3535
OpenId4VCIVersion,
3636
PRE_AUTH_GRANT_LITERAL,
3737
QRCodeOpts,
38+
StatusListOpts,
3839
TokenErrorResponse,
3940
toUniformCredentialOfferRequest,
4041
TxCode,
4142
TYP_ERROR,
42-
URIState,
43+
URIState
4344
} from '@sphereon/oid4vci-common'
4445
import {
4546
CompactSdJwtVc,
@@ -139,9 +140,9 @@ export class VcIssuer<DIDDoc extends object> {
139140
scheme?: string
140141
pinLength?: number
141142
qrCodeOpts?: QRCodeOpts,
142-
statusEntryCorrelationId?: string
143+
statusListOpts? :Array<StatusListOpts>
143144
}): Promise<CreateCredentialOfferURIResult> {
144-
const { credential_configuration_ids, statusEntryCorrelationId } = opts
145+
const { credential_configuration_ids, statusListOpts } = opts
145146

146147
const grants = opts.grants ? { ...opts.grants } : {}
147148
// for backwards compat, would be better if user sets the prop on the grants directly
@@ -214,7 +215,7 @@ export class VcIssuer<DIDDoc extends object> {
214215
...(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
215216
...(opts.credentialDataSupplierInput && { credentialDataSupplierInput: opts.credentialDataSupplierInput }),
216217
credentialOffer,
217-
statusEntryCorrelationId
218+
statusListOpts
218219
}
219220

220221
if (preAuthorizedCode) {
@@ -391,7 +392,7 @@ export class VcIssuer<DIDDoc extends object> {
391392
credential,
392393
jwtVerifyResult,
393394
issuer,
394-
...(session && {statusEntryCorrelationId: session.statusEntryCorrelationId})
395+
...(session && {statusListOpts: session.statusListOpts})
395396
},
396397
signerCallback,
397398
)
@@ -671,7 +672,7 @@ export class VcIssuer<DIDDoc extends object> {
671672
jwtVerifyResult: JwtVerifyResult<DIDDoc>
672673
format?: OID4VCICredentialFormat
673674
issuer?: string
674-
statusEntryCorrelationId?: string
675+
statusListOpts?: Array<StatusListOpts>
675676
},
676677
issuerCallback?: CredentialSignerCallback<DIDDoc>,
677678
): Promise<W3CVerifiableCredential | CompactSdJwtVc> {

packages/issuer/lib/types/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
CredentialRequest,
66
CredentialSupplierConfig,
77
JwtVerifyResult,
8-
OID4VCICredentialFormat,
9-
UniformCredentialRequest,
8+
OID4VCICredentialFormat, StatusListOpts,
9+
UniformCredentialRequest
1010
} from '@sphereon/oid4vci-common'
1111
import {
1212
CompactSdJwtVc,
@@ -25,7 +25,7 @@ export type CredentialSignerCallback<T extends object> = (opts: {
2525
* An implementation that wants to look into the DIDDoc would have to do a cast in the signer callback implementation
2626
*/
2727
jwtVerifyResult: JwtVerifyResult<T>
28-
statusEntryCorrelationId?: string
28+
statusListOpts? :Array<StatusListOpts>
2929
}) => Promise<W3CVerifiableCredential | CompactSdJwtVc>
3030

3131
export interface CredentialDataSupplierArgs extends CNonceState {

packages/oid4vci-common/lib/types/Generic.types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,3 +425,10 @@ export type NotificationResponseResult = {
425425
export interface NotificationErrorResponse {
426426
error: NotificationError | string;
427427
}
428+
429+
export interface StatusListOpts {
430+
statusListId: string
431+
statusListCorrelationId: string
432+
statusEntryIndex?: number
433+
statusEntryCorrelationId?: string
434+
}

packages/oid4vci-common/lib/types/StateManager.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AssertedUniformCredentialOffer } from './CredentialIssuance.types';
2-
import { CredentialDataSupplierInput, NotificationRequest } from './Generic.types'
2+
import { CredentialDataSupplierInput, NotificationRequest, StatusListOpts } from './Generic.types'
33

44
export interface StateType {
55
createdAt: number;
@@ -18,7 +18,7 @@ export interface CredentialOfferSession extends StateType {
1818
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
1919
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
2020
authorizationCode?: string
21-
statusEntryCorrelationId?: string
21+
statusListOpts? :Array<StatusListOpts>
2222
}
2323

2424
export enum IssueStatus {

packages/oid4vci-common/lib/types/v1_0_13.types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import {
1717
MetadataDisplay,
1818
OID4VCICredentialFormat,
1919
ProofTypesSupported,
20-
ResponseEncryption,
21-
} from './Generic.types';
20+
ResponseEncryption, StatusListOpts
21+
} from './Generic.types'
2222
import { QRCodeOpts } from './QRCode.types';
2323
import { AuthorizationServerMetadata, AuthorizationServerType, EndpointMetadata } from './ServerMetadata';
2424

@@ -156,7 +156,7 @@ export interface CredentialOfferRESTRequest extends CredentialOfferV1_0_13 {
156156
pinLength?: number;
157157
qrCodeOpts?: QRCodeOpts;
158158
credentialDataSupplierInput?: CredentialDataSupplierInput;
159-
statusEntryCorrelationId?: string
159+
statusListOpts?: Array<StatusListOpts>
160160
}
161161

162162
export interface CredentialOfferPayloadV1_0_13 {

0 commit comments

Comments
 (0)