@pagopa/io-react-native-wallet 0.10.0 → 0.11.0
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/lib/commonjs/credential/issuance/06-obtain-credential.js +19 -5
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +7 -1
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/const.js +1 -1
- package/lib/commonjs/credential/issuance/const.js.map +1 -1
- package/lib/commonjs/trust/types.js +2 -2
- package/lib/commonjs/trust/types.js.map +1 -1
- package/lib/commonjs/utils/par.js +2 -2
- package/lib/commonjs/utils/par.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js +19 -5
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js +7 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/module/credential/issuance/const.js +1 -1
- package/lib/module/credential/issuance/const.js.map +1 -1
- package/lib/module/trust/types.js +2 -2
- package/lib/module/trust/types.js.map +1 -1
- package/lib/module/utils/par.js +2 -2
- package/lib/module/utils/par.js.map +1 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +3 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/const.d.ts +1 -1
- package/lib/typescript/credential/issuance/const.d.ts.map +1 -1
- package/lib/typescript/trust/index.d.ts +2 -2
- package/lib/typescript/trust/types.d.ts +22 -22
- package/lib/typescript/utils/par.d.ts +7 -7
- package/package.json +2 -2
- package/src/credential/issuance/06-obtain-credential.ts +34 -4
- package/src/credential/issuance/07-verify-and-parse-credential.ts +21 -2
- package/src/credential/issuance/const.ts +4 -1
- package/src/trust/types.ts +2 -2
- package/src/utils/par.ts +2 -2
@@ -27,8 +27,16 @@ const createNonceProof = async (nonce, issuer, audience, ctx) => {
|
|
27
27
|
exports.createNonceProof = createNonceProof;
|
28
28
|
const CredentialEndpointResponse = z.object({
|
29
29
|
credential: z.string(),
|
30
|
-
format: _const.SupportedCredentialFormat
|
30
|
+
format: _const.SupportedCredentialFormat,
|
31
|
+
// nonce used to perform multiple credential requests
|
32
|
+
// re-using the same authorization profile
|
33
|
+
c_nonce: z.string(),
|
34
|
+
c_nonce_expires_in: z.number()
|
31
35
|
});
|
36
|
+
// Checks whether in the Entity confoguration at least one credential
|
37
|
+
// is defined for the given type and format
|
38
|
+
const isCredentialAvailable = (issuerConf, credentialType, credentialFormat) => issuerConf.openid_credential_issuer.credentials_supported.some(c => c.format === credentialFormat && c.credential_definition.type.includes(credentialType));
|
39
|
+
|
32
40
|
/**
|
33
41
|
* Fetch a credential from the issuer
|
34
42
|
*
|
@@ -37,17 +45,21 @@ const CredentialEndpointResponse = z.object({
|
|
37
45
|
* @param nonce The nonce value to prevent reply attacks, obtained with the access authorization step
|
38
46
|
* @param clientId Identifies the current client across all the requests of the issuing flow
|
39
47
|
* @param credentialType The type of the credential to be requested
|
48
|
+
* @param credentialFormat The format of the requested credential. @see {SupportedCredentialFormat}
|
40
49
|
* @param context.credentialCryptoContext The context to access the key the Credential will be bound to
|
41
50
|
* @param context.walletProviderBaseUrl The base url of the Wallet Provider
|
42
51
|
* @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
|
43
52
|
* @returns The signed credential token
|
44
53
|
*/
|
45
|
-
const obtainCredential = async (issuerConf, accessToken, nonce, clientId, credentialType, context) => {
|
54
|
+
const obtainCredential = async (issuerConf, accessToken, nonce, clientId, credentialType, credentialFormat, context) => {
|
46
55
|
const {
|
47
56
|
credentialCryptoContext,
|
48
57
|
walletProviderBaseUrl,
|
49
58
|
appFetch = fetch
|
50
59
|
} = context;
|
60
|
+
if (!isCredentialAvailable(issuerConf, credentialType, credentialFormat)) {
|
61
|
+
throw new Error(`The Issuer provides no credential for type ${credentialType} and format ${credentialFormat}`);
|
62
|
+
}
|
51
63
|
const credentialUrl = issuerConf.openid_credential_issuer.credential_endpoint;
|
52
64
|
|
53
65
|
/** DPoP token for demonstating the possession
|
@@ -69,7 +81,7 @@ const obtainCredential = async (issuerConf, accessToken, nonce, clientId, creden
|
|
69
81
|
credential_definition: JSON.stringify({
|
70
82
|
type: [credentialType]
|
71
83
|
}),
|
72
|
-
format:
|
84
|
+
format: credentialFormat,
|
73
85
|
proof: JSON.stringify({
|
74
86
|
jwt: signedNonceProof,
|
75
87
|
proof_type: "jwt"
|
@@ -77,7 +89,8 @@ const obtainCredential = async (issuerConf, accessToken, nonce, clientId, creden
|
|
77
89
|
});
|
78
90
|
const {
|
79
91
|
credential,
|
80
|
-
format
|
92
|
+
format,
|
93
|
+
c_nonce
|
81
94
|
} = await appFetch(credentialUrl, {
|
82
95
|
method: "POST",
|
83
96
|
headers: {
|
@@ -89,7 +102,8 @@ const obtainCredential = async (issuerConf, accessToken, nonce, clientId, creden
|
|
89
102
|
}).then((0, _misc.hasStatus)(200)).then(res => res.json()).then(CredentialEndpointResponse.parse);
|
90
103
|
return {
|
91
104
|
credential,
|
92
|
-
format
|
105
|
+
format,
|
106
|
+
nonce: c_nonce
|
93
107
|
};
|
94
108
|
};
|
95
109
|
exports.obtainCredential = obtainCredential;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["z","_interopRequireWildcard","require","_reactNativeUuid","_interopRequireDefault","_ioReactNativeJwt","_dpop","_misc","_const","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","createNonceProof","nonce","issuer","audience","ctx","SignJWT","setPayload","jwk","getPublicKey","setProtectedHeader","type","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","exports","CredentialEndpointResponse","object","credential","string","format","SupportedCredentialFormat","
|
1
|
+
{"version":3,"names":["z","_interopRequireWildcard","require","_reactNativeUuid","_interopRequireDefault","_ioReactNativeJwt","_dpop","_misc","_const","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","createNonceProof","nonce","issuer","audience","ctx","SignJWT","setPayload","jwk","getPublicKey","setProtectedHeader","type","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","exports","CredentialEndpointResponse","object","credential","string","format","SupportedCredentialFormat","c_nonce","c_nonce_expires_in","number","isCredentialAvailable","issuerConf","credentialType","credentialFormat","openid_credential_issuer","credentials_supported","some","c","credential_definition","includes","obtainCredential","accessToken","clientId","context","credentialCryptoContext","walletProviderBaseUrl","appFetch","fetch","Error","credentialUrl","credential_endpoint","signedDPopForPid","createDPopToken","htm","htu","jti","uuid","v4","signedNonceProof","formBody","URLSearchParams","JSON","stringify","proof","jwt","proof_type","method","headers","DPoP","Authorization","body","toString","then","hasStatus","res","json","parse"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAGA,IAAAK,KAAA,GAAAL,OAAA;AAGA,IAAAM,MAAA,GAAAN,OAAA;AAAoD,SAAAE,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wB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AAU;IAAEE,MAAM;IAAEpB,KAAK,EAAEsB;EAAQ,CAAC;AAC/C,CAAC;AAACP,OAAA,CAAAoB,gBAAA,GAAAA,gBAAA"}
|
@@ -20,7 +20,7 @@ const parseCredentialSdJwt = function (credentials_supported, _ref) {
|
|
20
20
|
let ignoreMissingAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
21
21
|
// find the definition that matches the received credential's type
|
22
22
|
// warning: if more then a defintion is found, the first is retrieved
|
23
|
-
const credentialSubject = (_credentials_supporte = credentials_supported.find(c => c.credential_definition.type.includes(sdJwt.payload.type))) === null || _credentials_supporte === void 0 ? void 0 : _credentials_supporte.credential_definition.credentialSubject;
|
23
|
+
const credentialSubject = (_credentials_supporte = credentials_supported.find(c => c.format === "vc+sd-jwt" && c.credential_definition.type.includes(sdJwt.payload.type))) === null || _credentials_supporte === void 0 ? void 0 : _credentials_supporte.credential_definition.credentialSubject;
|
24
24
|
|
25
25
|
// the received credential matches no supported credential, throw an exception
|
26
26
|
if (!credentialSubject) {
|
@@ -144,6 +144,10 @@ const verifyAndParseCredentialSdJwt = async (issuerConf, credential, _, _ref8) =
|
|
144
144
|
parsedCredential
|
145
145
|
};
|
146
146
|
};
|
147
|
+
const verifyAndParseCredentialMdoc = async (_issuerConf, _credential, _, _ctx) => {
|
148
|
+
// TODO: [SIW-686] decode MDOC credentials
|
149
|
+
throw new Error("verifyAndParseCredentialMdoc not implemented yet");
|
150
|
+
};
|
147
151
|
|
148
152
|
/**
|
149
153
|
* Verify and parse an encoded credential
|
@@ -161,6 +165,8 @@ const verifyAndParseCredentialSdJwt = async (issuerConf, credential, _, _ref8) =
|
|
161
165
|
const verifyAndParseCredential = async (issuerConf, credential, format, context) => {
|
162
166
|
if (format === "vc+sd-jwt") {
|
163
167
|
return verifyAndParseCredentialSdJwt(issuerConf, credential, format, context);
|
168
|
+
} else if (format === "vc+mdoc-cbor") {
|
169
|
+
return verifyAndParseCredentialMdoc(issuerConf, credential, format, context);
|
164
170
|
}
|
165
171
|
const _ = format;
|
166
172
|
throw new _errors.IoWalletError(`Unsupported credential format: ${_}`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_errors","require","_types","_sdJwt","parseCredentialSdJwt","credentials_supported","_ref","_credentials_supporte","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","credentialSubject","find","c","credential_definition","type","includes","payload","expected","flatMap","_","join","IoWalletError","attrDefinitions","Object","entries","attrsNotInDisclosures","filter","_ref2","attrKey","mandatory","some","_ref3","name","missing","map","received","definedValues","_ref4","_disclosures$find","definition","value","_ref5","display","reduce","names","_ref6","locale","undefinedValues","keys","_ref7","key","fromEntries","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","verifySdJwt","SdJwt4VC","getPublicKey","cnf","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","_ref8","credentialCryptoContext","decoded","openid_credential_issuer","jwks","parsedCredential","
|
1
|
+
{"version":3,"names":["_errors","require","_types","_sdJwt","parseCredentialSdJwt","credentials_supported","_ref","_credentials_supporte","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","credentialSubject","find","c","format","credential_definition","type","includes","payload","expected","flatMap","_","join","IoWalletError","attrDefinitions","Object","entries","attrsNotInDisclosures","filter","_ref2","attrKey","mandatory","some","_ref3","name","missing","map","received","definedValues","_ref4","_disclosures$find","definition","value","_ref5","display","reduce","names","_ref6","locale","undefinedValues","keys","_ref7","key","fromEntries","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","verifySdJwt","SdJwt4VC","getPublicKey","cnf","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","_ref8","credentialCryptoContext","decoded","openid_credential_issuer","jwks","parsedCredential","verifyAndParseCredentialMdoc","_issuerConf","_credential","_ctx","Error","verifyAndParseCredential","context","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/07-verify-and-parse-credential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AAQ,GAAGP,MAAM;EACvB,MAAM,IAAIS,qBAAa,CAAE,kCAAiCF,CAAE,EAAC,CAAC;AAChE,CAAC;AAAC+D,OAAA,CAAAF,wBAAA,GAAAA,wBAAA"}
|
@@ -9,6 +9,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
9
9
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
10
10
|
const ASSERTION_TYPE = "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation";
|
11
11
|
exports.ASSERTION_TYPE = ASSERTION_TYPE;
|
12
|
-
const SupportedCredentialFormat = z.literal("vc+sd-jwt");
|
12
|
+
const SupportedCredentialFormat = z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]);
|
13
13
|
exports.SupportedCredentialFormat = SupportedCredentialFormat;
|
14
14
|
//# sourceMappingURL=const.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["z","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ASSERTION_TYPE","exports","SupportedCredentialFormat","literal"],"sourceRoot":"../../../../src","sources":["credential/issuance/const.ts"],"mapp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ME,yBAAyB,GAAG3B,CAAC,CAAC4B,OAAO,CAAC,WAAW,CAAC;
|
1
|
+
{"version":3,"names":["z","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ASSERTION_TYPE","exports","SupportedCredentialFormat","union","literal"],"sourceRoot":"../../../../src","sources":["credential/issuance/const.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAyB,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAClB,MAAMW,cAAc,GACzB,oEAAoE;AAACC,OAAA,CAAAD,cAAA,GAAAA,cAAA;AAKhE,MAAME,yBAAyB,GAAG3B,CAAC,CAAC4B,KAAK,CAAC,CAC/C5B,CAAC,CAAC6B,OAAO,CAAC,WAAW,CAAC,EACtB7B,CAAC,CAAC6B,OAAO,CAAC,cAAc,CAAC,CAC1B,CAAC;AAACH,OAAA,CAAAC,yBAAA,GAAAA,yBAAA"}
|
@@ -52,7 +52,7 @@ const CredentialDefinitionMetadata = z.object({
|
|
52
52
|
|
53
53
|
const SupportedCredentialMetadata = z.object({
|
54
54
|
id: z.string(),
|
55
|
-
format: z.literal("vc+sd-jwt"),
|
55
|
+
format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
|
56
56
|
cryptographic_binding_methods_supported: z.array(z.string()),
|
57
57
|
cryptographic_suites_supported: z.array(z.string()),
|
58
58
|
display: z.array(CredentialDisplayMetadata),
|
@@ -141,7 +141,7 @@ const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(z.object
|
|
141
141
|
keys: z.array(_jwk.JWK)
|
142
142
|
})
|
143
143
|
}),
|
144
|
-
/** Credential Issuers act as Relying Party
|
144
|
+
/** Credential Issuers act as Relying Party
|
145
145
|
when they require the presentation of other credentials.
|
146
146
|
This does not apply for PID issuance, which requires CIE authz. */
|
147
147
|
wallet_relying_party: RelyingPartyMetadata.optional()
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TrustMark","object","id","string","trust_mark","exports","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","JWK","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialDefinitionMetadata","type","credentialSubject","record","mandatory","boolean","display","SupportedCredentialMetadata","format","literal","cryptographic_binding_methods_supported","cryptographic_suites_supported","credential_definition","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","UnixTime","metadata","federation_entity","authority_hints","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","wallet_relying_party","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","attested_security_context_values_supported","grant_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","EntityConfiguration","
|
1
|
+
{"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TrustMark","object","id","string","trust_mark","exports","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","JWK","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialDefinitionMetadata","type","credentialSubject","record","mandatory","boolean","display","SupportedCredentialMetadata","format","union","literal","cryptographic_binding_methods_supported","cryptographic_suites_supported","credential_definition","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","UnixTime","metadata","federation_entity","authority_hints","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","wallet_relying_party","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","attested_security_context_values_supported","grant_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","EntityConfiguration","description"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAyB,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAF,wBAAAM,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC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,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAAC,CACjBK,QAAQ,CAAC,CAAC;QACb2E,qBAAqB,EAAE3G,CAAC,CAACqC,KAAK,CAACrC,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAAC;QAC1CiF,qCAAqC,EAAE5G,CAAC,CAACqC,KAAK,CAACrC,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAAC;QAC1DkF,gDAAgD,EAAE7G,CAAC,CAACqC,KAAK,CACvDrC,CAAC,CAAC2B,MAAM,CAAC,CACX,CAAC;QACDQ,IAAI,EAAEnC,CAAC,CAACyB,MAAM,CAAC;UAAEW,IAAI,EAAEpC,CAAC,CAACqC,KAAK,CAACC,QAAG;QAAE,CAAC;MACvC,CAAC,CAAC,CACD+C,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;AAAAxD,OAAA,CAAA2E,iCAAA,GAAAA,iCAAA;AAEO,MAAMM,mBAAmB,GAAG9G,CAAC,CAACyD,KAAK,CACxC,CACE+C,iCAAiC,EACjCZ,mCAAmC,EACnCD,8BAA8B,EAC9BY,+BAA+B,CAChC,EACD;EACEQ,WAAW,EAAE;AACf,CACF,CAAC;AAAClF,OAAA,CAAAiF,mBAAA,GAAAA,mBAAA"}
|
@@ -16,7 +16,7 @@ const AuthorizationDetail = z.object({
|
|
16
16
|
credential_definition: z.object({
|
17
17
|
type: z.string()
|
18
18
|
}),
|
19
|
-
format: z.literal("vc+sd-jwt"),
|
19
|
+
format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
|
20
20
|
type: z.literal("openid_credential")
|
21
21
|
});
|
22
22
|
exports.AuthorizationDetail = AuthorizationDetail;
|
@@ -37,7 +37,7 @@ const makeParRequest = _ref => {
|
|
37
37
|
const aud = `${parUrl.protocol}//${parUrl.hostname}`;
|
38
38
|
const iss = WalletInstanceAttestation.decode(walletInstanceAttestation).payload.cnf.jwk.kid;
|
39
39
|
|
40
|
-
/** A code challenge is provided so that the PAR is bound
|
40
|
+
/** A code challenge is provided so that the PAR is bound
|
41
41
|
to the subsequent authorization code request
|
42
42
|
@see https://datatracker.ietf.org/doc/html/rfc9126#name-request */
|
43
43
|
const codeChallengeMethod = "s256";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","_reactNativeUuid","_interopRequireDefault","z","_interopRequireWildcard","WalletInstanceAttestation","_misc","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AuthorizationDetail","object","credential_definition","type","string","format","literal","exports","AuthorizationDetails","array","makeParRequest","_ref","wiaCryptoContext","appFetch","fetch","clientId","codeVerifier","walletProviderBaseUrl","parEndpoint","walletInstanceAttestation","authorizationDetails","assertionType","wiaPublicKey","getPublicKey","parUrl","URL","aud","protocol","hostname","iss","decode","payload","cnf","jwk","kid","codeChallengeMethod","codeChallenge","sha256ToBase64","signedJwtForPar","SignJWT","setProtectedHeader","setPayload","jti","uuid","v4","client_assertion_type","authorization_details","response_type","redirect_uri","state","client_id","code_challenge_method","code_challenge","setIssuedAt","setExpirationTime","sign","formBody","URLSearchParams","client_assertion","request","method","headers","body","toString","then","hasStatus","res","json","result","request_uri"],"sourceRoot":"../../../src","sources":["utils/par.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAKA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,CAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAAmC,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAA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CAAC;EACjB,CAAC,CAAC;EACFC,MAAM,EAAE/B,CAAC,CAACgC,OAAO,CAAC,WAAW,CAAC;
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_reactNativeUuid","_interopRequireDefault","z","_interopRequireWildcard","WalletInstanceAttestation","_misc","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AuthorizationDetail","object","credential_definition","type","string","format","union","literal","exports","AuthorizationDetails","array","makeParRequest","_ref","wiaCryptoContext","appFetch","fetch","clientId","codeVerifier","walletProviderBaseUrl","parEndpoint","walletInstanceAttestation","authorizationDetails","assertionType","wiaPublicKey","getPublicKey","parUrl","URL","aud","protocol","hostname","iss","decode","payload","cnf","jwk","kid","codeChallengeMethod","codeChallenge","sha256ToBase64","signedJwtForPar","SignJWT","setProtectedHeader","setPayload","jti","uuid","v4","client_assertion_type","authorization_details","response_type","redirect_uri","state","client_id","code_challenge_method","code_challenge","setIssuedAt","setExpirationTime","sign","formBody","URLSearchParams","client_assertion","request","method","headers","body","toString","then","hasStatus","res","json","result","request_uri"],"sourceRoot":"../../../src","sources":["utils/par.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAKA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,CAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAAmC,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,G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C,wBAAI,CAACC,EAAE,CAAC,CAAE,EAAC;MACnBC,qBAAqB,EAAExB,aAAa;MACpCyB,qBAAqB,EAAE1B,oBAAoB;MAC3C2B,aAAa,EAAE,MAAM;MACrBC,YAAY,EAAE/B,qBAAqB;MACnCgC,KAAK,EAAG,GAAEN,wBAAI,CAACC,EAAE,CAAC,CAAE,EAAC;MACrBM,SAAS,EAAEnC,QAAQ;MACnBoC,qBAAqB,EAAEhB,mBAAmB;MAC1CiB,cAAc,EAAEhB;IAClB,CAAC,CAAC,CACDiB,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,IAAI,CAAC,CACvBC,IAAI,CAAC,CAAC;;IAET;IACA,IAAIC,QAAQ,GAAG,IAAIC,eAAe,CAAC;MACjCV,aAAa,EAAE,MAAM;MACrBG,SAAS,EAAEnC,QAAQ;MACnBqC,cAAc,EAAEhB,aAAa;MAC7Be,qBAAqB,EAAE,MAAM;MAC7BN,qBAAqB,EAAExB,aAAa;MACpCqC,gBAAgB,EAAEvC,yBAAyB;MAC3CwC,OAAO,EAAErB;IACX,CAAC,CAAC;IAEF,OAAO,MAAMzB,QAAQ,CAACK,WAAW,EAAE;MACjC0C,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACDC,IAAI,EAAEN,QAAQ,CAACO,QAAQ,CAAC;IAC1B,CAAC,CAAC,CACCC,IAAI,CAAC,IAAAC,eAAS,EAAC,GAAG,CAAC,CAAC,CACpBD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAAEI,MAAM,IAAKA,MAAM,CAACC,WAAW,CAAC;EACzC,CAAC;AAAA;AAAC9D,OAAA,CAAAG,cAAA,GAAAA,cAAA"}
|
@@ -18,8 +18,16 @@ export const createNonceProof = async (nonce, issuer, audience, ctx) => {
|
|
18
18
|
};
|
19
19
|
const CredentialEndpointResponse = z.object({
|
20
20
|
credential: z.string(),
|
21
|
-
format: SupportedCredentialFormat
|
21
|
+
format: SupportedCredentialFormat,
|
22
|
+
// nonce used to perform multiple credential requests
|
23
|
+
// re-using the same authorization profile
|
24
|
+
c_nonce: z.string(),
|
25
|
+
c_nonce_expires_in: z.number()
|
22
26
|
});
|
27
|
+
// Checks whether in the Entity confoguration at least one credential
|
28
|
+
// is defined for the given type and format
|
29
|
+
const isCredentialAvailable = (issuerConf, credentialType, credentialFormat) => issuerConf.openid_credential_issuer.credentials_supported.some(c => c.format === credentialFormat && c.credential_definition.type.includes(credentialType));
|
30
|
+
|
23
31
|
/**
|
24
32
|
* Fetch a credential from the issuer
|
25
33
|
*
|
@@ -28,17 +36,21 @@ const CredentialEndpointResponse = z.object({
|
|
28
36
|
* @param nonce The nonce value to prevent reply attacks, obtained with the access authorization step
|
29
37
|
* @param clientId Identifies the current client across all the requests of the issuing flow
|
30
38
|
* @param credentialType The type of the credential to be requested
|
39
|
+
* @param credentialFormat The format of the requested credential. @see {SupportedCredentialFormat}
|
31
40
|
* @param context.credentialCryptoContext The context to access the key the Credential will be bound to
|
32
41
|
* @param context.walletProviderBaseUrl The base url of the Wallet Provider
|
33
42
|
* @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
|
34
43
|
* @returns The signed credential token
|
35
44
|
*/
|
36
|
-
export const obtainCredential = async (issuerConf, accessToken, nonce, clientId, credentialType, context) => {
|
45
|
+
export const obtainCredential = async (issuerConf, accessToken, nonce, clientId, credentialType, credentialFormat, context) => {
|
37
46
|
const {
|
38
47
|
credentialCryptoContext,
|
39
48
|
walletProviderBaseUrl,
|
40
49
|
appFetch = fetch
|
41
50
|
} = context;
|
51
|
+
if (!isCredentialAvailable(issuerConf, credentialType, credentialFormat)) {
|
52
|
+
throw new Error(`The Issuer provides no credential for type ${credentialType} and format ${credentialFormat}`);
|
53
|
+
}
|
42
54
|
const credentialUrl = issuerConf.openid_credential_issuer.credential_endpoint;
|
43
55
|
|
44
56
|
/** DPoP token for demonstating the possession
|
@@ -60,7 +72,7 @@ export const obtainCredential = async (issuerConf, accessToken, nonce, clientId,
|
|
60
72
|
credential_definition: JSON.stringify({
|
61
73
|
type: [credentialType]
|
62
74
|
}),
|
63
|
-
format:
|
75
|
+
format: credentialFormat,
|
64
76
|
proof: JSON.stringify({
|
65
77
|
jwt: signedNonceProof,
|
66
78
|
proof_type: "jwt"
|
@@ -68,7 +80,8 @@ export const obtainCredential = async (issuerConf, accessToken, nonce, clientId,
|
|
68
80
|
});
|
69
81
|
const {
|
70
82
|
credential,
|
71
|
-
format
|
83
|
+
format,
|
84
|
+
c_nonce
|
72
85
|
} = await appFetch(credentialUrl, {
|
73
86
|
method: "POST",
|
74
87
|
headers: {
|
@@ -80,7 +93,8 @@ export const obtainCredential = async (issuerConf, accessToken, nonce, clientId,
|
|
80
93
|
}).then(hasStatus(200)).then(res => res.json()).then(CredentialEndpointResponse.parse);
|
81
94
|
return {
|
82
95
|
credential,
|
83
|
-
format
|
96
|
+
format,
|
97
|
+
nonce: c_nonce
|
84
98
|
};
|
85
99
|
};
|
86
100
|
//# sourceMappingURL=06-obtain-credential.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["z","uuid","SignJWT","createDPopToken","hasStatus","SupportedCredentialFormat","createNonceProof","nonce","issuer","audience","ctx","setPayload","jwk","getPublicKey","setProtectedHeader","type","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","CredentialEndpointResponse","object","credential","string","format","
|
1
|
+
{"version":3,"names":["z","uuid","SignJWT","createDPopToken","hasStatus","SupportedCredentialFormat","createNonceProof","nonce","issuer","audience","ctx","setPayload","jwk","getPublicKey","setProtectedHeader","type","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","CredentialEndpointResponse","object","credential","string","format","c_nonce","c_nonce_expires_in","number","isCredentialAvailable","issuerConf","credentialType","credentialFormat","openid_credential_issuer","credentials_supported","some","c","credential_definition","includes","obtainCredential","accessToken","clientId","context","credentialCryptoContext","walletProviderBaseUrl","appFetch","fetch","Error","credentialUrl","credential_endpoint","signedDPopForPid","htm","htu","jti","v4","signedNonceProof","formBody","URLSearchParams","JSON","stringify","proof","jwt","proof_type","method","headers","DPoP","Authorization","body","toString","then","res","json","parse"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":"AAAA,OAAO,KAAKA,CAAC,MAAM,KAAK;AACxB,OAAOC,IAAI,MAAM,mBAAmB;AACpC,SAASC,OAAO,QAA4B,6BAA6B;AACzE,SAASC,eAAe,QAAQ,kBAAkB;AAGlD,SAASC,SAAS,QAAkB,kBAAkB;AAGtD,SAASC,yBAAyB,QAAQ,SAAS;;AAEnD;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAG,MAAAA,CAC9BC,KAAa,EACbC,MAAc,EACdC,QAAgB,EAChBC,GAAkB,KACE;EACpB,OAAO,IAAIR,OAAO,CAACQ,GAAG,CAAC,CACpBC,UAAU,CAAC;IACVJ,KAAK;IACLK,GAAG,EAAE,MAAMF,GAAG,CAACG,YAAY,CAAC;EAC9B,CAAC,CAAC,CACDC,kBAAkB,CAAC;IAClBC,IAAI,EAAE;EACR,CAAC,CAAC,CACDC,WAAW,CAACP,QAAQ,CAAC,CACrBQ,SAAS,CAACT,MAAM,CAAC,CACjBU,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,IAAI,CAAC,CACvBC,IAAI,CAAC,CAAC;AACX,CAAC;AAED,MAAMC,0BAA0B,GAAGrB,CAAC,CAACsB,MAAM,CAAC;EAC1CC,UAAU,EAAEvB,CAAC,CAACwB,MAAM,CAAC,CAAC;EACtBC,MAAM,EAAEpB,yBAAyB;EACjC;EACA;EACAqB,OAAO,EAAE1B,CAAC,CAACwB,MAAM,CAAC,CAAC;EACnBG,kBAAkB,EAAE3B,CAAC,CAAC4B,MAAM,CAAC;AAC/B,CAAC,CAAC;AAoBF;AACA;AACA,MAAMC,qBAAqB,GAAGA,CAC5BC,UAAkD,EAClDC,cAAgD,EAChDC,gBAA2C,KAE3CF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EF,IAAI,CAACC,SAAS,CAAC;MACpBE,GAAG,EAAEN,gBAAgB;MACrBO,UAAU,EAAE;IACd,CAAC;EACH,CAAC,CAAC;EAEF,MAAM;IAAEvC,UAAU;IAAEE,MAAM;IAAEC;EAAQ,CAAC,GAAG,MAAMmB,QAAQ,CAACG,aAAa,EAAE;IACpEe,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MACP,cAAc,EAAE,mCAAmC;MACnDC,IAAI,EAAEf,gBAAgB;MACtBgB,aAAa,EAAE1B;IACjB,CAAC;IACD2B,IAAI,EAAEX,QAAQ,CAACY,QAAQ,CAAC;EAC1B,CAAC,CAAC,CACCC,IAAI,CAACjE,SAAS,CAAC,GAAG,CAAC,CAAC,CACpBiE,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBF,IAAI,CAAChD,0BAA0B,CAACmD,KAAK,CAAC;EAEzC,OAAO;IAAEjD,UAAU;IAAEE,MAAM;IAAElB,KAAK,EAAEmB;EAAQ,CAAC;AAC/C,CAAC"}
|
@@ -15,7 +15,7 @@ const parseCredentialSdJwt = function (credentials_supported, _ref) {
|
|
15
15
|
let ignoreMissingAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
16
16
|
// find the definition that matches the received credential's type
|
17
17
|
// warning: if more then a defintion is found, the first is retrieved
|
18
|
-
const credentialSubject = (_credentials_supporte = credentials_supported.find(c => c.credential_definition.type.includes(sdJwt.payload.type))) === null || _credentials_supporte === void 0 ? void 0 : _credentials_supporte.credential_definition.credentialSubject;
|
18
|
+
const credentialSubject = (_credentials_supporte = credentials_supported.find(c => c.format === "vc+sd-jwt" && c.credential_definition.type.includes(sdJwt.payload.type))) === null || _credentials_supporte === void 0 ? void 0 : _credentials_supporte.credential_definition.credentialSubject;
|
19
19
|
|
20
20
|
// the received credential matches no supported credential, throw an exception
|
21
21
|
if (!credentialSubject) {
|
@@ -139,6 +139,10 @@ const verifyAndParseCredentialSdJwt = async (issuerConf, credential, _, _ref8) =
|
|
139
139
|
parsedCredential
|
140
140
|
};
|
141
141
|
};
|
142
|
+
const verifyAndParseCredentialMdoc = async (_issuerConf, _credential, _, _ctx) => {
|
143
|
+
// TODO: [SIW-686] decode MDOC credentials
|
144
|
+
throw new Error("verifyAndParseCredentialMdoc not implemented yet");
|
145
|
+
};
|
142
146
|
|
143
147
|
/**
|
144
148
|
* Verify and parse an encoded credential
|
@@ -156,6 +160,8 @@ const verifyAndParseCredentialSdJwt = async (issuerConf, credential, _, _ref8) =
|
|
156
160
|
export const verifyAndParseCredential = async (issuerConf, credential, format, context) => {
|
157
161
|
if (format === "vc+sd-jwt") {
|
158
162
|
return verifyAndParseCredentialSdJwt(issuerConf, credential, format, context);
|
163
|
+
} else if (format === "vc+mdoc-cbor") {
|
164
|
+
return verifyAndParseCredentialMdoc(issuerConf, credential, format, context);
|
159
165
|
}
|
160
166
|
const _ = format;
|
161
167
|
throw new IoWalletError(`Unsupported credential format: ${_}`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["IoWalletError","SdJwt4VC","verify","verifySdJwt","parseCredentialSdJwt","credentials_supported","_ref","_credentials_supporte","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","credentialSubject","find","c","credential_definition","type","includes","payload","expected","flatMap","_","join","attrDefinitions","Object","entries","attrsNotInDisclosures","filter","_ref2","attrKey","mandatory","some","_ref3","name","missing","map","received","definedValues","_ref4","_disclosures$find","definition","value","_ref5","display","reduce","names","_ref6","locale","undefinedValues","keys","_ref7","key","fromEntries","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","getPublicKey","cnf","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","_ref8","credentialCryptoContext","decoded","openid_credential_issuer","jwks","parsedCredential","
|
1
|
+
{"version":3,"names":["IoWalletError","SdJwt4VC","verify","verifySdJwt","parseCredentialSdJwt","credentials_supported","_ref","_credentials_supporte","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","credentialSubject","find","c","format","credential_definition","type","includes","payload","expected","flatMap","_","join","attrDefinitions","Object","entries","attrsNotInDisclosures","filter","_ref2","attrKey","mandatory","some","_ref3","name","missing","map","received","definedValues","_ref4","_disclosures$find","definition","value","_ref5","display","reduce","names","_ref6","locale","undefinedValues","keys","_ref7","key","fromEntries","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","getPublicKey","cnf","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","_ref8","credentialCryptoContext","decoded","openid_credential_issuer","jwks","parsedCredential","verifyAndParseCredentialMdoc","_issuerConf","_credential","_ctx","Error","verifyAndParseCredential","context"],"sourceRoot":"../../../../src","sources":["credential/issuance/07-verify-and-parse-credential.ts"],"mappings":"AAGA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,MAAM,IAAIC,WAAW,QAAQ,cAAc;;AAcpD;;AAmBA;;AAKA,MAAMC,oBAAoB,GAAG,SAAAA,CAE3BC,qBAAkH,EAAAC,IAAA,EAG7F;EAAA,IAAAC,qBAAA;EAAA,IAFrB;IAAEC,KAAK;IAAEC;EAAoC,CAAC,GAAAH,IAAA;EAAA,IAC9CI,uBAAgC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAExC;EACA;EACA,MAAMG,iBAAiB,IAAAP,qBAAA,GAAGF,qBAAqB,CAACU,IAAI,CACjDC,CAAC,IACAA,CAAC,CAACC,MAAM,KAAK,WAAW,IACxBD,CAAC,CAACE,qBAAqB,CAACC,IAAI,CAACC,QAAQ,CAACZ,KAAK,CAACa,OAAO,CAACF,IAAI,CAC5D,CAAC,cAAAZ,qBAAA,uBAJyBA,qBAAA,CAIvBW,qBAAqB,CAACJ,iBAAiB;;EAE1C;EACA,IAAI,CAACA,iBAA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AW,EACXvD,CAAC,EACDwD,IAAI,KACD;EACH;EACA,MAAM,IAAIC,KAAK,CAAC,kDAAkD,CAAC;AACrE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAkD,GAAG,MAAAA,CAChEb,UAAU,EACVC,UAAU,EACVrD,MAAM,EACNkE,OAAO,KACJ;EACH,IAAIlE,MAAM,KAAK,WAAW,EAAE;IAC1B,OAAOmD,6BAA6B,CAClCC,UAAU,EACVC,UAAU,EACVrD,MAAM,EACNkE,OACF,CAAC;EACH,CAAC,MAAM,IAAIlE,MAAM,KAAK,cAAc,EAAE;IACpC,OAAO4D,4BAA4B,CACjCR,UAAU,EACVC,UAAU,EACVrD,MAAM,EACNkE,OACF,CAAC;EACH;EAEA,MAAM3D,CAAQ,GAAGP,MAAM;EACvB,MAAM,IAAIjB,aAAa,CAAE,kCAAiCwB,CAAE,EAAC,CAAC;AAChE,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import * as z from "zod";
|
2
2
|
export const ASSERTION_TYPE = "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation";
|
3
|
-
export const SupportedCredentialFormat = z.literal("vc+sd-jwt");
|
3
|
+
export const SupportedCredentialFormat = z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]);
|
4
4
|
//# sourceMappingURL=const.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["z","ASSERTION_TYPE","SupportedCredentialFormat","literal"],"sourceRoot":"../../../../src","sources":["credential/issuance/const.ts"],"mappings":"AAAA,OAAO,KAAKA,CAAC,MAAM,KAAK;AACxB,OAAO,MAAMC,cAAc,GACzB,oEAAoE;AAKtE,OAAO,MAAMC,yBAAyB,GAAGF,CAAC,CAACG,OAAO,CAAC,WAAW,CAAC"}
|
1
|
+
{"version":3,"names":["z","ASSERTION_TYPE","SupportedCredentialFormat","union","literal"],"sourceRoot":"../../../../src","sources":["credential/issuance/const.ts"],"mappings":"AAAA,OAAO,KAAKA,CAAC,MAAM,KAAK;AACxB,OAAO,MAAMC,cAAc,GACzB,oEAAoE;AAKtE,OAAO,MAAMC,yBAAyB,GAAGF,CAAC,CAACG,KAAK,CAAC,CAC/CH,CAAC,CAACI,OAAO,CAAC,WAAW,CAAC,EACtBJ,CAAC,CAACI,OAAO,CAAC,cAAc,CAAC,CAC1B,CAAC"}
|
@@ -43,7 +43,7 @@ const CredentialDefinitionMetadata = z.object({
|
|
43
43
|
|
44
44
|
const SupportedCredentialMetadata = z.object({
|
45
45
|
id: z.string(),
|
46
|
-
format: z.literal("vc+sd-jwt"),
|
46
|
+
format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
|
47
47
|
cryptographic_binding_methods_supported: z.array(z.string()),
|
48
48
|
cryptographic_suites_supported: z.array(z.string()),
|
49
49
|
display: z.array(CredentialDisplayMetadata),
|
@@ -130,7 +130,7 @@ export const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(z
|
|
130
130
|
keys: z.array(JWK)
|
131
131
|
})
|
132
132
|
}),
|
133
|
-
/** Credential Issuers act as Relying Party
|
133
|
+
/** Credential Issuers act as Relying Party
|
134
134
|
when they require the presentation of other credentials.
|
135
135
|
This does not apply for PID issuance, which requires CIE authz. */
|
136
136
|
wallet_relying_party: RelyingPartyMetadata.optional()
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["UnixTime","JWK","z","TrustMark","object","id","string","trust_mark","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialDefinitionMetadata","type","credentialSubject","record","mandatory","boolean","display","SupportedCredentialMetadata","format","literal","cryptographic_binding_methods_supported","cryptographic_suites_supported","credential_definition","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","metadata","federation_entity","authority_hints","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","wallet_relying_party","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","attested_security_context_values_supported","grant_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","EntityConfiguration","
|
1
|
+
{"version":3,"names":["UnixTime","JWK","z","TrustMark","object","id","string","trust_mark","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialDefinitionMetadata","type","credentialSubject","record","mandatory","boolean","display","SupportedCredentialMetadata","format","union","literal","cryptographic_binding_methods_supported","cryptographic_suites_supported","credential_definition","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","metadata","federation_entity","authority_hints","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","wallet_relying_party","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","attested_security_context_values_supported","grant_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","EntityConfiguration","description"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,iBAAiB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;AAED;;AAIA,OAAO,MAAMwE,iCAAiC,GAAGjB,uBAAuB,CAACM,GAAG,CAC1EnE,CAAC,CAACE,MAAM,CAAC;EACPwC,OAAO,EAAE1C,CAAC,CAACE,MAAM,CAAC;IAChB4D,QAAQ,EAAE9D,CAAC,CAACE,MAAM,CAAC;MACjB6E,eAAe,EAAE/E,CAAC,CACfE,MAAM,CAAC;QACNqE,cAAc,EAAEvE,CAAC,CAACI,MAAM,CAAC,CAAC;QAC1B4E,0CAA0C,EAAEhF,CAAC,CAC1Ca,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC,CACjBI,QAAQ,CAAC,CAAC;QACbyE,qBAAqB,EAAEjF,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC;QAC1C8E,qCAAqC,EAAElF,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC;QAC1D+E,gDAAgD,EAAEnF,CAAC,CAACa,KAAK,CACvDb,CAAC,CAACI,MAAM,CAAC,CACX,CAAC;QACDO,IAAI,EAAEX,CAAC,CAACE,MAAM,CAAC;UAAEU,IAAI,EAAEZ,CAAC,CAACa,KAAK,CAACd,GAAG;QAAE,CAAC;MACvC,CAAC,CAAC,CACD6D,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;;AAEA,OAAO,MAAMwB,mBAAmB,GAAGpF,CAAC,CAACgC,KAAK,CACxC,CACE8C,iCAAiC,EACjCZ,mCAAmC,EACnCD,8BAA8B,EAC9BY,+BAA+B,CAChC,EACD;EACEQ,WAAW,EAAE;AACf,CACF,CAAC"}
|
package/lib/module/utils/par.js
CHANGED
@@ -7,7 +7,7 @@ export const AuthorizationDetail = z.object({
|
|
7
7
|
credential_definition: z.object({
|
8
8
|
type: z.string()
|
9
9
|
}),
|
10
|
-
format: z.literal("vc+sd-jwt"),
|
10
|
+
format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
|
11
11
|
type: z.literal("openid_credential")
|
12
12
|
});
|
13
13
|
export const AuthorizationDetails = z.array(AuthorizationDetail);
|
@@ -26,7 +26,7 @@ export const makeParRequest = _ref => {
|
|
26
26
|
const aud = `${parUrl.protocol}//${parUrl.hostname}`;
|
27
27
|
const iss = WalletInstanceAttestation.decode(walletInstanceAttestation).payload.cnf.jwk.kid;
|
28
28
|
|
29
|
-
/** A code challenge is provided so that the PAR is bound
|
29
|
+
/** A code challenge is provided so that the PAR is bound
|
30
30
|
to the subsequent authorization code request
|
31
31
|
@see https://datatracker.ietf.org/doc/html/rfc9126#name-request */
|
32
32
|
const codeChallengeMethod = "s256";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["sha256ToBase64","SignJWT","uuid","z","WalletInstanceAttestation","hasStatus","AuthorizationDetail","object","credential_definition","type","string","format","literal","AuthorizationDetails","array","makeParRequest","_ref","wiaCryptoContext","appFetch","fetch","clientId","codeVerifier","walletProviderBaseUrl","parEndpoint","walletInstanceAttestation","authorizationDetails","assertionType","wiaPublicKey","getPublicKey","parUrl","URL","aud","protocol","hostname","iss","decode","payload","cnf","jwk","kid","codeChallengeMethod","codeChallenge","signedJwtForPar","setProtectedHeader","setPayload","jti","v4","client_assertion_type","authorization_details","response_type","redirect_uri","state","client_id","code_challenge_method","code_challenge","setIssuedAt","setExpirationTime","sign","formBody","URLSearchParams","client_assertion","request","method","headers","body","toString","then","res","json","result","request_uri"],"sourceRoot":"../../../src","sources":["utils/par.ts"],"mappings":"AAAA,SACEA,cAAc,EAEdC,OAAO,QACF,6BAA6B;AACpC,OAAOC,IAAI,MAAM,mBAAmB;AACpC,OAAO,KAAKC,CAAC,MAAM,KAAK;AACxB,OAAO,KAAKC,yBAAyB,MAAM,gCAAgC;AAC3E,SAASC,SAAS,QAAQ,QAAQ;AAGlC,OAAO,MAAMC,mBAAmB,GAAGH,CAAC,CAACI,MAAM,CAAC;EAC1CC,qBAAqB,EAAEL,CAAC,CAACI,MAAM,CAAC;IAC9BE,IAAI,EAAEN,CAAC,CAACO,MAAM,CAAC;EACjB,CAAC,CAAC;EACFC,MAAM,EAAER,CAAC,CAACS,OAAO,CAAC,WAAW,CAAC;
|
1
|
+
{"version":3,"names":["sha256ToBase64","SignJWT","uuid","z","WalletInstanceAttestation","hasStatus","AuthorizationDetail","object","credential_definition","type","string","format","union","literal","AuthorizationDetails","array","makeParRequest","_ref","wiaCryptoContext","appFetch","fetch","clientId","codeVerifier","walletProviderBaseUrl","parEndpoint","walletInstanceAttestation","authorizationDetails","assertionType","wiaPublicKey","getPublicKey","parUrl","URL","aud","protocol","hostname","iss","decode","payload","cnf","jwk","kid","codeChallengeMethod","codeChallenge","signedJwtForPar","setProtectedHeader","setPayload","jti","v4","client_assertion_type","authorization_details","response_type","redirect_uri","state","client_id","code_challenge_method","code_challenge","setIssuedAt","setExpirationTime","sign","formBody","URLSearchParams","client_assertion","request","method","headers","body","toString","then","res","json","result","request_uri"],"sourceRoot":"../../../src","sources":["utils/par.ts"],"mappings":"AAAA,SACEA,cAAc,EAEdC,OAAO,QACF,6BAA6B;AACpC,OAAOC,IAAI,MAAM,mBAAmB;AACpC,OAAO,KAAKC,CAAC,MAAM,KAAK;AACxB,OAAO,KAAKC,yBAAyB,MAAM,gCAAgC;AAC3E,SAASC,SAAS,QAAQ,QAAQ;AAGlC,OAAO,MAAMC,mBAAmB,GAAGH,CAAC,CAACI,MAAM,CAAC;EAC1CC,qBAAqB,EAAEL,CAAC,CAACI,MAAM,CAAC;IAC9BE,IAAI,EAAEN,CAAC,CAACO,MAAM,CAAC;EACjB,CAAC,CAAC;EACFC,MAAM,EAAER,CAAC,CAACS,KAAK,CAAC,CAACT,CAAC,CAACU,OAAO,CAAC,WAAW,CAAC,EAAEV,CAAC,CAACU,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;EACpEJ,IAAI,EAAEN,CAAC,CAACU,OAAO,CAAC,mBAAmB;AACrC,CAAC,CAAC;AAGF,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hC,QAAQ;MACnBiC,qBAAqB,EAAEb,mBAAmB;MAC1Cc,cAAc,EAAEb;IAClB,CAAC,CAAC,CACDc,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,IAAI,CAAC,CACvBC,IAAI,CAAC,CAAC;;IAET;IACA,IAAIC,QAAQ,GAAG,IAAIC,eAAe,CAAC;MACjCV,aAAa,EAAE,MAAM;MACrBG,SAAS,EAAEhC,QAAQ;MACnBkC,cAAc,EAAEb,aAAa;MAC7BY,qBAAqB,EAAE,MAAM;MAC7BN,qBAAqB,EAAErB,aAAa;MACpCkC,gBAAgB,EAAEpC,yBAAyB;MAC3CqC,OAAO,EAAEnB;IACX,CAAC,CAAC;IAEF,OAAO,MAAMxB,QAAQ,CAACK,WAAW,EAAE;MACjCuC,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACDC,IAAI,EAAEN,QAAQ,CAACO,QAAQ,CAAC;IAC1B,CAAC,CAAC,CACCC,IAAI,CAAC9D,SAAS,CAAC,GAAG,CAAC,CAAC,CACpB8D,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBF,IAAI,CAAEG,MAAM,IAAKA,MAAM,CAACC,WAAW,CAAC;EACzC,CAAC;AAAA"}
|
@@ -8,13 +8,14 @@ import { SupportedCredentialFormat } from "./const";
|
|
8
8
|
* Return the signed jwt for nonce proof of possession
|
9
9
|
*/
|
10
10
|
export declare const createNonceProof: (nonce: string, issuer: string, audience: string, ctx: CryptoContext) => Promise<string>;
|
11
|
-
export type ObtainCredential = (issuerConf: Out<EvaluateIssuerTrust>["issuerConf"], accessToken: Out<AuthorizeAccess>["accessToken"], nonce: Out<AuthorizeAccess>["nonce"], clientId: Out<AuthorizeAccess>["clientId"], credentialType: Out<StartFlow>["credentialType"], context: {
|
11
|
+
export type ObtainCredential = (issuerConf: Out<EvaluateIssuerTrust>["issuerConf"], accessToken: Out<AuthorizeAccess>["accessToken"], nonce: Out<AuthorizeAccess>["nonce"], clientId: Out<AuthorizeAccess>["clientId"], credentialType: Out<StartFlow>["credentialType"], credentialFormat: SupportedCredentialFormat, context: {
|
12
12
|
credentialCryptoContext: CryptoContext;
|
13
13
|
walletProviderBaseUrl: string;
|
14
14
|
appFetch?: GlobalFetch["fetch"];
|
15
15
|
}) => Promise<{
|
16
16
|
credential: string;
|
17
17
|
format: SupportedCredentialFormat;
|
18
|
+
nonce: string;
|
18
19
|
}>;
|
19
20
|
/**
|
20
21
|
* Fetch a credential from the issuer
|
@@ -24,6 +25,7 @@ export type ObtainCredential = (issuerConf: Out<EvaluateIssuerTrust>["issuerConf
|
|
24
25
|
* @param nonce The nonce value to prevent reply attacks, obtained with the access authorization step
|
25
26
|
* @param clientId Identifies the current client across all the requests of the issuing flow
|
26
27
|
* @param credentialType The type of the credential to be requested
|
28
|
+
* @param credentialFormat The format of the requested credential. @see {SupportedCredentialFormat}
|
27
29
|
* @param context.credentialCryptoContext The context to access the key the Credential will be bound to
|
28
30
|
* @param context.walletProviderBaseUrl The base url of the Wallet Provider
|
29
31
|
* @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"06-obtain-credential.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/06-obtain-credential.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,gBAAgB,UACpB,MAAM,UACL,MAAM,YACJ,MAAM,OACX,aAAa,KACjB,QAAQ,MAAM,CAchB,CAAC;
|
1
|
+
{"version":3,"file":"06-obtain-credential.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/06-obtain-credential.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,gBAAgB,UACpB,MAAM,UACL,MAAM,YACJ,MAAM,OACX,aAAa,KACjB,QAAQ,MAAM,CAchB,CAAC;AAWF,MAAM,MAAM,gBAAgB,GAAG,CAC7B,UAAU,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAClD,WAAW,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,EAChD,KAAK,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,EACpC,QAAQ,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,UAAU,CAAC,EAC1C,cAAc,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,EAChD,gBAAgB,EAAE,yBAAyB,EAC3C,OAAO,EAAE;IACP,uBAAuB,EAAE,aAAa,CAAC;IACvC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yBAAyB,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAeH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAuE9B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"07-verify-and-parse-credential.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/07-verify-and-parse-credential.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,MAAM,wBAAwB,GAAG,CACrC,UAAU,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAClD,UAAU,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC,YAAY,CAAC,EAC/C,MAAM,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,EACvC,OAAO,EAAE;IACP,uBAAuB,EAAE,aAAa,CAAC;IACvC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,KACE,OAAO,CAAC;IAAE,gBAAgB,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAAC;AAGrD,KAAK,gBAAgB,GAAG,MAAM;AAC5B,oBAAoB;AACpB,MAAM,EACN;IACE,2CAA2C;IAC3C,IAAI,EACA,yBAAyB,CAAC,MAAM,CAC9B,MAAM,EACN,MAAM,CACP,GACD,4BAA4B,CAAC,MAAM,CAAC;IACxC,+CAA+C;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,wCAAwC;IACxC,KAAK,EAAE,OAAO,CAAC;CAChB,CACF,CAAC;
|
1
|
+
{"version":3,"file":"07-verify-and-parse-credential.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/07-verify-and-parse-credential.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,MAAM,wBAAwB,GAAG,CACrC,UAAU,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAClD,UAAU,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC,YAAY,CAAC,EAC/C,MAAM,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,EACvC,OAAO,EAAE;IACP,uBAAuB,EAAE,aAAa,CAAC;IACvC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,KACE,OAAO,CAAC;IAAE,gBAAgB,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAAC;AAGrD,KAAK,gBAAgB,GAAG,MAAM;AAC5B,oBAAoB;AACpB,MAAM,EACN;IACE,2CAA2C;IAC3C,IAAI,EACA,yBAAyB,CAAC,MAAM,CAC9B,MAAM,EACN,MAAM,CACP,GACD,4BAA4B,CAAC,MAAM,CAAC;IACxC,+CAA+C;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,wCAAwC;IACxC,KAAK,EAAE,OAAO,CAAC;CAChB,CACF,CAAC;AA8KF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB,EAAE,wBAwBtC,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as z from "zod";
|
2
2
|
export declare const ASSERTION_TYPE = "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation";
|
3
3
|
export type SupportedCredentialFormat = z.infer<typeof SupportedCredentialFormat>;
|
4
|
-
export declare const SupportedCredentialFormat: z.ZodLiteral<"vc+sd-jwt">;
|
4
|
+
export declare const SupportedCredentialFormat: z.ZodUnion<[z.ZodLiteral<"vc+sd-jwt">, z.ZodLiteral<"vc+mdoc-cbor">]>;
|
5
5
|
//# sourceMappingURL=const.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/const.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAEvE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,yBAAyB,CACjC,CAAC;AACF,eAAO,MAAM,yBAAyB,
|
1
|
+
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/const.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAEvE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,yBAAyB,CACjC,CAAC;AACF,eAAO,MAAM,yBAAyB,uEAGpC,CAAC"}
|
@@ -291,7 +291,7 @@ export declare const getCredentialIssuerEntityConfiguration: (entityBaseUrl: Par
|
|
291
291
|
background_color: string;
|
292
292
|
text_color: string;
|
293
293
|
}[];
|
294
|
-
format: "vc+sd-jwt";
|
294
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
295
295
|
cryptographic_binding_methods_supported: string[];
|
296
296
|
cryptographic_suites_supported: string[];
|
297
297
|
credential_definition: {
|
@@ -690,7 +690,7 @@ export declare const getEntityConfiguration: (entityBaseUrl: Parameters<typeof f
|
|
690
690
|
background_color: string;
|
691
691
|
text_color: string;
|
692
692
|
}[];
|
693
|
-
format: "vc+sd-jwt";
|
693
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
694
694
|
cryptographic_binding_methods_supported: string[];
|
695
695
|
cryptographic_suites_supported: string[];
|
696
696
|
credential_definition: {
|
@@ -2139,7 +2139,7 @@ export declare const CredentialIssuerEntityConfiguration: z.ZodIntersection<z.Zo
|
|
2139
2139
|
credential_endpoint: z.ZodString;
|
2140
2140
|
credentials_supported: z.ZodArray<z.ZodObject<{
|
2141
2141
|
id: z.ZodString;
|
2142
|
-
format: z.ZodLiteral<"vc+sd-jwt">;
|
2142
|
+
format: z.ZodUnion<[z.ZodLiteral<"vc+sd-jwt">, z.ZodLiteral<"vc+mdoc-cbor">]>;
|
2143
2143
|
cryptographic_binding_methods_supported: z.ZodArray<z.ZodString, "many">;
|
2144
2144
|
cryptographic_suites_supported: z.ZodArray<z.ZodString, "many">;
|
2145
2145
|
display: z.ZodArray<z.ZodObject<{
|
@@ -2234,7 +2234,7 @@ export declare const CredentialIssuerEntityConfiguration: z.ZodIntersection<z.Zo
|
|
2234
2234
|
background_color: string;
|
2235
2235
|
text_color: string;
|
2236
2236
|
}[];
|
2237
|
-
format: "vc+sd-jwt";
|
2237
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
2238
2238
|
cryptographic_binding_methods_supported: string[];
|
2239
2239
|
cryptographic_suites_supported: string[];
|
2240
2240
|
credential_definition: {
|
@@ -2259,7 +2259,7 @@ export declare const CredentialIssuerEntityConfiguration: z.ZodIntersection<z.Zo
|
|
2259
2259
|
background_color: string;
|
2260
2260
|
text_color: string;
|
2261
2261
|
}[];
|
2262
|
-
format: "vc+sd-jwt";
|
2262
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
2263
2263
|
cryptographic_binding_methods_supported: string[];
|
2264
2264
|
cryptographic_suites_supported: string[];
|
2265
2265
|
credential_definition: {
|
@@ -2440,7 +2440,7 @@ export declare const CredentialIssuerEntityConfiguration: z.ZodIntersection<z.Zo
|
|
2440
2440
|
background_color: string;
|
2441
2441
|
text_color: string;
|
2442
2442
|
}[];
|
2443
|
-
format: "vc+sd-jwt";
|
2443
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
2444
2444
|
cryptographic_binding_methods_supported: string[];
|
2445
2445
|
cryptographic_suites_supported: string[];
|
2446
2446
|
credential_definition: {
|
@@ -2499,7 +2499,7 @@ export declare const CredentialIssuerEntityConfiguration: z.ZodIntersection<z.Zo
|
|
2499
2499
|
background_color: string;
|
2500
2500
|
text_color: string;
|
2501
2501
|
}[];
|
2502
|
-
format: "vc+sd-jwt";
|
2502
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
2503
2503
|
cryptographic_binding_methods_supported: string[];
|
2504
2504
|
cryptographic_suites_supported: string[];
|
2505
2505
|
credential_definition: {
|
@@ -2753,7 +2753,7 @@ export declare const CredentialIssuerEntityConfiguration: z.ZodIntersection<z.Zo
|
|
2753
2753
|
background_color: string;
|
2754
2754
|
text_color: string;
|
2755
2755
|
}[];
|
2756
|
-
format: "vc+sd-jwt";
|
2756
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
2757
2757
|
cryptographic_binding_methods_supported: string[];
|
2758
2758
|
cryptographic_suites_supported: string[];
|
2759
2759
|
credential_definition: {
|
@@ -2846,7 +2846,7 @@ export declare const CredentialIssuerEntityConfiguration: z.ZodIntersection<z.Zo
|
|
2846
2846
|
background_color: string;
|
2847
2847
|
text_color: string;
|
2848
2848
|
}[];
|
2849
|
-
format: "vc+sd-jwt";
|
2849
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
2850
2850
|
cryptographic_binding_methods_supported: string[];
|
2851
2851
|
cryptographic_suites_supported: string[];
|
2852
2852
|
credential_definition: {
|
@@ -2967,7 +2967,7 @@ export declare const CredentialIssuerEntityConfiguration: z.ZodIntersection<z.Zo
|
|
2967
2967
|
background_color: string;
|
2968
2968
|
text_color: string;
|
2969
2969
|
}[];
|
2970
|
-
format: "vc+sd-jwt";
|
2970
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
2971
2971
|
cryptographic_binding_methods_supported: string[];
|
2972
2972
|
cryptographic_suites_supported: string[];
|
2973
2973
|
credential_definition: {
|
@@ -3088,7 +3088,7 @@ export declare const CredentialIssuerEntityConfiguration: z.ZodIntersection<z.Zo
|
|
3088
3088
|
background_color: string;
|
3089
3089
|
text_color: string;
|
3090
3090
|
}[];
|
3091
|
-
format: "vc+sd-jwt";
|
3091
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
3092
3092
|
cryptographic_binding_methods_supported: string[];
|
3093
3093
|
cryptographic_suites_supported: string[];
|
3094
3094
|
credential_definition: {
|
@@ -3211,7 +3211,7 @@ export declare const CredentialIssuerEntityConfiguration: z.ZodIntersection<z.Zo
|
|
3211
3211
|
background_color: string;
|
3212
3212
|
text_color: string;
|
3213
3213
|
}[];
|
3214
|
-
format: "vc+sd-jwt";
|
3214
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
3215
3215
|
cryptographic_binding_methods_supported: string[];
|
3216
3216
|
cryptographic_suites_supported: string[];
|
3217
3217
|
credential_definition: {
|
@@ -3334,7 +3334,7 @@ export declare const CredentialIssuerEntityConfiguration: z.ZodIntersection<z.Zo
|
|
3334
3334
|
background_color: string;
|
3335
3335
|
text_color: string;
|
3336
3336
|
}[];
|
3337
|
-
format: "vc+sd-jwt";
|
3337
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
3338
3338
|
cryptographic_binding_methods_supported: string[];
|
3339
3339
|
cryptographic_suites_supported: string[];
|
3340
3340
|
credential_definition: {
|
@@ -8504,7 +8504,7 @@ export declare const EntityConfiguration: z.ZodUnion<[z.ZodIntersection<z.ZodObj
|
|
8504
8504
|
credential_endpoint: z.ZodString;
|
8505
8505
|
credentials_supported: z.ZodArray<z.ZodObject<{
|
8506
8506
|
id: z.ZodString;
|
8507
|
-
format: z.ZodLiteral<"vc+sd-jwt">;
|
8507
|
+
format: z.ZodUnion<[z.ZodLiteral<"vc+sd-jwt">, z.ZodLiteral<"vc+mdoc-cbor">]>;
|
8508
8508
|
cryptographic_binding_methods_supported: z.ZodArray<z.ZodString, "many">;
|
8509
8509
|
cryptographic_suites_supported: z.ZodArray<z.ZodString, "many">;
|
8510
8510
|
display: z.ZodArray<z.ZodObject<{
|
@@ -8599,7 +8599,7 @@ export declare const EntityConfiguration: z.ZodUnion<[z.ZodIntersection<z.ZodObj
|
|
8599
8599
|
background_color: string;
|
8600
8600
|
text_color: string;
|
8601
8601
|
}[];
|
8602
|
-
format: "vc+sd-jwt";
|
8602
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
8603
8603
|
cryptographic_binding_methods_supported: string[];
|
8604
8604
|
cryptographic_suites_supported: string[];
|
8605
8605
|
credential_definition: {
|
@@ -8624,7 +8624,7 @@ export declare const EntityConfiguration: z.ZodUnion<[z.ZodIntersection<z.ZodObj
|
|
8624
8624
|
background_color: string;
|
8625
8625
|
text_color: string;
|
8626
8626
|
}[];
|
8627
|
-
format: "vc+sd-jwt";
|
8627
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
8628
8628
|
cryptographic_binding_methods_supported: string[];
|
8629
8629
|
cryptographic_suites_supported: string[];
|
8630
8630
|
credential_definition: {
|
@@ -8805,7 +8805,7 @@ export declare const EntityConfiguration: z.ZodUnion<[z.ZodIntersection<z.ZodObj
|
|
8805
8805
|
background_color: string;
|
8806
8806
|
text_color: string;
|
8807
8807
|
}[];
|
8808
|
-
format: "vc+sd-jwt";
|
8808
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
8809
8809
|
cryptographic_binding_methods_supported: string[];
|
8810
8810
|
cryptographic_suites_supported: string[];
|
8811
8811
|
credential_definition: {
|
@@ -8864,7 +8864,7 @@ export declare const EntityConfiguration: z.ZodUnion<[z.ZodIntersection<z.ZodObj
|
|
8864
8864
|
background_color: string;
|
8865
8865
|
text_color: string;
|
8866
8866
|
}[];
|
8867
|
-
format: "vc+sd-jwt";
|
8867
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
8868
8868
|
cryptographic_binding_methods_supported: string[];
|
8869
8869
|
cryptographic_suites_supported: string[];
|
8870
8870
|
credential_definition: {
|
@@ -9118,7 +9118,7 @@ export declare const EntityConfiguration: z.ZodUnion<[z.ZodIntersection<z.ZodObj
|
|
9118
9118
|
background_color: string;
|
9119
9119
|
text_color: string;
|
9120
9120
|
}[];
|
9121
|
-
format: "vc+sd-jwt";
|
9121
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
9122
9122
|
cryptographic_binding_methods_supported: string[];
|
9123
9123
|
cryptographic_suites_supported: string[];
|
9124
9124
|
credential_definition: {
|
@@ -9211,7 +9211,7 @@ export declare const EntityConfiguration: z.ZodUnion<[z.ZodIntersection<z.ZodObj
|
|
9211
9211
|
background_color: string;
|
9212
9212
|
text_color: string;
|
9213
9213
|
}[];
|
9214
|
-
format: "vc+sd-jwt";
|
9214
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
9215
9215
|
cryptographic_binding_methods_supported: string[];
|
9216
9216
|
cryptographic_suites_supported: string[];
|
9217
9217
|
credential_definition: {
|
@@ -9332,7 +9332,7 @@ export declare const EntityConfiguration: z.ZodUnion<[z.ZodIntersection<z.ZodObj
|
|
9332
9332
|
background_color: string;
|
9333
9333
|
text_color: string;
|
9334
9334
|
}[];
|
9335
|
-
format: "vc+sd-jwt";
|
9335
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
9336
9336
|
cryptographic_binding_methods_supported: string[];
|
9337
9337
|
cryptographic_suites_supported: string[];
|
9338
9338
|
credential_definition: {
|
@@ -9453,7 +9453,7 @@ export declare const EntityConfiguration: z.ZodUnion<[z.ZodIntersection<z.ZodObj
|
|
9453
9453
|
background_color: string;
|
9454
9454
|
text_color: string;
|
9455
9455
|
}[];
|
9456
|
-
format: "vc+sd-jwt";
|
9456
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
9457
9457
|
cryptographic_binding_methods_supported: string[];
|
9458
9458
|
cryptographic_suites_supported: string[];
|
9459
9459
|
credential_definition: {
|
@@ -9576,7 +9576,7 @@ export declare const EntityConfiguration: z.ZodUnion<[z.ZodIntersection<z.ZodObj
|
|
9576
9576
|
background_color: string;
|
9577
9577
|
text_color: string;
|
9578
9578
|
}[];
|
9579
|
-
format: "vc+sd-jwt";
|
9579
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
9580
9580
|
cryptographic_binding_methods_supported: string[];
|
9581
9581
|
cryptographic_suites_supported: string[];
|
9582
9582
|
credential_definition: {
|
@@ -9699,7 +9699,7 @@ export declare const EntityConfiguration: z.ZodUnion<[z.ZodIntersection<z.ZodObj
|
|
9699
9699
|
background_color: string;
|
9700
9700
|
text_color: string;
|
9701
9701
|
}[];
|
9702
|
-
format: "vc+sd-jwt";
|
9702
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
9703
9703
|
cryptographic_binding_methods_supported: string[];
|
9704
9704
|
cryptographic_suites_supported: string[];
|
9705
9705
|
credential_definition: {
|
@@ -10,17 +10,17 @@ export declare const AuthorizationDetail: z.ZodObject<{
|
|
10
10
|
}, {
|
11
11
|
type: string;
|
12
12
|
}>;
|
13
|
-
format: z.ZodLiteral<"vc+sd-jwt">;
|
13
|
+
format: z.ZodUnion<[z.ZodLiteral<"vc+sd-jwt">, z.ZodLiteral<"vc+mdoc-cbor">]>;
|
14
14
|
type: z.ZodLiteral<"openid_credential">;
|
15
15
|
}, "strip", z.ZodTypeAny, {
|
16
16
|
type: "openid_credential";
|
17
|
-
format: "vc+sd-jwt";
|
17
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
18
18
|
credential_definition: {
|
19
19
|
type: string;
|
20
20
|
};
|
21
21
|
}, {
|
22
22
|
type: "openid_credential";
|
23
|
-
format: "vc+sd-jwt";
|
23
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
24
24
|
credential_definition: {
|
25
25
|
type: string;
|
26
26
|
};
|
@@ -34,17 +34,17 @@ export declare const AuthorizationDetails: z.ZodArray<z.ZodObject<{
|
|
34
34
|
}, {
|
35
35
|
type: string;
|
36
36
|
}>;
|
37
|
-
format: z.ZodLiteral<"vc+sd-jwt">;
|
37
|
+
format: z.ZodUnion<[z.ZodLiteral<"vc+sd-jwt">, z.ZodLiteral<"vc+mdoc-cbor">]>;
|
38
38
|
type: z.ZodLiteral<"openid_credential">;
|
39
39
|
}, "strip", z.ZodTypeAny, {
|
40
40
|
type: "openid_credential";
|
41
|
-
format: "vc+sd-jwt";
|
41
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
42
42
|
credential_definition: {
|
43
43
|
type: string;
|
44
44
|
};
|
45
45
|
}, {
|
46
46
|
type: "openid_credential";
|
47
|
-
format: "vc+sd-jwt";
|
47
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
48
48
|
credential_definition: {
|
49
49
|
type: string;
|
50
50
|
};
|
@@ -60,7 +60,7 @@ export declare const makeParRequest: ({ wiaCryptoContext, appFetch, }: {
|
|
60
60
|
} | undefined;
|
61
61
|
}) => (clientId: string, codeVerifier: string, walletProviderBaseUrl: string, parEndpoint: string, walletInstanceAttestation: string, authorizationDetails: {
|
62
62
|
type: "openid_credential";
|
63
|
-
format: "vc+sd-jwt";
|
63
|
+
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
64
64
|
credential_definition: {
|
65
65
|
type: string;
|
66
66
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pagopa/io-react-native-wallet",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.11.0",
|
4
4
|
"description": "Provide data structures, helpers and API for IO Wallet",
|
5
5
|
"main": "lib/commonjs/index",
|
6
6
|
"module": "lib/module/index",
|
@@ -82,7 +82,7 @@
|
|
82
82
|
"engines": {
|
83
83
|
"node": ">= 16.0.0"
|
84
84
|
},
|
85
|
-
"packageManager": "
|
85
|
+
"packageManager": "yarn@1.22.19",
|
86
86
|
"jest": {
|
87
87
|
"preset": "react-native",
|
88
88
|
"modulePathIgnorePatterns": [
|
@@ -36,6 +36,10 @@ export const createNonceProof = async (
|
|
36
36
|
const CredentialEndpointResponse = z.object({
|
37
37
|
credential: z.string(),
|
38
38
|
format: SupportedCredentialFormat,
|
39
|
+
// nonce used to perform multiple credential requests
|
40
|
+
// re-using the same authorization profile
|
41
|
+
c_nonce: z.string(),
|
42
|
+
c_nonce_expires_in: z.number(),
|
39
43
|
});
|
40
44
|
|
41
45
|
export type ObtainCredential = (
|
@@ -44,12 +48,30 @@ export type ObtainCredential = (
|
|
44
48
|
nonce: Out<AuthorizeAccess>["nonce"],
|
45
49
|
clientId: Out<AuthorizeAccess>["clientId"],
|
46
50
|
credentialType: Out<StartFlow>["credentialType"],
|
51
|
+
credentialFormat: SupportedCredentialFormat,
|
47
52
|
context: {
|
48
53
|
credentialCryptoContext: CryptoContext;
|
49
54
|
walletProviderBaseUrl: string;
|
50
55
|
appFetch?: GlobalFetch["fetch"];
|
51
56
|
}
|
52
|
-
) => Promise<{
|
57
|
+
) => Promise<{
|
58
|
+
credential: string;
|
59
|
+
format: SupportedCredentialFormat;
|
60
|
+
nonce: string;
|
61
|
+
}>;
|
62
|
+
|
63
|
+
// Checks whether in the Entity confoguration at least one credential
|
64
|
+
// is defined for the given type and format
|
65
|
+
const isCredentialAvailable = (
|
66
|
+
issuerConf: Out<EvaluateIssuerTrust>["issuerConf"],
|
67
|
+
credentialType: Out<StartFlow>["credentialType"],
|
68
|
+
credentialFormat: SupportedCredentialFormat
|
69
|
+
): boolean =>
|
70
|
+
issuerConf.openid_credential_issuer.credentials_supported.some(
|
71
|
+
(c) =>
|
72
|
+
c.format === credentialFormat &&
|
73
|
+
c.credential_definition.type.includes(credentialType)
|
74
|
+
);
|
53
75
|
|
54
76
|
/**
|
55
77
|
* Fetch a credential from the issuer
|
@@ -59,6 +81,7 @@ export type ObtainCredential = (
|
|
59
81
|
* @param nonce The nonce value to prevent reply attacks, obtained with the access authorization step
|
60
82
|
* @param clientId Identifies the current client across all the requests of the issuing flow
|
61
83
|
* @param credentialType The type of the credential to be requested
|
84
|
+
* @param credentialFormat The format of the requested credential. @see {SupportedCredentialFormat}
|
62
85
|
* @param context.credentialCryptoContext The context to access the key the Credential will be bound to
|
63
86
|
* @param context.walletProviderBaseUrl The base url of the Wallet Provider
|
64
87
|
* @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
|
@@ -70,6 +93,7 @@ export const obtainCredential: ObtainCredential = async (
|
|
70
93
|
nonce,
|
71
94
|
clientId,
|
72
95
|
credentialType,
|
96
|
+
credentialFormat,
|
73
97
|
context
|
74
98
|
) => {
|
75
99
|
const {
|
@@ -78,6 +102,12 @@ export const obtainCredential: ObtainCredential = async (
|
|
78
102
|
appFetch = fetch,
|
79
103
|
} = context;
|
80
104
|
|
105
|
+
if (!isCredentialAvailable(issuerConf, credentialType, credentialFormat)) {
|
106
|
+
throw new Error(
|
107
|
+
`The Issuer provides no credential for type ${credentialType} and format ${credentialFormat}`
|
108
|
+
);
|
109
|
+
}
|
110
|
+
|
81
111
|
const credentialUrl = issuerConf.openid_credential_issuer.credential_endpoint;
|
82
112
|
|
83
113
|
/** DPoP token for demonstating the possession
|
@@ -107,14 +137,14 @@ export const obtainCredential: ObtainCredential = async (
|
|
107
137
|
credential_definition: JSON.stringify({
|
108
138
|
type: [credentialType],
|
109
139
|
}),
|
110
|
-
format:
|
140
|
+
format: credentialFormat,
|
111
141
|
proof: JSON.stringify({
|
112
142
|
jwt: signedNonceProof,
|
113
143
|
proof_type: "jwt",
|
114
144
|
}),
|
115
145
|
});
|
116
146
|
|
117
|
-
const { credential, format } = await appFetch(credentialUrl, {
|
147
|
+
const { credential, format, c_nonce } = await appFetch(credentialUrl, {
|
118
148
|
method: "POST",
|
119
149
|
headers: {
|
120
150
|
"Content-Type": "application/x-www-form-urlencoded",
|
@@ -127,5 +157,5 @@ export const obtainCredential: ObtainCredential = async (
|
|
127
157
|
.then((res) => res.json())
|
128
158
|
.then(CredentialEndpointResponse.parse);
|
129
159
|
|
130
|
-
return { credential, format };
|
160
|
+
return { credential, format, nonce: c_nonce };
|
131
161
|
};
|
@@ -49,8 +49,10 @@ const parseCredentialSdJwt = (
|
|
49
49
|
): ParsedCredential => {
|
50
50
|
// find the definition that matches the received credential's type
|
51
51
|
// warning: if more then a defintion is found, the first is retrieved
|
52
|
-
const credentialSubject = credentials_supported.find(
|
53
|
-
c
|
52
|
+
const credentialSubject = credentials_supported.find(
|
53
|
+
(c) =>
|
54
|
+
c.format === "vc+sd-jwt" &&
|
55
|
+
c.credential_definition.type.includes(sdJwt.payload.type)
|
54
56
|
)?.credential_definition.credentialSubject;
|
55
57
|
|
56
58
|
// the received credential matches no supported credential, throw an exception
|
@@ -196,6 +198,16 @@ const verifyAndParseCredentialSdJwt: WithFormat<"vc+sd-jwt"> = async (
|
|
196
198
|
return { parsedCredential };
|
197
199
|
};
|
198
200
|
|
201
|
+
const verifyAndParseCredentialMdoc: WithFormat<"vc+mdoc-cbor"> = async (
|
202
|
+
_issuerConf,
|
203
|
+
_credential,
|
204
|
+
_,
|
205
|
+
_ctx
|
206
|
+
) => {
|
207
|
+
// TODO: [SIW-686] decode MDOC credentials
|
208
|
+
throw new Error("verifyAndParseCredentialMdoc not implemented yet");
|
209
|
+
};
|
210
|
+
|
199
211
|
/**
|
200
212
|
* Verify and parse an encoded credential
|
201
213
|
*
|
@@ -222,6 +234,13 @@ export const verifyAndParseCredential: VerifyAndParseCredential = async (
|
|
222
234
|
format,
|
223
235
|
context
|
224
236
|
);
|
237
|
+
} else if (format === "vc+mdoc-cbor") {
|
238
|
+
return verifyAndParseCredentialMdoc(
|
239
|
+
issuerConf,
|
240
|
+
credential,
|
241
|
+
format,
|
242
|
+
context
|
243
|
+
);
|
225
244
|
}
|
226
245
|
|
227
246
|
const _: never = format;
|
@@ -5,4 +5,7 @@ export const ASSERTION_TYPE =
|
|
5
5
|
export type SupportedCredentialFormat = z.infer<
|
6
6
|
typeof SupportedCredentialFormat
|
7
7
|
>;
|
8
|
-
export const SupportedCredentialFormat = z.
|
8
|
+
export const SupportedCredentialFormat = z.union([
|
9
|
+
z.literal("vc+sd-jwt"),
|
10
|
+
z.literal("vc+mdoc-cbor"),
|
11
|
+
]);
|
package/src/trust/types.ts
CHANGED
@@ -45,7 +45,7 @@ const CredentialDefinitionMetadata = z.object({
|
|
45
45
|
type SupportedCredentialMetadata = z.infer<typeof SupportedCredentialMetadata>;
|
46
46
|
const SupportedCredentialMetadata = z.object({
|
47
47
|
id: z.string(),
|
48
|
-
format: z.literal("vc+sd-jwt"),
|
48
|
+
format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
|
49
49
|
cryptographic_binding_methods_supported: z.array(z.string()),
|
50
50
|
cryptographic_suites_supported: z.array(z.string()),
|
51
51
|
display: z.array(CredentialDisplayMetadata),
|
@@ -143,7 +143,7 @@ export const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(
|
|
143
143
|
credentials_supported: z.array(SupportedCredentialMetadata),
|
144
144
|
jwks: z.object({ keys: z.array(JWK) }),
|
145
145
|
}),
|
146
|
-
/** Credential Issuers act as Relying Party
|
146
|
+
/** Credential Issuers act as Relying Party
|
147
147
|
when they require the presentation of other credentials.
|
148
148
|
This does not apply for PID issuance, which requires CIE authz. */
|
149
149
|
wallet_relying_party: RelyingPartyMetadata.optional(),
|
package/src/utils/par.ts
CHANGED
@@ -13,7 +13,7 @@ export const AuthorizationDetail = z.object({
|
|
13
13
|
credential_definition: z.object({
|
14
14
|
type: z.string(),
|
15
15
|
}),
|
16
|
-
format: z.literal("vc+sd-jwt"),
|
16
|
+
format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
|
17
17
|
type: z.literal("openid_credential"),
|
18
18
|
});
|
19
19
|
|
@@ -48,7 +48,7 @@ export const makeParRequest =
|
|
48
48
|
const iss = WalletInstanceAttestation.decode(walletInstanceAttestation)
|
49
49
|
.payload.cnf.jwk.kid;
|
50
50
|
|
51
|
-
/** A code challenge is provided so that the PAR is bound
|
51
|
+
/** A code challenge is provided so that the PAR is bound
|
52
52
|
to the subsequent authorization code request
|
53
53
|
@see https://datatracker.ietf.org/doc/html/rfc9126#name-request */
|
54
54
|
const codeChallengeMethod = "s256";
|