@sphereon/oid4vci-common 0.12.1-next.21 → 0.12.1-next.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/functions/FormatUtils.js +1 -1
- package/dist/functions/FormatUtils.js.map +1 -1
- package/dist/functions/ProofUtil.js +2 -2
- package/dist/types/CredentialIssuance.types.d.ts +2 -2
- package/dist/types/Generic.types.d.ts +1 -1
- package/lib/functions/FormatUtils.ts +1 -1
- package/lib/functions/ProofUtil.ts +2 -2
- package/lib/types/CredentialIssuance.types.ts +2 -2
- package/lib/types/Generic.types.ts +1 -1
- package/package.json +2 -2
|
@@ -19,7 +19,7 @@ function getUniformFormat(format) {
|
|
|
19
19
|
return format;
|
|
20
20
|
}
|
|
21
21
|
// Older formats
|
|
22
|
-
if (format === 'jwt_vc' || format === 'jwt') {
|
|
22
|
+
if (format.toLocaleLowerCase() === 'jwt_vc' || format.toLocaleLowerCase() === 'jwt') {
|
|
23
23
|
return 'jwt_vc';
|
|
24
24
|
}
|
|
25
25
|
if (format === 'ldp_vc' || format === 'ldp') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormatUtils.js","sourceRoot":"","sources":["../../lib/functions/FormatUtils.ts"],"names":[],"mappings":";;;AAEA,oCAAsE;AAEtE,SAAgB,QAAQ,CACtB,YAAe,EACf,MAAc;IAEd,OAAO,YAAY,CAAC,MAAM,KAAK,MAAM,CAAC;AACxC,CAAC;AALD,4BAKC;AAED,SAAgB,WAAW,CACzB,YAAe,EACf,MAAc;IAEd,OAAO,YAAY,CAAC,MAAM,KAAK,MAAM,CAAC;AACxC,CAAC;AALD,kCAKC;AAED,MAAM,eAAe,GAAG,CAAC,MAAc,EAAqC,EAAE;IAC5E,OAAO,CAAC,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACnF,CAAC,CAAC;AAEF,SAAgB,g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AAE,OAA0B;IAC5E,MAAM,aAAa,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAElF,IAAI,OAAO,KAAK,yBAAiB,CAAC,UAAU,EAAE,CAAC;QAC7C,IAAI,aAAa,KAAK,aAAa,EAAE,CAAC;YACpC,OAAO,QAAiB,CAAC;QAC3B,CAAC;aAAM,IAAI,aAAa,KAAK,QAAQ,IAAI,aAAa,KAAK,gBAAgB,EAAE,CAAC;YAC5E,OAAO,QAAiB,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAZD,kDAYC"}
|
|
@@ -43,7 +43,7 @@ const createProofOfPossession = (popMode, callbacks, jwtProps, existingJwt) => _
|
|
|
43
43
|
const signerArgs = createJWT(popMode, jwtProps, existingJwt);
|
|
44
44
|
const jwt = yield callbacks.signCallback(signerArgs, signerArgs.header.kid);
|
|
45
45
|
const proof = {
|
|
46
|
-
proof_type: '
|
|
46
|
+
proof_type: 'JWT',
|
|
47
47
|
jwt,
|
|
48
48
|
};
|
|
49
49
|
try {
|
|
@@ -107,7 +107,7 @@ const createJWT = (mode, jwtProps, existingJwt) => {
|
|
|
107
107
|
// mode === 'pop'
|
|
108
108
|
getJwtProperty('iss', false, jwtProps === null || jwtProps === void 0 ? void 0 : jwtProps.clientId, (_c = existingJwt === null || existingJwt === void 0 ? void 0 : existingJwt.payload) === null || _c === void 0 ? void 0 : _c.iss);
|
|
109
109
|
// : getJwtProperty<string>('iss', false, jwtProps?.issuer, existingJwt?.payload?.iss);
|
|
110
|
-
const client_id = mode === '
|
|
110
|
+
const client_id = mode === 'JWT' ? getJwtProperty('client_id', false, jwtProps === null || jwtProps === void 0 ? void 0 : jwtProps.clientId, (_d = existingJwt === null || existingJwt === void 0 ? void 0 : existingJwt.payload) === null || _d === void 0 ? void 0 : _d.client_id) : undefined;
|
|
111
111
|
const jti = getJwtProperty('jti', false, jwtProps === null || jwtProps === void 0 ? void 0 : jwtProps.jti, (_e = existingJwt === null || existingJwt === void 0 ? void 0 : existingJwt.payload) === null || _e === void 0 ? void 0 : _e.jti);
|
|
112
112
|
const typ = getJwtProperty('typ', true, jwtProps === null || jwtProps === void 0 ? void 0 : jwtProps.typ, (_f = existingJwt === null || existingJwt === void 0 ? void 0 : existingJwt.header) === null || _f === void 0 ? void 0 : _f.typ, 'openid4vci-proof+jwt');
|
|
113
113
|
const nonce = getJwtProperty('nonce', false, jwtProps === null || jwtProps === void 0 ? void 0 : jwtProps.nonce, (_g = existingJwt === null || existingJwt === void 0 ? void 0 : existingJwt.payload) === null || _g === void 0 ? void 0 : _g.nonce); // Officially this is required, but some implementations don't have it
|
|
@@ -45,7 +45,7 @@ export interface UniformCredentialOfferRequest extends AssertedUniformCredential
|
|
|
45
45
|
}
|
|
46
46
|
export type UniformCredentialOfferPayload = CredentialOfferPayloadV1_0_11 | CredentialOfferPayloadV1_0_13;
|
|
47
47
|
export interface ProofOfPossession {
|
|
48
|
-
proof_type: '
|
|
48
|
+
proof_type: 'JWT';
|
|
49
49
|
jwt: string;
|
|
50
50
|
[x: string]: unknown;
|
|
51
51
|
}
|
|
@@ -125,7 +125,7 @@ export declare enum Alg {
|
|
|
125
125
|
RS384 = "RS384",
|
|
126
126
|
RS512 = "RS512"
|
|
127
127
|
}
|
|
128
|
-
export type Typ = '
|
|
128
|
+
export type Typ = 'JWT' | 'openid4vci-proof+jwt';
|
|
129
129
|
export interface JoseHeaderParameters {
|
|
130
130
|
kid?: string;
|
|
131
131
|
x5t?: string;
|
|
@@ -8,7 +8,7 @@ import { CredentialRequestV1_0_11, EndpointMetadataResultV1_0_11 } from './v1_0_
|
|
|
8
8
|
import { CredentialConfigurationSupportedV1_0_13, CredentialRequestV1_0_13, EndpointMetadataResultV1_0_13, IssuerMetadataV1_0_13 } from './v1_0_13.types';
|
|
9
9
|
export type InputCharSet = 'numeric' | 'text';
|
|
10
10
|
export type KeyProofType = 'jwt' | 'cwt' | 'ldp_vp';
|
|
11
|
-
export type PoPMode = 'pop' | '
|
|
11
|
+
export type PoPMode = 'pop' | 'JWT';
|
|
12
12
|
/**
|
|
13
13
|
* Important Note: please be aware that these Common interfaces are based on versions v1_0.11 and v1_0.09
|
|
14
14
|
*/
|
|
@@ -27,7 +27,7 @@ export function getUniformFormat(format: string | OID4VCICredentialFormat | Cred
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// Older formats
|
|
30
|
-
if (format === 'jwt_vc' || format === 'jwt') {
|
|
30
|
+
if (format.toLocaleLowerCase() === 'jwt_vc' || format.toLocaleLowerCase() === 'jwt') {
|
|
31
31
|
return 'jwt_vc';
|
|
32
32
|
}
|
|
33
33
|
if (format === 'ldp_vc' || format === 'ldp') {
|
|
@@ -50,7 +50,7 @@ export const createProofOfPossession = async <DIDDoc>(
|
|
|
50
50
|
const signerArgs = createJWT(popMode, jwtProps, existingJwt);
|
|
51
51
|
const jwt = await callbacks.signCallback(signerArgs, signerArgs.header.kid);
|
|
52
52
|
const proof = {
|
|
53
|
-
proof_type: '
|
|
53
|
+
proof_type: 'JWT',
|
|
54
54
|
jwt,
|
|
55
55
|
} as ProofOfPossession;
|
|
56
56
|
|
|
@@ -133,7 +133,7 @@ const createJWT = (mode: PoPMode, jwtProps?: JwtProps, existingJwt?: Jwt): Jwt =
|
|
|
133
133
|
// mode === 'pop'
|
|
134
134
|
getJwtProperty<string>('iss', false, jwtProps?.clientId, existingJwt?.payload?.iss);
|
|
135
135
|
// : getJwtProperty<string>('iss', false, jwtProps?.issuer, existingJwt?.payload?.iss);
|
|
136
|
-
const client_id = mode === '
|
|
136
|
+
const client_id = mode === 'JWT' ? getJwtProperty<string>('client_id', false, jwtProps?.clientId, existingJwt?.payload?.client_id) : undefined;
|
|
137
137
|
const jti = getJwtProperty<string>('jti', false, jwtProps?.jti, existingJwt?.payload?.jti);
|
|
138
138
|
const typ = getJwtProperty<string>('typ', true, jwtProps?.typ, existingJwt?.header?.typ, 'openid4vci-proof+jwt');
|
|
139
139
|
const nonce = getJwtProperty<string>('nonce', false, jwtProps?.nonce, existingJwt?.payload?.nonce); // Officially this is required, but some implementations don't have it
|
|
@@ -64,7 +64,7 @@ export interface UniformCredentialOfferRequest extends AssertedUniformCredential
|
|
|
64
64
|
export type UniformCredentialOfferPayload = CredentialOfferPayloadV1_0_11 | CredentialOfferPayloadV1_0_13;
|
|
65
65
|
|
|
66
66
|
export interface ProofOfPossession {
|
|
67
|
-
proof_type: '
|
|
67
|
+
proof_type: 'JWT';
|
|
68
68
|
jwt: string;
|
|
69
69
|
|
|
70
70
|
[x: string]: unknown;
|
|
@@ -158,7 +158,7 @@ export enum Alg {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
export type Typ =
|
|
161
|
-
| '
|
|
161
|
+
| 'JWT'
|
|
162
162
|
// https://www.rfc-editor.org/rfc/rfc8725.pdf#name-use-explicit-typing
|
|
163
163
|
// https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#section-7.2.1-2.1.2.1.2.1.1
|
|
164
164
|
| 'openid4vci-proof+jwt';
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
export type InputCharSet = 'numeric' | 'text';
|
|
18
18
|
export type KeyProofType = 'jwt' | 'cwt' | 'ldp_vp';
|
|
19
19
|
|
|
20
|
-
export type PoPMode = 'pop' | '
|
|
20
|
+
export type PoPMode = 'pop' | 'JWT'; // Proof of posession, or regular JWT
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Important Note: please be aware that these Common interfaces are based on versions v1_0.11 and v1_0.09
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/oid4vci-common",
|
|
3
|
-
"version": "0.12.1-next.
|
|
3
|
+
"version": "0.12.1-next.23+1ff4e40",
|
|
4
4
|
"description": "OpenID 4 Verifiable Credential Issuance Common Types",
|
|
5
5
|
"source": "lib/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "1ff4e40cefb183072951e3ede3f8b3a5842d645a"
|
|
53
53
|
}
|