@credo-ts/openid4vc 0.6.0-pr-2195-20250226100854 → 0.6.0-pr-2209-20250321171013
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/build/openid4vc-holder/OpenId4VcHolderApi.d.ts +14 -119
- package/build/openid4vc-holder/OpenId4VcHolderApi.js +9 -24
- package/build/openid4vc-holder/OpenId4VcHolderApi.js.map +1 -1
- package/build/openid4vc-holder/OpenId4VcHolderModule.js +1 -1
- package/build/openid4vc-holder/OpenId4VcHolderModule.js.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderService.d.ts +8 -7
- package/build/openid4vc-holder/OpenId4VciHolderService.js +21 -19
- package/build/openid4vc-holder/OpenId4VciHolderService.js.map +1 -1
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.ts +4 -4
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js +2 -2
- package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js.map +1 -1
- package/build/openid4vc-holder/OpenId4vcSiopHolderService.d.ts +15 -116
- package/build/openid4vc-holder/OpenId4vcSiopHolderService.js +233 -239
- package/build/openid4vc-holder/OpenId4vcSiopHolderService.js.map +1 -1
- package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.d.ts +9 -25
- package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.ts +44 -194
- package/build/openid4vc-issuer/OpenId4VcIssuerEvents.d.ts +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.ts +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.js +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModule.js.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.ts +8 -8
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js +10 -2
- package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts +48 -198
- package/build/openid4vc-issuer/OpenId4VcIssuerService.js +27 -39
- package/build/openid4vc-issuer/OpenId4VcIssuerService.js.map +1 -1
- package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.ts +6 -11
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts +2 -2
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js +1 -0
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.ts +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.ts +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js +3 -3
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js.map +1 -1
- package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.d.ts +1 -1
- package/build/openid4vc-issuer/router/accessTokenEndpoint.d.ts +2 -2
- package/build/openid4vc-issuer/router/accessTokenEndpoint.js +1 -1
- package/build/openid4vc-issuer/router/accessTokenEndpoint.js.map +1 -1
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js +1 -1
- package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js.map +1 -1
- package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.js +1 -1
- package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.js.map +1 -1
- package/build/openid4vc-issuer/router/credentialEndpoint.d.ts +1 -1
- package/build/openid4vc-issuer/router/credentialEndpoint.js +3 -3
- package/build/openid4vc-issuer/router/credentialEndpoint.js.map +1 -1
- package/build/openid4vc-issuer/router/credentialOfferEndpoint.d.ts +1 -1
- package/build/openid4vc-issuer/router/issuerMetadataEndpoint.js +1 -1
- package/build/openid4vc-issuer/router/issuerMetadataEndpoint.js.map +1 -1
- package/build/openid4vc-issuer/router/jwksEndpoint.d.ts +1 -1
- package/build/openid4vc-issuer/router/nonceEndpoint.d.ts +1 -1
- package/build/openid4vc-issuer/util/txCode.d.ts +1 -1
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.d.ts +13 -25
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js +326 -579
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js.map +1 -1
- package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.d.ts +20 -36
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts +2 -2
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.js +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierApi.js.map +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierEvents.d.ts +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.ts +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.js +4 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierModule.js.map +1 -1
- package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.d.ts +2 -2
- package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.d.ts +49 -0
- package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js +230 -0
- package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js.map +1 -0
- package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.d.ts +19 -0
- package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js +144 -0
- package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js.map +1 -0
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.ts +11 -20
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js +7 -18
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js.map +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.d.ts +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.ts +1 -1
- package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.d.ts +1 -1
- package/build/openid4vc-verifier/router/authorizationEndpoint.js +103 -5
- package/build/openid4vc-verifier/router/authorizationEndpoint.js.map +1 -1
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js +16 -3
- package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js.map +1 -1
- package/build/shared/callbacks.d.ts +6 -14
- package/build/shared/callbacks.js +14 -102
- package/build/shared/callbacks.js.map +1 -1
- package/build/shared/issuerMetadataUtils.d.ts +144 -102
- package/build/shared/models/OpenId4VcJwtIssuer.d.ts +3 -2
- package/build/shared/models/index.d.ts +10 -10
- package/build/shared/models/index.js +5 -5
- package/build/shared/models/index.js.map +1 -1
- package/build/shared/router/context.d.ts +3 -3
- package/build/shared/router/context.js +4 -4
- package/build/shared/router/context.js.map +1 -1
- package/build/shared/router/express.js +1 -2
- package/build/shared/router/express.js.map +1 -1
- package/build/shared/transform.d.ts +5 -0
- package/build/shared/transform.js +69 -0
- package/build/shared/transform.js.map +1 -0
- package/build/shared/utils.d.ts +8 -6
- package/build/shared/utils.js +105 -34
- package/build/shared/utils.js.map +1 -1
- package/package.json +8 -6
|
@@ -1,117 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.getOid4vcJwtSignCallback = getOid4vcJwtSignCallback;
|
|
7
|
-
exports.getOid4vcCallbacks = getOid4vcCallbacks;
|
|
3
|
+
exports.getOid4vciJwtVerifyCallback = getOid4vciJwtVerifyCallback;
|
|
4
|
+
exports.getOid4vciJwtSignCallback = getOid4vciJwtSignCallback;
|
|
5
|
+
exports.getOid4vciCallbacks = getOid4vciCallbacks;
|
|
8
6
|
exports.dynamicOid4vciClientAuthentication = dynamicOid4vciClientAuthentication;
|
|
7
|
+
const oauth2_1 = require("@animo-id/oauth2");
|
|
9
8
|
const core_1 = require("@credo-ts/core");
|
|
10
|
-
const oauth2_1 = require("@openid4vc/oauth2");
|
|
11
9
|
const utils_1 = require("./utils");
|
|
12
|
-
function
|
|
10
|
+
function getOid4vciJwtVerifyCallback(agentContext) {
|
|
13
11
|
const jwsService = agentContext.dependencyManager.resolve(core_1.JwsService);
|
|
14
12
|
return async (signer, { compact }) => {
|
|
15
|
-
const { isValid
|
|
13
|
+
const { isValid } = await jwsService.verifyJws(agentContext, {
|
|
16
14
|
jws: compact,
|
|
17
|
-
trustedCertificates,
|
|
18
15
|
// Only handles kid as did resolution. JWK is handled by jws service
|
|
19
16
|
jwkResolver: async () => {
|
|
20
17
|
if (signer.method === 'jwk') {
|
|
21
18
|
return (0, core_1.getJwkFromJson)(signer.publicJwk);
|
|
22
19
|
}
|
|
23
|
-
|
|
20
|
+
if (signer.method === 'did') {
|
|
24
21
|
const key = await (0, utils_1.getKeyFromDid)(agentContext, signer.didUrl);
|
|
25
22
|
return (0, core_1.getJwkFromKey)(key);
|
|
26
23
|
}
|
|
27
24
|
throw new core_1.CredoError(`Unexpected call to jwk resolver for signer method ${signer.method}`);
|
|
28
25
|
},
|
|
29
26
|
});
|
|
30
|
-
|
|
31
|
-
return { verified: false, signerJwk: undefined };
|
|
32
|
-
}
|
|
33
|
-
const signerKey = signerKeys[0];
|
|
34
|
-
const signerJwk = (0, core_1.getJwkFromKey)(signerKey).toJson();
|
|
35
|
-
if (signer.method === 'did') {
|
|
36
|
-
signerJwk.kid = signer.didUrl;
|
|
37
|
-
}
|
|
38
|
-
return { verified: true, signerJwk };
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
function getOid4vcEncryptJweCallback(agentContext) {
|
|
42
|
-
return async (jweEncryptor, compact) => {
|
|
43
|
-
if (jweEncryptor.method !== 'jwk') {
|
|
44
|
-
throw new core_1.CredoError(`Jwt encryption method '${jweEncryptor.method}' is not supported for jwt signer. Only 'jwk' is supported.`);
|
|
45
|
-
}
|
|
46
|
-
const jwk = (0, core_1.getJwkFromJson)(jweEncryptor.publicJwk);
|
|
47
|
-
const key = jwk.key;
|
|
48
|
-
if (jweEncryptor.alg !== 'ECDH-ES') {
|
|
49
|
-
throw new core_1.CredoError("Only 'ECDH-ES' is supported as 'alg' value for JARM response encryption");
|
|
50
|
-
}
|
|
51
|
-
if (jweEncryptor.enc !== 'A256GCM' && jweEncryptor.enc !== 'A128GCM' && jweEncryptor.enc !== 'A128CBC-HS256') {
|
|
52
|
-
throw new core_1.CredoError("Only 'A256GCM', 'A128GCM', and 'A128CBC-HS256' is supported as 'enc' value for JARM response encryption");
|
|
53
|
-
}
|
|
54
|
-
if (key.keyType !== core_1.KeyType.P256) {
|
|
55
|
-
throw new core_1.CredoError(`Only '${core_1.KeyType.P256}' key type is supported for JARM response encryption`);
|
|
56
|
-
}
|
|
57
|
-
if (!agentContext.wallet.directEncryptCompactJweEcdhEs) {
|
|
58
|
-
throw new core_1.CredoError('Cannot decrypt Jarm Response, wallet does not support directEncryptCompactJweEcdhEs. You need to upgrade your wallet implementation.');
|
|
59
|
-
}
|
|
60
|
-
const jwe = await agentContext.wallet.directEncryptCompactJweEcdhEs({
|
|
61
|
-
data: core_1.Buffer.from(compact),
|
|
62
|
-
recipientKey: key,
|
|
63
|
-
header: { kid: jweEncryptor.publicJwk.kid },
|
|
64
|
-
encryptionAlgorithm: jweEncryptor.enc,
|
|
65
|
-
apu: jweEncryptor.apu ? core_1.TypedArrayEncoder.toBase64URL(core_1.TypedArrayEncoder.fromString(jweEncryptor.apu)) : undefined,
|
|
66
|
-
apv: jweEncryptor.apv ? core_1.TypedArrayEncoder.toBase64URL(core_1.TypedArrayEncoder.fromString(jweEncryptor.apv)) : undefined,
|
|
67
|
-
});
|
|
68
|
-
return { encryptionJwk: jweEncryptor.publicJwk, jwe };
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function getOid4vcDecryptJweCallback(agentContext) {
|
|
72
|
-
return async (jwe, options) => {
|
|
73
|
-
const [header] = jwe.split('.');
|
|
74
|
-
const decodedHeader = core_1.JsonEncoder.fromBase64(header);
|
|
75
|
-
const key = core_1.Key.fromFingerprint(options?.jwk.kid ?? decodedHeader.kid);
|
|
76
|
-
if (!agentContext.wallet.directDecryptCompactJweEcdhEs) {
|
|
77
|
-
throw new core_1.CredoError('Cannot decrypt Jarm Response, wallet does not support directDecryptCompactJweEcdhEs');
|
|
78
|
-
}
|
|
79
|
-
let decryptedPayload;
|
|
80
|
-
try {
|
|
81
|
-
const decrypted = await agentContext.wallet.directDecryptCompactJweEcdhEs({ compactJwe: jwe, recipientKey: key });
|
|
82
|
-
decryptedPayload = core_1.TypedArrayEncoder.toUtf8String(decrypted.data);
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
return {
|
|
86
|
-
decrypted: false,
|
|
87
|
-
encryptionJwk: options?.jwk,
|
|
88
|
-
payload: undefined,
|
|
89
|
-
header: decodedHeader,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
decrypted: true,
|
|
94
|
-
decryptionJwk: (0, core_1.getJwkFromKey)(key).toJson(),
|
|
95
|
-
payload: decryptedPayload,
|
|
96
|
-
header: decodedHeader,
|
|
97
|
-
};
|
|
27
|
+
return isValid;
|
|
98
28
|
};
|
|
99
29
|
}
|
|
100
|
-
function
|
|
30
|
+
function getOid4vciJwtSignCallback(agentContext) {
|
|
101
31
|
const jwsService = agentContext.dependencyManager.resolve(core_1.JwsService);
|
|
102
32
|
return async (signer, { payload, header }) => {
|
|
103
|
-
if (signer.method === 'custom' || signer.method === '
|
|
33
|
+
if (signer.method === 'custom' || signer.method === 'x5c') {
|
|
104
34
|
throw new core_1.CredoError(`Jwt signer method 'custom' and 'x5c' are not supported for jwt signer.`);
|
|
105
35
|
}
|
|
106
|
-
if (signer.method === 'x5c') {
|
|
107
|
-
const leafCertificate = core_1.X509Service.getLeafCertificate(agentContext, { certificateChain: signer.x5c });
|
|
108
|
-
const jws = await jwsService.createJwsCompact(agentContext, {
|
|
109
|
-
protectedHeaderOptions: { ...header, alg: signer.alg, jwk: undefined },
|
|
110
|
-
payload: core_1.JwtPayload.fromJson(payload),
|
|
111
|
-
key: leafCertificate.publicKey,
|
|
112
|
-
});
|
|
113
|
-
return { jwt: jws, signerJwk: (0, core_1.getJwkFromKey)(leafCertificate.publicKey).toJson() };
|
|
114
|
-
}
|
|
115
36
|
const key = signer.method === 'did' ? await (0, utils_1.getKeyFromDid)(agentContext, signer.didUrl) : (0, core_1.getJwkFromJson)(signer.publicJwk).key;
|
|
116
37
|
const jwk = (0, core_1.getJwkFromKey)(key);
|
|
117
38
|
if (!jwk.supportsSignatureAlgorithm(signer.alg)) {
|
|
@@ -125,26 +46,17 @@ function getOid4vcJwtSignCallback(agentContext) {
|
|
|
125
46
|
payload: core_1.JsonEncoder.toBuffer(payload),
|
|
126
47
|
key,
|
|
127
48
|
});
|
|
128
|
-
return
|
|
49
|
+
return jwt;
|
|
129
50
|
};
|
|
130
51
|
}
|
|
131
|
-
function
|
|
52
|
+
function getOid4vciCallbacks(agentContext) {
|
|
132
53
|
return {
|
|
133
54
|
hash: (data, alg) => core_1.Hasher.hash(data, alg.toLowerCase()),
|
|
134
55
|
generateRandom: (length) => agentContext.wallet.getRandomValues(length),
|
|
135
|
-
signJwt:
|
|
56
|
+
signJwt: getOid4vciJwtSignCallback(agentContext),
|
|
136
57
|
clientAuthentication: (0, oauth2_1.clientAuthenticationNone)(),
|
|
137
|
-
verifyJwt:
|
|
58
|
+
verifyJwt: getOid4vciJwtVerifyCallback(agentContext),
|
|
138
59
|
fetch: agentContext.config.agentDependencies.fetch,
|
|
139
|
-
encryptJwe: getOid4vcEncryptJweCallback(agentContext),
|
|
140
|
-
decryptJwe: getOid4vcDecryptJweCallback(agentContext),
|
|
141
|
-
getX509CertificateMetadata: (certificate) => {
|
|
142
|
-
const leafCertificate = core_1.X509Service.getLeafCertificate(agentContext, { certificateChain: [certificate] });
|
|
143
|
-
return {
|
|
144
|
-
sanDnsNames: leafCertificate.sanDnsNames,
|
|
145
|
-
sanUriNames: leafCertificate.sanUriNames,
|
|
146
|
-
};
|
|
147
|
-
},
|
|
148
60
|
};
|
|
149
61
|
}
|
|
150
62
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbacks.js","sourceRoot":"","sources":["../../src/shared/callbacks.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"callbacks.js","sourceRoot":"","sources":["../../src/shared/callbacks.ts"],"names":[],"mappings":";;AAcA,kEAsBC;AAED,8DA2BC;AAED,kDASC;AAMD,gFA4BC;AArGD,6CAAwF;AACxF,yCAA2G;AAE3G,mCAAuC;AAEvC,SAAgB,2BAA2B,CAAC,YAA0B;IACpE,MAAM,UAAU,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,iBAAU,CAAC,CAAA;IAErE,OAAO,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACnC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,YAAY,EAAE;YAC3D,GAAG,EAAE,OAAO;YACZ,oEAAoE;YACpE,WAAW,EAAE,KAAK,IAAI,EAAE;gBACtB,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC;oBAC5B,OAAO,IAAA,qBAAc,EAAC,MAAM,CAAC,SAAS,CAAC,CAAA;gBACzC,CAAC;gBACD,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC;oBAC5B,MAAM,GAAG,GAAG,MAAM,IAAA,qBAAa,EAAC,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;oBAC5D,OAAO,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAA;gBAC3B,CAAC;gBAED,MAAM,IAAI,iBAAU,CAAC,qDAAqD,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;YAC5F,CAAC;SACF,CAAC,CAAA;QAEF,OAAO,OAAO,CA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,mBAAmB,CAAC,oBAAoB,CAAC,QAAQ;YAC3D,YAAY,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,YAAY;SACpE,CAAC,CAAC,eAAe,CAAC,CAAA;IACrB,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OpenId4VciCredentialConfigurationsSupported, OpenId4VciCredentialConfigurationsSupportedWithFormats } from './models';
|
|
2
|
-
import { type CredentialConfigurationsSupported } from '@
|
|
2
|
+
import { type CredentialConfigurationsSupported } from '@animo-id/oid4vci';
|
|
3
3
|
/**
|
|
4
4
|
* Returns all entries from the credential offer with the associated metadata resolved.
|
|
5
5
|
*/
|
|
@@ -12,105 +12,147 @@ export declare function getAllowedAndRequestedScopeValues(options: {
|
|
|
12
12
|
allowedScopes: string[];
|
|
13
13
|
}): string[];
|
|
14
14
|
export declare function getCredentialConfigurationsSupportedForScopes(credentialConfigurationsSupported: CredentialConfigurationsSupported, scopes: string[]): {
|
|
15
|
-
[k: string]:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
15
|
+
[k: string]: ({
|
|
16
|
+
vct: string;
|
|
17
|
+
format: "vc+sd-jwt";
|
|
18
|
+
claims?: ({
|
|
19
|
+
mandatory?: boolean | undefined;
|
|
20
|
+
value_type?: string | undefined;
|
|
21
|
+
display?: ({
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
locale?: string | undefined;
|
|
24
|
+
} & {
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
}) | undefined;
|
|
27
|
+
} & {
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
}) | undefined;
|
|
30
|
+
order?: string[] | undefined;
|
|
31
|
+
} | {
|
|
32
|
+
format: "mso_mdoc";
|
|
33
|
+
doctype: string;
|
|
34
|
+
claims?: ({
|
|
35
|
+
mandatory?: boolean | undefined;
|
|
36
|
+
value_type?: string | undefined;
|
|
37
|
+
display?: ({
|
|
38
|
+
name?: string | undefined;
|
|
39
|
+
locale?: string | undefined;
|
|
40
|
+
} & {
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
}) | undefined;
|
|
43
|
+
} & {
|
|
44
|
+
[key: string]: unknown;
|
|
45
|
+
}) | undefined;
|
|
46
|
+
order?: string[] | undefined;
|
|
47
|
+
} | {
|
|
48
|
+
format: "jwt_vc_json-ld";
|
|
49
|
+
credential_definition: {
|
|
50
|
+
type: string[];
|
|
51
|
+
'@context': string[];
|
|
52
|
+
credentialSubject?: {
|
|
53
|
+
[x: string]: any[] | {
|
|
54
|
+
[x: string]: any;
|
|
55
|
+
} | ({
|
|
56
|
+
mandatory: boolean;
|
|
57
|
+
value_type?: string | undefined;
|
|
58
|
+
display?: ({
|
|
59
|
+
name?: string | undefined;
|
|
60
|
+
locale?: string | undefined;
|
|
61
|
+
} & {
|
|
62
|
+
[key: string]: unknown;
|
|
63
|
+
})[] | undefined;
|
|
64
|
+
} & {
|
|
65
|
+
[key: string]: unknown;
|
|
66
|
+
});
|
|
67
|
+
} | undefined;
|
|
68
|
+
} & {
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
};
|
|
71
|
+
order?: string[] | undefined;
|
|
72
|
+
} | {
|
|
73
|
+
format: "ldp_vc";
|
|
74
|
+
credential_definition: {
|
|
75
|
+
type: string[];
|
|
76
|
+
'@context': string[];
|
|
77
|
+
credentialSubject?: {
|
|
78
|
+
[x: string]: any[] | {
|
|
79
|
+
[x: string]: any;
|
|
80
|
+
} | ({
|
|
81
|
+
mandatory: boolean;
|
|
82
|
+
value_type?: string | undefined;
|
|
83
|
+
display?: ({
|
|
84
|
+
name?: string | undefined;
|
|
85
|
+
locale?: string | undefined;
|
|
86
|
+
} & {
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
})[] | undefined;
|
|
89
|
+
} & {
|
|
90
|
+
[key: string]: unknown;
|
|
91
|
+
});
|
|
92
|
+
} | undefined;
|
|
93
|
+
} & {
|
|
94
|
+
[key: string]: unknown;
|
|
95
|
+
};
|
|
96
|
+
order?: string[] | undefined;
|
|
97
|
+
} | {
|
|
98
|
+
format: "jwt_vc_json";
|
|
99
|
+
credential_definition: {
|
|
100
|
+
type: string[];
|
|
101
|
+
credentialSubject?: {
|
|
102
|
+
[x: string]: any[] | {
|
|
103
|
+
[x: string]: any;
|
|
104
|
+
} | ({
|
|
105
|
+
mandatory: boolean;
|
|
106
|
+
value_type?: string | undefined;
|
|
107
|
+
display?: ({
|
|
108
|
+
name?: string | undefined;
|
|
109
|
+
locale?: string | undefined;
|
|
110
|
+
} & {
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
})[] | undefined;
|
|
113
|
+
} & {
|
|
114
|
+
[key: string]: unknown;
|
|
115
|
+
});
|
|
116
|
+
} | undefined;
|
|
117
|
+
} & {
|
|
118
|
+
[key: string]: unknown;
|
|
119
|
+
};
|
|
120
|
+
order?: string[] | undefined;
|
|
121
|
+
} | ({
|
|
122
|
+
format: string;
|
|
123
|
+
} & {
|
|
124
|
+
[key: string]: unknown;
|
|
125
|
+
})) & {
|
|
126
|
+
format: string;
|
|
127
|
+
display?: ({
|
|
128
|
+
name: string;
|
|
129
|
+
description?: string | undefined;
|
|
130
|
+
locale?: string | undefined;
|
|
131
|
+
logo?: ({
|
|
132
|
+
uri?: string | undefined;
|
|
133
|
+
alt_text?: string | undefined;
|
|
134
|
+
} & {
|
|
135
|
+
[key: string]: unknown;
|
|
136
|
+
}) | undefined;
|
|
137
|
+
background_color?: string | undefined;
|
|
138
|
+
background_image?: ({
|
|
139
|
+
uri?: string | undefined;
|
|
140
|
+
} & {
|
|
141
|
+
[key: string]: unknown;
|
|
142
|
+
}) | undefined;
|
|
143
|
+
text_color?: string | undefined;
|
|
144
|
+
} & {
|
|
145
|
+
[key: string]: unknown;
|
|
146
|
+
})[] | undefined;
|
|
147
|
+
scope?: string | undefined;
|
|
148
|
+
cryptographic_binding_methods_supported?: string[] | undefined;
|
|
149
|
+
credential_signing_alg_values_supported?: string[] | undefined;
|
|
150
|
+
proof_types_supported?: {
|
|
151
|
+
[x: string]: {
|
|
152
|
+
proof_signing_alg_values_supported: string[];
|
|
153
|
+
};
|
|
154
|
+
} | undefined;
|
|
155
|
+
} & {
|
|
156
|
+
[key: string]: unknown;
|
|
157
|
+
};
|
|
116
158
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Jwk } from '@credo-ts/core';
|
|
2
|
-
|
|
2
|
+
interface OpenId4VcJwtIssuerDid {
|
|
3
3
|
method: 'did';
|
|
4
4
|
didUrl: string;
|
|
5
5
|
}
|
|
@@ -20,8 +20,9 @@ export interface OpenId4VcIssuerX5c {
|
|
|
20
20
|
*/
|
|
21
21
|
issuer: string;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
interface OpenId4VcJwtIssuerJwk {
|
|
24
24
|
method: 'jwk';
|
|
25
25
|
jwk: Jwk;
|
|
26
26
|
}
|
|
27
27
|
export type OpenId4VcJwtIssuer = OpenId4VcJwtIssuerDid | OpenId4VcIssuerX5c | OpenId4VcJwtIssuerJwk;
|
|
28
|
+
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { AccessTokenResponse } from '@
|
|
2
|
-
import type { CredentialConfigurationSupported, CredentialConfigurationSupportedWithFormats, CredentialIssuerMetadata, CredentialIssuerMetadataDisplayEntry, CredentialOfferObject, CredentialOfferPreAuthorizedCodeGrantTxCode, CredentialRequest, CredentialRequestFormatSpecific, CredentialRequestWithFormats, IssuerMetadataResult, ParseCredentialRequestReturn } from '@
|
|
3
|
-
import type {
|
|
4
|
-
export {
|
|
5
|
-
export { Openid4vpAuthorizationRequest } from '@openid4vc/openid4vp';
|
|
1
|
+
import type { AccessTokenResponse } from '@animo-id/oauth2';
|
|
2
|
+
import type { CredentialConfigurationSupported, CredentialConfigurationSupportedWithFormats, CredentialIssuerMetadata, CredentialIssuerMetadataDisplayEntry, CredentialOfferObject, CredentialOfferPreAuthorizedCodeGrantTxCode, CredentialRequest, CredentialRequestFormatSpecific, CredentialRequestWithFormats, IssuerMetadataResult, ParseCredentialRequestReturn } from '@animo-id/oid4vci';
|
|
3
|
+
import type { AuthorizationRequestPayload, AuthorizationResponsePayload, IDTokenPayload, VerifiedAuthorizationRequest } from '@sphereon/did-auth-siop';
|
|
4
|
+
export { preAuthorizedCodeGrantIdentifier, authorizationCodeGrantIdentifier } from '@animo-id/oauth2';
|
|
6
5
|
export type OpenId4VciCredentialConfigurationSupportedWithFormats = CredentialConfigurationSupportedWithFormats;
|
|
7
6
|
export type OpenId4VciCredentialConfigurationSupported = CredentialConfigurationSupported;
|
|
8
7
|
export type OpenId4VciCredentialConfigurationsSupported = Record<string, OpenId4VciCredentialConfigurationSupported>;
|
|
@@ -17,10 +16,11 @@ export type OpenId4VciCredentialIssuerMetadataDisplay = CredentialIssuerMetadata
|
|
|
17
16
|
export type OpenId4VciCredentialRequest = CredentialRequest;
|
|
18
17
|
export type OpenId4VciCredentialRequestWithFormats = CredentialRequestWithFormats;
|
|
19
18
|
export type OpenId4VciCredentialOfferPayload = CredentialOfferObject;
|
|
20
|
-
export type OpenId4VcSiopVerifiedAuthorizationRequest =
|
|
21
|
-
export type OpenId4VcSiopAuthorizationRequestPayload =
|
|
22
|
-
export type OpenId4VcSiopAuthorizationResponsePayload =
|
|
19
|
+
export type OpenId4VcSiopVerifiedAuthorizationRequest = VerifiedAuthorizationRequest;
|
|
20
|
+
export type OpenId4VcSiopAuthorizationRequestPayload = AuthorizationRequestPayload;
|
|
21
|
+
export type OpenId4VcSiopAuthorizationResponsePayload = AuthorizationResponsePayload;
|
|
22
|
+
export type OpenId4VcSiopIdTokenPayload = IDTokenPayload;
|
|
23
|
+
export * from './OpenId4VcJwtIssuer';
|
|
23
24
|
export * from './CredentialHolderBinding';
|
|
24
|
-
export * from './OpenId4VciAuthorizationServerConfig';
|
|
25
25
|
export * from './OpenId4VciCredentialFormatProfile';
|
|
26
|
-
export * from './
|
|
26
|
+
export * from './OpenId4VciAuthorizationServerConfig';
|
|
@@ -14,12 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
var oauth2_1 = require("@
|
|
19
|
-
Object.defineProperty(exports, "authorizationCodeGrantIdentifier", { enumerable: true, get: function () { return oauth2_1.authorizationCodeGrantIdentifier; } });
|
|
17
|
+
exports.authorizationCodeGrantIdentifier = exports.preAuthorizedCodeGrantIdentifier = void 0;
|
|
18
|
+
var oauth2_1 = require("@animo-id/oauth2");
|
|
20
19
|
Object.defineProperty(exports, "preAuthorizedCodeGrantIdentifier", { enumerable: true, get: function () { return oauth2_1.preAuthorizedCodeGrantIdentifier; } });
|
|
20
|
+
Object.defineProperty(exports, "authorizationCodeGrantIdentifier", { enumerable: true, get: function () { return oauth2_1.authorizationCodeGrantIdentifier; } });
|
|
21
|
+
__exportStar(require("./OpenId4VcJwtIssuer"), exports);
|
|
21
22
|
__exportStar(require("./CredentialHolderBinding"), exports);
|
|
22
|
-
__exportStar(require("./OpenId4VciAuthorizationServerConfig"), exports);
|
|
23
23
|
__exportStar(require("./OpenId4VciCredentialFormatProfile"), exports);
|
|
24
|
-
__exportStar(require("./
|
|
24
|
+
__exportStar(require("./OpenId4VciAuthorizationServerConfig"), exports);
|
|
25
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAqBA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAqBA,2CAAqG;AAA5F,0HAAA,gCAAgC,OAAA;AAAE,0HAAA,gCAAgC,OAAA;AAgC3E,uDAAoC;AACpC,4DAAyC;AACzC,sEAAmD;AACnD,wEAAqD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { Oauth2ErrorCodes, Oauth2ServerErrorResponseError } from '@animo-id/oauth2';
|
|
1
2
|
import type { AgentContext, Logger } from '@credo-ts/core';
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
4
|
-
import { Oauth2ResourceUnauthorizedError } from '@openid4vc/oauth2';
|
|
3
|
+
import type { NextFunction, Request, Response } from 'express';
|
|
4
|
+
import { Oauth2ResourceUnauthorizedError } from '@animo-id/oauth2';
|
|
5
5
|
export interface OpenId4VcRequest<RC extends Record<string, unknown> = Record<string, never>> extends Request {
|
|
6
6
|
requestContext?: RC & OpenId4VcRequestContext;
|
|
7
7
|
}
|
|
@@ -7,8 +7,8 @@ exports.sendNotFoundResponse = sendNotFoundResponse;
|
|
|
7
7
|
exports.sendErrorResponse = sendErrorResponse;
|
|
8
8
|
exports.sendJsonResponse = sendJsonResponse;
|
|
9
9
|
exports.getRequestContext = getRequestContext;
|
|
10
|
+
const oauth2_1 = require("@animo-id/oauth2");
|
|
10
11
|
const core_1 = require("@credo-ts/core");
|
|
11
|
-
const oauth2_1 = require("@openid4vc/oauth2");
|
|
12
12
|
function sendUnauthorizedError(response, next, logger, error, status) {
|
|
13
13
|
const errorMessage = error instanceof Error ? error.message : error;
|
|
14
14
|
logger.warn(`[OID4VC] Sending authorization error response: ${JSON.stringify(errorMessage)}`, {
|
|
@@ -34,7 +34,7 @@ function sendOauth2ErrorResponse(response, next, logger, error) {
|
|
|
34
34
|
next(error);
|
|
35
35
|
}
|
|
36
36
|
function sendUnknownServerErrorResponse(response, next, logger, error) {
|
|
37
|
-
logger.error(
|
|
37
|
+
logger.error('[OID4VC] Sending unknown server error response', {
|
|
38
38
|
error,
|
|
39
39
|
});
|
|
40
40
|
response.status(500).json({
|
|
@@ -58,7 +58,7 @@ function sendErrorResponse(response, next, logger, status, message, error, addit
|
|
|
58
58
|
next(throwError);
|
|
59
59
|
}
|
|
60
60
|
function sendJsonResponse(response, next,
|
|
61
|
-
//
|
|
61
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
62
62
|
body, contentType, status) {
|
|
63
63
|
response
|
|
64
64
|
.setHeader('Content-Type', contentType ?? 'application/json')
|
|
@@ -66,7 +66,7 @@ body, contentType, status) {
|
|
|
66
66
|
.send(JSON.stringify(body));
|
|
67
67
|
next();
|
|
68
68
|
}
|
|
69
|
-
//
|
|
69
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
70
70
|
function getRequestContext(request) {
|
|
71
71
|
const requestContext = request.requestContext;
|
|
72
72
|
if (!requestContext)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/shared/router/context.ts"],"names":[],"mappings":";;AAeA,sDAyBC;AAED,0DAYC;AACD,wEAYC;AAED,oDAKC;AAED,8CAmBC;AAED,4CAcC;AAGD,8CAKC;AAnHD,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/shared/router/context.ts"],"names":[],"mappings":";;AAeA,sDAyBC;AAED,0DAYC;AACD,wEAYC;AAED,oDAKC;AAED,8CAmBC;AAED,4CAcC;AAGD,8CAKC;AAnHD,6CAAiG;AACjG,yCAA2C;AAU3C,SAAgB,qBAAqB,CACnC,QAAkB,EAClB,IAAkB,EAClB,MAAc,EACd,KAAgD,EAChD,MAAe;IAEf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAA;IACnE,MAAM,CAAC,IAAI,CAAC,kDAAkD,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,EAAE;QAC5F,KAAK;KACN,CAAC,CAAA;IAEF,MAAM,gBAAgB,GACpB,KAAK,YAAY,wCAA+B;QAC9C,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAI,wCAA+B,CAAC,uBAAuB,EAAE;YAC3D,EAAE,MAAM,EAAE,sCAA6B,CA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OAAO,cAAc,CAAA;AACvB,CAAC"}
|
|
@@ -4,11 +4,10 @@ exports.importExpress = importExpress;
|
|
|
4
4
|
function importExpress() {
|
|
5
5
|
try {
|
|
6
6
|
// NOTE: 'express' is added as a peer-dependency, and is required when using this module
|
|
7
|
-
// eslint-disable-next-line import/no-extraneous-dependencies, @typescript-eslint/no-var-requires
|
|
8
7
|
const express = require('express');
|
|
9
8
|
return express;
|
|
10
9
|
}
|
|
11
|
-
catch (
|
|
10
|
+
catch (_error) {
|
|
12
11
|
throw new Error('Express must be installed as a peer dependency');
|
|
13
12
|
}
|
|
14
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.js","sourceRoot":"","sources":["../../../src/shared/router/express.ts"],"names":[],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"file":"express.js","sourceRoot":"","sources":["../../../src/shared/router/express.ts"],"names":[],"mappings":";;AAEA,sCAQC;AARD,SAAgB,aAAa;IAC3B,IAAI,CAAC;QACH,wFAAwF;QACxF,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAmB,CAAA;QACpD,OAAO,OAAO,CAAA;IAChB,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;IACnE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VerifiableCredential, VerifiablePresentation } from '@credo-ts/core';
|
|
2
|
+
import type { CompactSdJwtVc as SphereonCompactSdJwtVc, W3CVerifiableCredential as SphereonW3cVerifiableCredential, W3CVerifiablePresentation as SphereonW3cVerifiablePresentation, WrappedVerifiablePresentation } from '@sphereon/ssi-types';
|
|
3
|
+
export declare function getSphereonVerifiableCredential(verifiableCredential: VerifiableCredential): SphereonW3cVerifiableCredential | SphereonCompactSdJwtVc | string;
|
|
4
|
+
export declare function getSphereonVerifiablePresentation(verifiablePresentation: VerifiablePresentation): SphereonW3cVerifiablePresentation | SphereonCompactSdJwtVc | string;
|
|
5
|
+
export declare function getVerifiablePresentationFromSphereonWrapped(wrappedVerifiablePresentation: WrappedVerifiablePresentation): VerifiablePresentation;
|