@pagopa/io-react-native-wallet 1.0.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/credential/index.js +1 -5
- package/lib/commonjs/credential/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/02-get-issuer-config.js +48 -0
- package/lib/commonjs/credential/issuance/02-get-issuer-config.js.map +1 -0
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js +16 -20
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +8 -8
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/05-authorize-access.js +8 -9
- package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/commonjs/credential/issuance/06-obtain-credential.js +18 -21
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +3 -3
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/README.md +18 -21
- package/lib/commonjs/credential/issuance/index.js +3 -3
- package/lib/commonjs/credential/issuance/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/types.js +1 -1
- package/lib/commonjs/credential/issuance/types.js.map +1 -1
- package/lib/commonjs/credential/presentation/01-start-flow.js +7 -2
- package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js +2 -2
- package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
- package/lib/commonjs/credential/presentation/03-retrieve-jwks.js +68 -0
- package/lib/commonjs/credential/presentation/03-retrieve-jwks.js.map +1 -0
- package/lib/commonjs/credential/presentation/{03-get-request-object.js → 04-get-request-object.js} +27 -13
- package/lib/commonjs/credential/presentation/04-get-request-object.js.map +1 -0
- package/lib/commonjs/credential/presentation/{04-send-authorization-response.js → 05-send-authorization-response.js} +1 -1
- package/lib/commonjs/credential/presentation/{04-send-authorization-response.js.map → 05-send-authorization-response.js.map} +1 -1
- package/lib/commonjs/credential/presentation/README.md +74 -2
- package/lib/commonjs/credential/presentation/index.js +15 -2
- package/lib/commonjs/credential/presentation/index.js.map +1 -1
- package/lib/commonjs/credential/presentation/types.js +5 -3
- package/lib/commonjs/credential/presentation/types.js.map +1 -1
- package/lib/commonjs/entity/openid-connect/issuer/index.js +25 -0
- package/lib/commonjs/entity/openid-connect/issuer/index.js.map +1 -0
- package/lib/commonjs/entity/openid-connect/issuer/types.js +61 -0
- package/lib/commonjs/entity/openid-connect/issuer/types.js.map +1 -0
- package/lib/commonjs/{trust → entity/trust}/chain.js +1 -1
- package/lib/commonjs/entity/trust/chain.js.map +1 -0
- package/lib/commonjs/{trust → entity/trust}/index.js +1 -1
- package/lib/commonjs/entity/trust/index.js.map +1 -0
- package/lib/commonjs/{trust → entity/trust}/types.js +2 -2
- package/lib/commonjs/entity/trust/types.js.map +1 -0
- package/lib/commonjs/index.js +1 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/pid/sd-jwt/types.js +2 -18
- package/lib/commonjs/pid/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/index.test.js +32 -23
- package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/types.test.js +20 -11
- package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/types.js +18 -5
- package/lib/commonjs/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/utils/error-codes.js +1 -13
- package/lib/commonjs/utils/error-codes.js.map +1 -1
- package/lib/commonjs/utils/errors.js +2 -53
- package/lib/commonjs/utils/errors.js.map +1 -1
- package/lib/commonjs/utils/jwk.js +5 -1
- package/lib/commonjs/utils/jwk.js.map +1 -1
- package/lib/commonjs/utils/par.js +6 -12
- package/lib/commonjs/utils/par.js.map +1 -1
- package/lib/module/credential/index.js +1 -3
- package/lib/module/credential/index.js.map +1 -1
- package/lib/module/credential/issuance/02-get-issuer-config.js +42 -0
- package/lib/module/credential/issuance/02-get-issuer-config.js.map +1 -0
- package/lib/module/credential/issuance/03-start-user-authorization.js +16 -20
- package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js +8 -8
- package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/05-authorize-access.js +8 -9
- package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js +18 -21
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js +3 -3
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/module/credential/issuance/README.md +18 -21
- package/lib/module/credential/issuance/index.js +2 -2
- package/lib/module/credential/issuance/index.js.map +1 -1
- package/lib/module/credential/issuance/types.js +1 -1
- package/lib/module/credential/issuance/types.js.map +1 -1
- package/lib/module/credential/presentation/01-start-flow.js +7 -2
- package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/module/credential/presentation/02-evaluate-rp-trust.js +1 -1
- package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
- package/lib/module/credential/presentation/03-retrieve-jwks.js +61 -0
- package/lib/module/credential/presentation/03-retrieve-jwks.js.map +1 -0
- package/lib/module/credential/presentation/{03-get-request-object.js → 04-get-request-object.js} +26 -12
- package/lib/module/credential/presentation/04-get-request-object.js.map +1 -0
- package/lib/module/credential/presentation/{04-send-authorization-response.js → 05-send-authorization-response.js} +1 -1
- package/lib/module/credential/presentation/{04-send-authorization-response.js.map → 05-send-authorization-response.js.map} +1 -1
- package/lib/module/credential/presentation/README.md +74 -2
- package/lib/module/credential/presentation/index.js +4 -3
- package/lib/module/credential/presentation/index.js.map +1 -1
- package/lib/module/credential/presentation/types.js +5 -3
- package/lib/module/credential/presentation/types.js.map +1 -1
- package/lib/module/entity/openid-connect/issuer/index.js +20 -0
- package/lib/module/entity/openid-connect/issuer/index.js.map +1 -0
- package/lib/module/entity/openid-connect/issuer/types.js +47 -0
- package/lib/module/entity/openid-connect/issuer/types.js.map +1 -0
- package/lib/module/{trust → entity/trust}/chain.js +1 -1
- package/lib/module/entity/trust/chain.js.map +1 -0
- package/lib/module/{trust → entity/trust}/index.js +1 -1
- package/lib/module/entity/trust/index.js.map +1 -0
- package/lib/module/{trust → entity/trust}/types.js +2 -2
- package/lib/module/entity/trust/types.js.map +1 -0
- package/lib/module/index.js +1 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/pid/sd-jwt/types.js +1 -16
- package/lib/module/pid/sd-jwt/types.js.map +1 -1
- package/lib/module/sd-jwt/__test__/index.test.js +32 -23
- package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/module/sd-jwt/__test__/types.test.js +20 -11
- package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/module/sd-jwt/types.js +16 -4
- package/lib/module/sd-jwt/types.js.map +1 -1
- package/lib/module/utils/error-codes.js +1 -13
- package/lib/module/utils/error-codes.js.map +1 -1
- package/lib/module/utils/errors.js +0 -48
- package/lib/module/utils/errors.js.map +1 -1
- package/lib/module/utils/jwk.js +3 -0
- package/lib/module/utils/jwk.js.map +1 -1
- package/lib/module/utils/par.js +6 -12
- package/lib/module/utils/par.js.map +1 -1
- package/lib/typescript/credential/index.d.ts +1 -3
- package/lib/typescript/credential/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/01-start-flow.d.ts +1 -1
- package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts +32 -0
- package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +3 -3
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +8 -8
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/05-authorize-access.d.ts +3 -3
- package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +3 -3
- 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 +3 -3
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/index.d.ts +3 -3
- package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/types.d.ts +4 -9
- package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/01-start-flow.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts +1 -1
- package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/03-retrieve-jwks.d.ts +41 -0
- package/lib/typescript/credential/presentation/03-retrieve-jwks.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/{03-get-request-object.d.ts → 04-get-request-object.d.ts} +4 -4
- package/lib/typescript/credential/presentation/04-get-request-object.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/{04-send-authorization-response.d.ts → 05-send-authorization-response.d.ts} +2 -2
- package/lib/typescript/credential/presentation/{04-send-authorization-response.d.ts.map → 05-send-authorization-response.d.ts.map} +1 -1
- package/lib/typescript/credential/presentation/index.d.ts +5 -4
- package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/types.d.ts +15 -15
- package/lib/typescript/entity/openid-connect/issuer/index.d.ts +12 -0
- package/lib/typescript/entity/openid-connect/issuer/index.d.ts.map +1 -0
- package/lib/typescript/entity/openid-connect/issuer/types.d.ts +641 -0
- package/lib/typescript/entity/openid-connect/issuer/types.d.ts.map +1 -0
- package/lib/typescript/entity/trust/chain.d.ts.map +1 -0
- package/lib/typescript/{trust → entity/trust}/index.d.ts +97 -97
- package/lib/typescript/entity/trust/index.d.ts.map +1 -0
- package/lib/typescript/{trust → entity/trust}/types.d.ts +597 -597
- package/lib/typescript/{trust → entity/trust}/types.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/pid/sd-jwt/types.d.ts +25 -103
- package/lib/typescript/pid/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/index.d.ts +60 -20
- package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/types.d.ts +114 -24
- package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/utils/error-codes.d.ts +0 -12
- package/lib/typescript/utils/error-codes.d.ts.map +1 -1
- package/lib/typescript/utils/errors.d.ts +6 -37
- package/lib/typescript/utils/errors.d.ts.map +1 -1
- package/lib/typescript/utils/jwk.d.ts +135 -0
- package/lib/typescript/utils/jwk.d.ts.map +1 -1
- package/lib/typescript/utils/par.d.ts +1 -8
- package/lib/typescript/utils/par.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/types.d.ts +12 -12
- package/package.json +1 -1
- package/src/credential/index.ts +1 -4
- package/src/credential/issuance/01-start-flow.ts +1 -1
- package/src/credential/issuance/02-get-issuer-config.ts +67 -0
- package/src/credential/issuance/03-start-user-authorization.ts +22 -30
- package/src/credential/issuance/04-complete-user-authorization.ts +11 -13
- package/src/credential/issuance/05-authorize-access.ts +8 -10
- package/src/credential/issuance/06-obtain-credential.ts +30 -31
- package/src/credential/issuance/07-verify-and-parse-credential.ts +6 -6
- package/src/credential/issuance/README.md +18 -21
- package/src/credential/issuance/index.ts +3 -6
- package/src/credential/issuance/types.ts +1 -1
- package/src/credential/presentation/01-start-flow.ts +8 -2
- package/src/credential/presentation/02-evaluate-rp-trust.ts +2 -2
- package/src/credential/presentation/03-retrieve-jwks.ts +73 -0
- package/src/credential/presentation/{03-get-request-object.ts → 04-get-request-object.ts} +33 -15
- package/src/credential/presentation/{04-send-authorization-response.ts → 05-send-authorization-response.ts} +1 -1
- package/src/credential/presentation/README.md +74 -2
- package/src/credential/presentation/index.ts +10 -2
- package/src/credential/presentation/types.ts +3 -3
- package/src/entity/openid-connect/issuer/index.ts +27 -0
- package/src/entity/openid-connect/issuer/types.ts +68 -0
- package/src/{trust → entity/trust}/chain.ts +2 -2
- package/src/{trust → entity/trust}/index.ts +1 -1
- package/src/{trust → entity/trust}/types.ts +2 -2
- package/src/index.ts +0 -2
- package/src/pid/sd-jwt/types.ts +1 -18
- package/src/sd-jwt/__test__/index.test.ts +47 -37
- package/src/sd-jwt/__test__/types.test.ts +26 -16
- package/src/sd-jwt/types.ts +16 -2
- package/src/utils/error-codes.ts +0 -12
- package/src/utils/errors.ts +12 -86
- package/src/utils/jwk.ts +5 -0
- package/src/utils/par.ts +3 -10
- package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js +0 -27
- package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js.map +0 -1
- package/lib/commonjs/credential/presentation/03-get-request-object.js.map +0 -1
- package/lib/commonjs/credential/status/01-start-flow.js +0 -2
- package/lib/commonjs/credential/status/01-start-flow.js.map +0 -1
- package/lib/commonjs/credential/status/02-status-attestation.js +0 -72
- package/lib/commonjs/credential/status/02-status-attestation.js.map +0 -1
- package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js +0 -52
- package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js.map +0 -1
- package/lib/commonjs/credential/status/README.md +0 -67
- package/lib/commonjs/credential/status/index.js +0 -27
- package/lib/commonjs/credential/status/index.js.map +0 -1
- package/lib/commonjs/credential/status/types.js +0 -48
- package/lib/commonjs/credential/status/types.js.map +0 -1
- package/lib/commonjs/credential/trustmark/README.md +0 -62
- package/lib/commonjs/credential/trustmark/get-credential-trustmark.js +0 -81
- package/lib/commonjs/credential/trustmark/get-credential-trustmark.js.map +0 -1
- package/lib/commonjs/credential/trustmark/index.js +0 -13
- package/lib/commonjs/credential/trustmark/index.js.map +0 -1
- package/lib/commonjs/trust/chain.js.map +0 -1
- package/lib/commonjs/trust/index.js.map +0 -1
- package/lib/commonjs/trust/types.js.map +0 -1
- package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +0 -20
- package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +0 -1
- package/lib/module/credential/presentation/03-get-request-object.js.map +0 -1
- package/lib/module/credential/status/01-start-flow.js +0 -2
- package/lib/module/credential/status/01-start-flow.js.map +0 -1
- package/lib/module/credential/status/02-status-attestation.js +0 -64
- package/lib/module/credential/status/02-status-attestation.js.map +0 -1
- package/lib/module/credential/status/03-verify-and-parse-status-attestation.js +0 -46
- package/lib/module/credential/status/03-verify-and-parse-status-attestation.js.map +0 -1
- package/lib/module/credential/status/README.md +0 -67
- package/lib/module/credential/status/index.js +0 -5
- package/lib/module/credential/status/index.js.map +0 -1
- package/lib/module/credential/status/types.js +0 -40
- package/lib/module/credential/status/types.js.map +0 -1
- package/lib/module/credential/trustmark/README.md +0 -62
- package/lib/module/credential/trustmark/get-credential-trustmark.js +0 -72
- package/lib/module/credential/trustmark/get-credential-trustmark.js.map +0 -1
- package/lib/module/credential/trustmark/index.js +0 -3
- package/lib/module/credential/trustmark/index.js.map +0 -1
- package/lib/module/trust/chain.js.map +0 -1
- package/lib/module/trust/index.js.map +0 -1
- package/lib/module/trust/types.js.map +0 -1
- package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts +0 -19
- package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +0 -1
- package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +0 -1
- package/lib/typescript/credential/status/01-start-flow.d.ts +0 -10
- package/lib/typescript/credential/status/01-start-flow.d.ts.map +0 -1
- package/lib/typescript/credential/status/02-status-attestation.d.ts +0 -19
- package/lib/typescript/credential/status/02-status-attestation.d.ts.map +0 -1
- package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts +0 -24
- package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts.map +0 -1
- package/lib/typescript/credential/status/index.d.ts +0 -7
- package/lib/typescript/credential/status/index.d.ts.map +0 -1
- package/lib/typescript/credential/status/types.d.ts +0 -305
- package/lib/typescript/credential/status/types.d.ts.map +0 -1
- package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts +0 -52
- package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts.map +0 -1
- package/lib/typescript/credential/trustmark/index.d.ts +0 -4
- package/lib/typescript/credential/trustmark/index.d.ts.map +0 -1
- package/lib/typescript/trust/chain.d.ts.map +0 -1
- package/lib/typescript/trust/index.d.ts.map +0 -1
- package/src/credential/issuance/02-evaluate-issuer-trust.ts +0 -32
- package/src/credential/status/01-start-flow.ts +0 -9
- package/src/credential/status/02-status-attestation.ts +0 -102
- package/src/credential/status/03-verify-and-parse-status-attestation.ts +0 -60
- package/src/credential/status/README.md +0 -67
- package/src/credential/status/index.ts +0 -22
- package/src/credential/status/types.ts +0 -43
- package/src/credential/trustmark/README.md +0 -62
- package/src/credential/trustmark/get-credential-trustmark.ts +0 -120
- package/src/credential/trustmark/index.ts +0 -8
- /package/lib/typescript/{trust → entity/trust}/chain.d.ts +0 -0
@@ -115,55 +115,7 @@ export class WalletProviderResponseError extends UnexpectedStatusCodeError {
|
|
115
115
|
this.code = params.code ?? WalletProviderResponseErrorCodes.WalletProviderGenericError;
|
116
116
|
}
|
117
117
|
}
|
118
|
-
/**
|
119
|
-
* Function to extract the error message from the Entity Configuration's supported error codes.
|
120
|
-
* @param errorCode The error code to map to a meaningful message
|
121
|
-
* @param issuerConf The entity configuration for credentials
|
122
|
-
* @param credentialType The type of credential the error belongs to
|
123
|
-
* @returns A localized error {@link LocalizedIssuanceError} or undefined
|
124
|
-
* @throws {IoWalletError} When no credential config is found
|
125
|
-
*/
|
126
|
-
export function extractErrorMessageFromIssuerConf(errorCode, _ref5) {
|
127
|
-
let {
|
128
|
-
issuerConf,
|
129
|
-
credentialType
|
130
|
-
} = _ref5;
|
131
|
-
const credentialConfiguration = issuerConf.openid_credential_issuer.credential_configurations_supported[credentialType];
|
132
|
-
if (!credentialConfiguration) {
|
133
|
-
throw new IoWalletError(`No configuration found for ${credentialType} in the provided EC`);
|
134
|
-
}
|
135
|
-
const {
|
136
|
-
issuance_errors_supported
|
137
|
-
} = credentialConfiguration;
|
138
|
-
if (!(issuance_errors_supported !== null && issuance_errors_supported !== void 0 && issuance_errors_supported[errorCode])) {
|
139
|
-
return undefined;
|
140
|
-
}
|
141
|
-
const localesList = issuance_errors_supported[errorCode].display;
|
142
|
-
return localesList.reduce((acc, _ref6) => {
|
143
|
-
let {
|
144
|
-
locale,
|
145
|
-
...rest
|
146
|
-
} = _ref6;
|
147
|
-
return {
|
148
|
-
...acc,
|
149
|
-
[locale]: rest
|
150
|
-
};
|
151
|
-
}, {});
|
152
|
-
}
|
153
118
|
|
154
|
-
/**
|
155
|
-
* Type guard for issuer errors.
|
156
|
-
* @param error The error to check
|
157
|
-
* @param code Optional code to narrow down the issuer error
|
158
|
-
*/
|
159
|
-
export const isIssuerResponseError = (error, code) => error instanceof IssuerResponseError && error.code === (code ?? error.code);
|
160
|
-
|
161
|
-
/**
|
162
|
-
* Type guard for wallet provider errors.
|
163
|
-
* @param error The error to check
|
164
|
-
* @param code Optional code to narrow down the wallet provider error
|
165
|
-
*/
|
166
|
-
export const isWalletProviderResponseError = (error, code) => error instanceof WalletProviderResponseError && error.code === (code ?? error.code);
|
167
119
|
/**
|
168
120
|
* Builder class used to create specialized errors from type {@link UnexpectedStatusCodeError} that handles multiple status codes.
|
169
121
|
*
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["IssuerResponseErrorCodes","WalletProviderResponseErrorCodes","serializeAttrs","attrs","Object","entries","filter","_ref","v","undefined","map","_ref2","k","Array","isArray","join","JSON","stringify","_","IoWalletError","Error","code","constructor","message","name","ValidationFailed","_ref3","claim","reason","UnexpectedStatusCodeError","_ref4","statusCode","IssuerResponseError","params","IssuerGenericError","WalletProviderResponseError","WalletProviderGenericError","
|
1
|
+
{"version":3,"names":["IssuerResponseErrorCodes","WalletProviderResponseErrorCodes","serializeAttrs","attrs","Object","entries","filter","_ref","v","undefined","map","_ref2","k","Array","isArray","join","JSON","stringify","_","IoWalletError","Error","code","constructor","message","name","ValidationFailed","_ref3","claim","reason","UnexpectedStatusCodeError","_ref4","statusCode","IssuerResponseError","params","IssuerGenericError","WalletProviderResponseError","WalletProviderGenericError","ResponseErrorBuilder","errorCases","ErrorClass","handle","status","buildFrom","originalError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AACA,SACEA,wBAAwB,EACxBC,gCAAgC,QAG3B,eAAe;AAEtB,SAASD,wBAAwB,EAAEC,gCAAgC;;AAEnE;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GACzBC,KAA8E,IAE9EC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,MAAM,CAACC,IAAA;EAAA,IAAC,GAAGC,CAAC,CAAC,GAAAD,IAAA;EAAA,OAAKC,CAAC,KAAKC,SAAS;AAAA,EAAC,CAClCC,GAAG,CAACC,KAAA,IAAY;EAAA,IAAX,CAACC,CAAC,EAAEJ,CAAC,CAAC,GAAAG,KAAA;EACV,IAAIE,KAAK,CAACC,OAAO,CAACN,CAAC,CAAC,EAAE,OAAO,CAACI,CAAC,EAAG,IAAGJ,CAAC,CAACO,IAAI,CAAC,IAAI,CAAE,GAAE,CAAC;EACrD,IAAI,OAAOP,CAAC,KAAK,QAAQ,EAAE,OAAO,CAACI,CAAC,EAAEI,IAAI,CAACC,SAAS,CAACT,CAAC,CAAC,CAAC;EACxD,OAAO,CAACI,CAAC,EAAEJ,CAAC,CAAC;AACf,CAAC,CAAC,CACDE,GAAG,CAAEQ,CAAC,IAAK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IACD,KAAK,CAACA,MAAM,CAAC;IACb,IAAI,CAACZ,IAAI,GAAGY,MAAM,CAACZ,IAAI,IAAIrB,wBAAwB,CAACkC,kBAAkB;EACxE;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMC,2BAA2B,SAASN,yBAAyB,CAAC;EAIzEP,WAAWA,CAACW,MAKX,EAAE;IACD,KAAK,CAACA,MAAM,CAAC;IACb,IAAI,CAACL,MAAM,GAAGK,MAAM,CAACL,MAAM;IAC3B,IAAI,CAACP,IAAI,GACPY,MAAM,CAACZ,IAAI,IACXpB,gCAAgC,CAACmC,0BAA0B;EAC/D;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,CAA6C;EACpEC,UAAU,GAEd,CAAC,CAAC;EAENhB,WAAWA,CAASiB,UAAa,EAAE;IAAA,KAAfA,UAAa,GAAbA,UAAa;EAAG;EAEpCC,MAAMA,CAACC,MAAoB,EAAER,MAAoB,EAAE;IACjD,IAAI,CAACK,UAAU,CAACG,MAAM,CAAC,GAAGR,MAAM;IAChC,OAAO,IAAI;EACb;EAEAS,SAASA,CAACC,aAAwC,EAAE;IAClD,MAAMV,MAAM,GACV,IAAI,CAACK,UAAU,CAACK,aAAa,CAACZ,UAAU,CAAC,IAAI,IAAI,CAACO,UAAU,CAAC,GAAG,CAAC;IAEnE,IAAIL,MAAM,EAAE;MACV,OAAO,IAAI,IAAI,CAACM,UAAU,CAAC;QAAE,GAAGI,aAAa;QAAE,GAAGV;MAAO,CAAC,CAAC;IAC7D;IAEA,OAAOU,aAAa;EACtB;AACF"}
|
package/lib/module/utils/jwk.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["removePadding","z","JWK","object","alg","string","optional","crv","d","dp","dq","e","ext","boolean","k","key_ops","array","kid","kty","union","literal","n","p","q","qi","use","x","y","x5c","x5t","x5u","fixBase64EncodingOnKey","key","pk"],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,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,IAAIhB,CAAC,GAAG;MAAEA,CAAC,EAAEX,aAAa,CAACW,CAAC;IAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,IAAIU,CAAC,GAAG;MAAEA,CAAC,EAAErB,aAAa,CAACqB,CAAC;IAAE,CAAC,GAAG,CAAC,CAAC;EACtC,CAAC;AACH"}
|
1
|
+
{"version":3,"names":["removePadding","z","JWK","object","alg","string","optional","crv","d","dp","dq","e","ext","boolean","k","key_ops","array","kid","kty","union","literal","n","p","q","qi","use","x","y","x5c","x5t","x5u","fixBase64EncodingOnKey","key","pk","JWKS","keys"],"sourceRoot":"../../../src","sources":["utils/jwk.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,6BAA6B;AAC3D,SAASC,CAAC,QAAQ,KAAK;AAGvB,OAAO,MAAMC,GAAG,GAAGD,CAAC,CAACE,MAAM,CAAC;EAC1B;EACAC,GAAG,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC1BC,GAAG,EAAEN,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC1BE,CAAC,EAAEP,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EACxBG,EAAE,EAAER,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EACzBI,EAAE,EAAET,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EACzBK,CAAC,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EACxB;EACAM,GAAG,EAAEX,CAAC,CAACY,OAAO,CAAC,CAAC,CAACP,QAAQ,CAAC,CAAC;EAC3BQ,CAAC,EAAEb,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EACxB;EACAS,OAAO,EAAEd,CAAC,CAACe,K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AC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASyB,sBAAsBA,CAACC,GAAQ,EAAO;EACpD,MAAM;IAAEN,CAAC;IAAEC,CAAC;IAAEhB,CAAC;IAAEU,CAAC;IAAE,GAAGY;EAAG,CAAC,GAAGD,GAAG;EAEjC,OAAO;IACL,GAAGC,EAAE;IACL,IAAIP,CAAC,GAAG;MAAEA,CAAC,EAAE1B,aAAa,CAAC0B,CAAC;IAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,IAAIC,CAAC,GAAG;MAAEA,CAAC,EAAE3B,aAAa,CAAC2B,CAAC;IAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,IAAIhB,CAAC,GAAG;MAAEA,CAAC,EAAEX,aAAa,CAACW,CAAC;IAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,IAAIU,CAAC,GAAG;MAAEA,CAAC,EAAErB,aAAa,CAACqB,CAAC;IAAE,CAAC,GAAG,CAAC,CAAC;EACtC,CAAC;AACH;AAGA,OAAO,MAAMa,IAAI,GAAGjC,CAAC,CAACE,MAAM,CAAC;EAC3BgC,IAAI,EAAElC,CAAC,CAACe,KAAK,CAACd,GAAG;AACnB,CAAC,CAAC"}
|
package/lib/module/utils/par.js
CHANGED
@@ -7,7 +7,6 @@ import { createPopToken } from "./pop";
|
|
7
7
|
import { IssuerResponseError } from "./errors";
|
8
8
|
export const AuthorizationDetail = z.object({
|
9
9
|
credential_configuration_id: z.string(),
|
10
|
-
format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
|
11
10
|
type: z.literal("openid_credential")
|
12
11
|
});
|
13
12
|
export const AuthorizationDetails = z.array(AuthorizationDetail);
|
@@ -20,7 +19,7 @@ export const makeParRequest = _ref => {
|
|
20
19
|
wiaCryptoContext,
|
21
20
|
appFetch
|
22
21
|
} = _ref;
|
23
|
-
return async (clientId, codeVerifier, redirectUri, responseMode, parEndpoint, walletInstanceAttestation, authorizationDetails
|
22
|
+
return async (clientId, codeVerifier, redirectUri, responseMode, parEndpoint, walletInstanceAttestation, authorizationDetails) => {
|
24
23
|
const wiaPublicKey = await wiaCryptoContext.getPublicKey();
|
25
24
|
const parUrl = new URL(parEndpoint);
|
26
25
|
const aud = `${parUrl.protocol}//${parUrl.hostname}`;
|
@@ -55,26 +54,21 @@ export const makeParRequest = _ref => {
|
|
55
54
|
code_challenge: codeChallenge,
|
56
55
|
code_challenge_method: codeChallengeMethod,
|
57
56
|
authorization_details: authorizationDetails,
|
58
|
-
redirect_uri: redirectUri
|
59
|
-
client_assertion_type: assertionType,
|
60
|
-
client_assertion: walletInstanceAttestation + "~" + signedWiaPoP
|
57
|
+
redirect_uri: redirectUri
|
61
58
|
}).setIssuedAt() //iat is set to now
|
62
59
|
.setExpirationTime("5min").sign();
|
63
60
|
|
64
61
|
/** The request body for the Pushed Authorization Request */
|
65
62
|
var formBody = new URLSearchParams({
|
66
|
-
response_type: "code",
|
67
63
|
client_id: clientId,
|
68
|
-
|
69
|
-
code_challenge_method: "S256",
|
70
|
-
request: signedJwtForPar,
|
71
|
-
client_assertion_type: assertionType,
|
72
|
-
client_assertion: walletInstanceAttestation + "~" + signedWiaPoP
|
64
|
+
request: signedJwtForPar
|
73
65
|
});
|
74
66
|
return await appFetch(parEndpoint, {
|
75
67
|
method: "POST",
|
76
68
|
headers: {
|
77
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
69
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
70
|
+
"OAuth-Client-Attestation": walletInstanceAttestation,
|
71
|
+
"OAuth-Client-Attestation-PoP": signedWiaPoP
|
78
72
|
},
|
79
73
|
body: formBody.toString()
|
80
74
|
}).then(hasStatusOrThrow(201, IssuerResponseError)).then(res => res.json()).then(result => result.request_uri);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["sha256ToBase64","SignJWT","uuid","z","WalletInstanceAttestation","generateRandomAlphaNumericString","hasStatusOrThrow","createPopToken","IssuerResponseError","AuthorizationDetail","object","credential_configuration_id","string","
|
1
|
+
{"version":3,"names":["sha256ToBase64","SignJWT","uuid","z","WalletInstanceAttestation","generateRandomAlphaNumericString","hasStatusOrThrow","createPopToken","IssuerResponseError","AuthorizationDetail","object","credential_configuration_id","string","type","literal","AuthorizationDetails","array","makeParRequest","_ref","wiaCryptoContext","appFetch","clientId","codeVerifier","redirectUri","responseMode","parEndpoint","walletInstanceAttestation","authorizationDetails","wiaPublicKey","getPublicKey","parUrl","URL","aud","protocol","hostname","iss","decode","payload","cnf","jwk","kid","signedWiaPoP","jti","v4","codeChallengeMethod","codeChallenge","signedJwtForPar","setProtectedHeader","typ","setPayload","response_type","response_mode","client_id","state","code_challenge","code_challenge_method","authorization_details","redirect_uri","setIssuedAt","setExpirationTime","sign","formBody","URLSearchParams","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,gCAAgC,EAAEC,gBAAgB,QAAQ,QAAQ;AAC3E,SAASC,cAAc,QAAQ,OAAO;AACtC,SAASC,mBAAmB,QAAQ,UAAU;AAG9C,OAAO,MAAMC,mBAAmB,GAAGN,CAAC,CAACO,MAAM,CAAC;EAC1CC,2BAA2B,EAAER,CAAC,CAACS,MAAM,CAAC,CAAC;EACvCC,IAAI,EAAEV,CAAC,CAACW,OAAO,CAAC,mBAAmB;AACrC,CAAC,CAAC;AAGF,OAAO,MAAMC,oBAAoB,GAAGZ,CAAC,CAACa,KAAK,CAACP,mBAAmB,CAAC;;AAEhE;AACA;AACA;AACA,OAAO,MAAMQ,cAAc,GACzBC,IAAA;EAAA,IAAC;IACCC,gBAAgB;IAChBC;EAIF,CAAC,GAAAF,I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oBAAoB;MAC3C8B,YAAY,EAAElC;IAChB,CAAC,CAAC,CACDmC,WAAW,CAAC,CAAC,CAAC;IAAA,CACdC,iBAAiB,CAAC,MAAM,CAAC,CACzBC,IAAI,CAAC,CAAC;;IAET;IACA,IAAIC,QAAQ,GAAG,IAAIC,eAAe,CAAC;MACjCV,SAAS,EAAE/B,QAAQ;MACnB0C,OAAO,EAAEjB;IACX,CAAC,CAAC;IAEF,OAAO,MAAM1B,QAAQ,CAACK,WAAW,EAAE;MACjCuC,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE,mCAAmC;QACnD,0BAA0B,EAAEvC,yBAAyB;QACrD,8BAA8B,EAAEe;MAClC,CAAC;MACDyB,IAAI,EAAEL,QAAQ,CAACM,QAAQ,CAAC;IAC1B,CAAC,CAAC,CACCC,IAAI,CAAC9D,gBAAgB,CAAC,GAAG,EAAEE,mBAAmB,CAAC,CAAC,CAChD4D,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBF,IAAI,CAAEG,MAAM,IAAKA,MAAM,CAACC,WAAW,CAAC;EACzC,CAAC;AAAA"}
|
@@ -1,6 +1,4 @@
|
|
1
1
|
import * as Issuance from "./issuance";
|
2
2
|
import * as Presentation from "./presentation";
|
3
|
-
|
4
|
-
import * as Trustmark from "./trustmark";
|
5
|
-
export { Issuance, Presentation, Status, Trustmark };
|
3
|
+
export { Issuance, Presentation };
|
6
4
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/credential/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/credential/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* WARNING: This is the first function to be called in the issuing flow. The next function to be called is {@link
|
2
|
+
* WARNING: This is the first function to be called in the issuing flow. The next function to be called is {@link getIssuerConfig}.
|
3
3
|
* The beginning of the issuing flow.
|
4
4
|
* To be implemented accordind to the user touchpoint
|
5
5
|
*
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import type { StartFlow } from "./01-start-flow";
|
2
|
+
import type { Out } from "../../utils/misc";
|
3
|
+
import type { JWK } from "src/utils/jwk";
|
4
|
+
import type { CredentialConfigurationSupported } from "../../entity/openid-connect/issuer/types";
|
5
|
+
export type GetIssuerConfig = (issuerUrl: Out<StartFlow>["issuerUrl"], context?: {
|
6
|
+
appFetch?: GlobalFetch["fetch"];
|
7
|
+
}) => Promise<{
|
8
|
+
issuerConf: IssuerConfig;
|
9
|
+
}>;
|
10
|
+
/**
|
11
|
+
* Common configuration for the issuer.
|
12
|
+
* This is needed to have a common configuration for the issuer to be used in our flows.
|
13
|
+
* It allows to support multiple issuers with different configurations, defining a common interface to interact with them.
|
14
|
+
*/
|
15
|
+
export type IssuerConfig = {
|
16
|
+
credential_configurations_supported: CredentialConfigurationSupported;
|
17
|
+
pushed_authorization_request_endpoint: string;
|
18
|
+
authorization_endpoint: string;
|
19
|
+
token_endpoint: string;
|
20
|
+
credential_endpoint: string;
|
21
|
+
keys: Array<JWK>;
|
22
|
+
};
|
23
|
+
/**
|
24
|
+
* WARNING: This function must be called after {@link startFlow}. The next function to be called is {@link startUserAuthorization}.
|
25
|
+
* Get the Issuer's configuration from the Issuer's metadata.
|
26
|
+
* Currently it only supports a mixed configuration based on OpenID Connect partial implementation.
|
27
|
+
* @param issuerUrl The base url of the Issuer returned by {@link startFlow}
|
28
|
+
* @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
|
29
|
+
* @returns The Issuer's configuration
|
30
|
+
*/
|
31
|
+
export declare const getIssuerConfig: GetIssuerConfig;
|
32
|
+
//# sourceMappingURL=02-get-issuer-config.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"02-get-issuer-config.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/02-get-issuer-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AAEjG,MAAM,MAAM,eAAe,GAAG,CAC5B,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,EACtC,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC;IAAE,UAAU,EAAE,YAAY,CAAA;CAAE,CAAC,CAAC;AAE3C;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,mCAAmC,EAAE,gCAAgC,CAAC;IACtE,qCAAqC,EAAE,MAAM,CAAC;IAC9C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CAClB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,eAS7B,CAAC"}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { CryptoContext } from "@pagopa/io-react-native-jwt";
|
2
2
|
import { type Out } from "../../utils/misc";
|
3
|
-
import type { EvaluateIssuerTrust } from "./02-evaluate-issuer-trust";
|
4
3
|
import type { StartFlow } from "./01-start-flow";
|
5
4
|
import { AuthorizationDetail } from "../../utils/par";
|
6
|
-
|
5
|
+
import type { GetIssuerConfig } from "./02-get-issuer-config";
|
6
|
+
export type StartUserAuthorization = (issuerConf: Out<GetIssuerConfig>["issuerConf"], credentialType: Out<StartFlow>["credentialType"], context: {
|
7
7
|
wiaCryptoContext: CryptoContext;
|
8
8
|
walletInstanceAttestation: string;
|
9
9
|
redirectUri: string;
|
@@ -15,7 +15,7 @@ export type StartUserAuthorization = (issuerConf: Out<EvaluateIssuerTrust>["issu
|
|
15
15
|
credentialDefinition: AuthorizationDetail;
|
16
16
|
}>;
|
17
17
|
/**
|
18
|
-
* WARNING: This function must be called after {@link
|
18
|
+
* WARNING: This function must be called after {@link getIssuerConfig} and {@link startFlow}. The next steam is {@link compeUserAuthorizationWithQueryMode} or {@link compeUserAuthorizationWithFormPostJwtMode}
|
19
19
|
* Creates and sends a PAR request to the /as/par endpoint of the authorization server.
|
20
20
|
* This starts the authentication flow to obtain an access token.
|
21
21
|
* This token enables the Wallet Instance to request a digital credential from the Credential Endpoint of the Credential Issuer.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"03-start-user-authorization.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/03-start-user-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAoC,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"03-start-user-authorization.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/03-start-user-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAoC,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAkB,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG,CACnC,UAAU,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,EAC9C,cAAc,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,EAChD,OAAO,EAAE;IACP,gBAAgB,EAAE,aAAa,CAAC;IAChC,yBAAyB,EAAE,MAAM,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,mBAAmB,CAAC;CAC3C,CAAC,CAAC;AAoDH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,sBAAsB,EAAE,sBAiCpC,CAAC"}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { type AuthorizationResult } from "../../utils/auth";
|
2
2
|
import { type Out } from "../../utils/misc";
|
3
3
|
import type { StartUserAuthorization } from "./03-start-user-authorization";
|
4
|
-
import type {
|
4
|
+
import type { GetIssuerConfig } from "./02-get-issuer-config";
|
5
5
|
import { type CryptoContext } from "@pagopa/io-react-native-jwt";
|
6
6
|
import { RequestObject } from "../presentation/types";
|
7
7
|
/**
|
8
|
-
* The interface of the phase to complete User authorization via strong identification when the response mode is "query" and the request credential is a
|
8
|
+
* The interface of the phase to complete User authorization via strong identification when the response mode is "query" and the request credential is a urn:eu.europa.ec.eudi:pid:1.
|
9
9
|
*/
|
10
10
|
export type CompleteUserAuthorizationWithQueryMode = (authRedirectUrl: string) => Promise<AuthorizationResult>;
|
11
11
|
export type CompleteUserAuthorizationWithFormPostJwtMode = (requestObject: Out<GetRequestedCredentialToBePresented>, context: {
|
@@ -15,8 +15,8 @@ export type CompleteUserAuthorizationWithFormPostJwtMode = (requestObject: Out<G
|
|
15
15
|
walletInstanceAttestation: string;
|
16
16
|
appFetch?: GlobalFetch["fetch"];
|
17
17
|
}) => Promise<AuthorizationResult>;
|
18
|
-
export type GetRequestedCredentialToBePresented = (issuerRequestUri: Out<StartUserAuthorization>["issuerRequestUri"], clientId: Out<StartUserAuthorization>["clientId"], issuerConf: Out<
|
19
|
-
export type BuildAuthorizationUrl = (issuerRequestUri: Out<StartUserAuthorization>["issuerRequestUri"], clientId: Out<StartUserAuthorization>["clientId"], issuerConf: Out<
|
18
|
+
export type GetRequestedCredentialToBePresented = (issuerRequestUri: Out<StartUserAuthorization>["issuerRequestUri"], clientId: Out<StartUserAuthorization>["clientId"], issuerConf: Out<GetIssuerConfig>["issuerConf"], appFetch?: GlobalFetch["fetch"]) => Promise<RequestObject>;
|
19
|
+
export type BuildAuthorizationUrl = (issuerRequestUri: Out<StartUserAuthorization>["issuerRequestUri"], clientId: Out<StartUserAuthorization>["clientId"], issuerConf: Out<GetIssuerConfig>["issuerConf"], idpHint: string) => Promise<{
|
20
20
|
authUrl: string;
|
21
21
|
}>;
|
22
22
|
/**
|
@@ -24,14 +24,14 @@ export type BuildAuthorizationUrl = (issuerRequestUri: Out<StartUserAuthorizatio
|
|
24
24
|
* Builds the authorization URL to which the end user should be redirected to continue the authentication flow.
|
25
25
|
* @param issuerRequestUri the URI of the issuer where the request is sent
|
26
26
|
* @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
|
27
|
-
* @param issuerConf The issuer configuration returned by {@link
|
27
|
+
* @param issuerConf The issuer configuration returned by {@link getIssuerConfig}
|
28
28
|
* @param idpHint Unique identifier of the IDP selected by the user
|
29
29
|
* @returns An object containing the authorization URL
|
30
30
|
*/
|
31
31
|
export declare const buildAuthorizationUrl: BuildAuthorizationUrl;
|
32
32
|
/**
|
33
33
|
* WARNING: This function must be called after obtaining the authorization redirect URL from the webviews (SPID and CIE L3) or browser for CIEID.
|
34
|
-
* Complete User authorization via strong identification when the response mode is "query" and the request credential is a
|
34
|
+
* Complete User authorization via strong identification when the response mode is "query" and the request credential is a urn:eu.europa.ec.eudi:pid:1.
|
35
35
|
* This function parses the authorization redirect URL to extract the authorization response.
|
36
36
|
* @param authRedirectUrl The URL to which the end user should be redirected to start the authentication flow
|
37
37
|
* @returns the authorization response which contains code, state and iss
|
@@ -44,7 +44,7 @@ export declare const completeUserAuthorizationWithQueryMode: CompleteUserAuthori
|
|
44
44
|
* The information is obtained by performing a GET request to the authorization endpoint with request_uri and client_id parameters.
|
45
45
|
* @param issuerRequestUri the URI of the issuer where the request is sent
|
46
46
|
* @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
|
47
|
-
* @param issuerConf The issuer configuration returned by {@link
|
47
|
+
* @param issuerConf The issuer configuration returned by {@link getIssuerConfig}
|
48
48
|
* @param appFetch (optional) fetch api implementation. Default: built-in fetch
|
49
49
|
* @throws {ValidationFailed} if an error while validating the response
|
50
50
|
* @returns the request object which contains the credential to be presented in order to obtain the requested credential
|
@@ -57,7 +57,7 @@ export declare const getRequestedCredentialToBePresented: GetRequestedCredential
|
|
57
57
|
* The information is obtained by performing a GET request to the authorization endpoint with request_uri and client_id parameters.
|
58
58
|
* @param issuerRequestUri the URI of the issuer where the request is sent
|
59
59
|
* @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
|
60
|
-
* @param issuerConf The issuer configuration returned by {@link
|
60
|
+
* @param issuerConf The issuer configuration returned by {@link getIssuerConfig}
|
61
61
|
* @param context.walletInstanceAccestation the Wallet Instance's attestation to be presented
|
62
62
|
* @param context.pid the PID to be presented
|
63
63
|
* @param context.wiaCryptoContext The Wallet Instance's crypto context associated with the walletInstanceAttestation parameter
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"04-complete-user-authorization.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/04-complete-user-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAoB,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAG5E,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"04-complete-user-authorization.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/04-complete-user-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAoB,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAG5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAMtD;;GAEG;AACH,MAAM,MAAM,sCAAsC,GAAG,CACnD,eAAe,EAAE,MAAM,KACpB,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAElC,MAAM,MAAM,4CAA4C,GAAG,CACzD,aAAa,EAAE,GAAG,CAAC,mCAAmC,CAAC,EACvD,OAAO,EAAE;IACP,gBAAgB,EAAE,aAAa,CAAC;IAChC,gBAAgB,EAAE,aAAa,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,yBAAyB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAElC,MAAM,MAAM,mCAAmC,GAAG,CAChD,gBAAgB,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,kBAAkB,CAAC,EACjE,QAAQ,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,UAAU,CAAC,EACjD,UAAU,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,EAC9C,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,KAC5B,OAAO,CAAC,aAAa,CAAC,CAAC;AAE5B,MAAM,MAAM,qBAAqB,GAAG,CAClC,gBAAgB,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,kBAAkB,CAAC,EACjE,QAAQ,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,UAAU,CAAC,EACjD,UAAU,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,EAC9C,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,qBAiBnC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,sCAAsC,EAAE,sCAKlD,CAAC;AAEJ;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mCAAmC,EAAE,mCAwB/C,CAAC;AAEJ;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4CAA4C,EAAE,4CAuGxD,CAAC;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,YAC5B,OAAO,KACf,mBAaF,CAAC"}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { type Out } from "../../utils/misc";
|
2
|
-
import type {
|
2
|
+
import type { GetIssuerConfig } from "./02-get-issuer-config";
|
3
3
|
import type { StartUserAuthorization } from "./03-start-user-authorization";
|
4
4
|
import type { CryptoContext } from "@pagopa/io-react-native-jwt";
|
5
5
|
import { TokenResponse } from "./types";
|
6
6
|
import type { CompleteUserAuthorizationWithQueryMode } from "./04-complete-user-authorization";
|
7
|
-
export type AuthorizeAccess = (issuerConf: Out<
|
7
|
+
export type AuthorizeAccess = (issuerConf: Out<GetIssuerConfig>["issuerConf"], code: Out<CompleteUserAuthorizationWithQueryMode>["code"], redirectUri: string, clientId: Out<StartUserAuthorization>["clientId"], codeVerifier: Out<StartUserAuthorization>["codeVerifier"], context: {
|
8
8
|
walletInstanceAttestation: string;
|
9
9
|
appFetch?: GlobalFetch["fetch"];
|
10
10
|
wiaCryptoContext: CryptoContext;
|
@@ -17,7 +17,7 @@ export type AuthorizeAccess = (issuerConf: Out<EvaluateIssuerTrust>["issuerConf"
|
|
17
17
|
* for requesting the issuance of an access token bound to the public key of the Wallet Instance contained within the DPoP.
|
18
18
|
* This enables the Wallet Instance to request a digital credential.
|
19
19
|
* The DPoP Proof JWT is generated according to the section 4.3 of the DPoP RFC 9449 specification.
|
20
|
-
* @param issuerConf The issuer configuration returned by {@link
|
20
|
+
* @param issuerConf The issuer configuration returned by {@link getIssuerConfig}
|
21
21
|
* @param code The authorization code returned by {@link completeUserAuthorizationWithQueryMode} or {@link completeUserAuthorizationWithFormPost}
|
22
22
|
* @param redirectUri The redirect URI which is the custom URL scheme that the Wallet Instance is registered to handle
|
23
23
|
* @param clientId The client id returned by {@link startUserAuthorization}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"05-authorize-access.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/05-authorize-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"05-authorize-access.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/05-authorize-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAK5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,kCAAkC,CAAC;AAE/F,MAAM,MAAM,eAAe,GAAG,CAC5B,UAAU,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,EAC9C,IAAI,EAAE,GAAG,CAAC,sCAAsC,CAAC,CAAC,MAAM,CAAC,EACzD,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,UAAU,CAAC,EACjD,YAAY,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,cAAc,CAAC,EACzD,OAAO,EAAE;IACP,yBAAyB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAChC,gBAAgB,EAAE,aAAa,CAAC;IAChC,iBAAiB,EAAE,aAAa,CAAC;CAClC,KACE,OAAO,CAAC;IAAE,WAAW,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC;AAE7C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,EAAE,eAwE7B,CAAC"}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { type CryptoContext } from "@pagopa/io-react-native-jwt";
|
2
2
|
import type { AuthorizeAccess } from "./05-authorize-access";
|
3
|
-
import type {
|
3
|
+
import type { GetIssuerConfig } from "./02-get-issuer-config";
|
4
4
|
import { type Out } from "../../utils/misc";
|
5
5
|
import type { StartUserAuthorization } from "./03-start-user-authorization";
|
6
6
|
import { CredentialResponse } from "./types";
|
7
|
-
export type ObtainCredential = (issuerConf: Out<
|
7
|
+
export type ObtainCredential = (issuerConf: Out<GetIssuerConfig>["issuerConf"], accessToken: Out<AuthorizeAccess>["accessToken"], clientId: Out<StartUserAuthorization>["clientId"], credentialDefinition: Out<StartUserAuthorization>["credentialDefinition"], context: {
|
8
8
|
dPopCryptoContext: CryptoContext;
|
9
9
|
credentialCryptoContext: CryptoContext;
|
10
10
|
appFetch?: GlobalFetch["fetch"];
|
@@ -16,7 +16,7 @@ export declare const createNonceProof: (nonce: string, issuer: string, audience:
|
|
16
16
|
* of the Credential Issuer to request the issuance of a credential linked to the public key contained in the JWT proof.
|
17
17
|
* The Openid4vci proof JWT incapsulates the nonce extracted from the token response from the {@link authorizeAccess} step.
|
18
18
|
* The credential request is sent to the Credential Endpoint of the Credential Issuer via HTTP POST with the type of the credential, its format, the access token and the JWT proof.
|
19
|
-
* @param issuerConf The issuer configuration returned by {@link
|
19
|
+
* @param issuerConf The issuer configuration returned by {@link getIssuerConfig}
|
20
20
|
* @param accessToken The access token response returned by {@link authorizeAccess}
|
21
21
|
* @param clientId The client id returned by {@link startUserAuthorization}
|
22
22
|
* @param credentialDefinition The credential definition of the credential to be obtained returned by {@link startUserAuthorization}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"06-obtain-credential.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/06-obtain-credential.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"06-obtain-credential.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/06-obtain-credential.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAoB,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAQ5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAI7C,MAAM,MAAM,gBAAgB,GAAG,CAC7B,UAAU,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,EAC9C,WAAW,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,EAChD,QAAQ,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,UAAU,CAAC,EACjD,oBAAoB,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,EACzE,OAAO,EAAE;IACP,iBAAiB,EAAE,aAAa,CAAC;IACjC,uBAAuB,EAAE,aAAa,CAAC;IACvC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEjC,eAAO,MAAM,gBAAgB,UACpB,MAAM,UACL,MAAM,YACJ,MAAM,OACX,aAAa,KACjB,QAAQ,MAAM,CAehB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAoG9B,CAAC"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { CryptoContext } from "@pagopa/io-react-native-jwt";
|
2
2
|
import type { Out } from "../../utils/misc";
|
3
|
-
import type {
|
3
|
+
import type { GetIssuerConfig } from "./02-get-issuer-config";
|
4
4
|
import type { ObtainCredential } from "./06-obtain-credential";
|
5
|
-
export type VerifyAndParseCredential = (issuerConf: Out<
|
5
|
+
export type VerifyAndParseCredential = (issuerConf: Out<GetIssuerConfig>["issuerConf"], credential: Out<ObtainCredential>["credential"], format: Out<ObtainCredential>["format"], context: {
|
6
6
|
credentialCryptoContext: CryptoContext;
|
7
7
|
/**
|
8
8
|
* Do not throw an error when an attribute is not found within disclosures.
|
@@ -27,7 +27,7 @@ string, {
|
|
27
27
|
}>;
|
28
28
|
/**
|
29
29
|
* Verify and parse an encoded credential.
|
30
|
-
* @param issuerConf The Issuer configuration returned by {@link
|
30
|
+
* @param issuerConf The Issuer configuration returned by {@link getIssuerConfig}
|
31
31
|
* @param credential The encoded credential returned by {@link obtainCredential}
|
32
32
|
* @param format The format of the credentual returned by {@link obtainCredential}
|
33
33
|
* @param context.credentialCryptoContext The crypto context used to obtain the credential in {@link obtainCredential}
|
@@ -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,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,
|
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,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAM9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,MAAM,wBAAwB,GAAG,CACrC,UAAU,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,EAC9C,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;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;OAEG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC,KACE,OAAO,CAAC;IACX,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;CAC5B,CAAC,CAAC;AAGH,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,GACnC,SAAS,CAAC;IACd,wCAAwC;IACxC,KAAK,EAAE,OAAO,CAAC;CAChB,CACF,CAAC;AAkLF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB,EAAE,wBAgBtC,CAAC"}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { type StartFlow } from "./01-start-flow";
|
2
|
-
import {
|
2
|
+
import { getIssuerConfig, type GetIssuerConfig } from "./02-get-issuer-config";
|
3
3
|
import { startUserAuthorization, type StartUserAuthorization } from "./03-start-user-authorization";
|
4
4
|
import { completeUserAuthorizationWithQueryMode, completeUserAuthorizationWithFormPostJwtMode, parseAuthorizationResponse, buildAuthorizationUrl, type CompleteUserAuthorizationWithQueryMode, type CompleteUserAuthorizationWithFormPostJwtMode, type GetRequestedCredentialToBePresented, type BuildAuthorizationUrl, getRequestedCredentialToBePresented } from "./04-complete-user-authorization";
|
5
5
|
import { authorizeAccess, type AuthorizeAccess } from "./05-authorize-access";
|
6
6
|
import { obtainCredential, type ObtainCredential } from "./06-obtain-credential";
|
7
7
|
import { verifyAndParseCredential, type VerifyAndParseCredential } from "./07-verify-and-parse-credential";
|
8
8
|
import * as Errors from "./errors";
|
9
|
-
export {
|
10
|
-
export type { StartFlow,
|
9
|
+
export { getIssuerConfig, startUserAuthorization, buildAuthorizationUrl, completeUserAuthorizationWithQueryMode, getRequestedCredentialToBePresented, completeUserAuthorizationWithFormPostJwtMode, authorizeAccess, obtainCredential, verifyAndParseCredential, parseAuthorizationResponse, Errors, };
|
10
|
+
export type { StartFlow, GetIssuerConfig, StartUserAuthorization, BuildAuthorizationUrl, CompleteUserAuthorizationWithQueryMode, GetRequestedCredentialToBePresented, CompleteUserAuthorizationWithFormPostJwtMode, AuthorizeAccess, ObtainCredential, VerifyAndParseCredential, };
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,sCAAsC,EACtC,4CAA4C,EAC5C,0BAA0B,EAC1B,qBAAqB,EACrB,KAAK,sCAAsC,EAC3C,KAAK,4CAA4C,EACjD,KAAK,mCAAmC,EACxC,KAAK,qBAAqB,EAC1B,mCAAmC,EACpC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,EAC9B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,sCAAsC,EACtC,mCAAmC,EACnC,4CAA4C,EAC5C,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,MAAM,GACP,CAAC;AACF,YAAY,EACV,SAAS,EACT,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,sCAAsC,EACtC,mCAAmC,EACnC,4CAA4C,EAC5C,eAAe,EACf,gBAAgB,EAChB,wBAAwB,GACzB,CAAC"}
|
@@ -2,19 +2,16 @@ import * as z from "zod";
|
|
2
2
|
export type TokenResponse = z.infer<typeof TokenResponse>;
|
3
3
|
export declare const TokenResponse: z.ZodObject<{
|
4
4
|
access_token: z.ZodString;
|
5
|
-
authorization_details: z.
|
5
|
+
authorization_details: z.ZodObject<{
|
6
6
|
credential_configuration_id: z.ZodString;
|
7
|
-
format: z.ZodUnion<[z.ZodLiteral<"vc+sd-jwt">, z.ZodLiteral<"vc+mdoc-cbor">]>;
|
8
7
|
type: z.ZodLiteral<"openid_credential">;
|
9
8
|
}, "strip", z.ZodTypeAny, {
|
10
9
|
type: "openid_credential";
|
11
|
-
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
12
10
|
credential_configuration_id: string;
|
13
11
|
}, {
|
14
12
|
type: "openid_credential";
|
15
|
-
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
16
13
|
credential_configuration_id: string;
|
17
|
-
}
|
14
|
+
}>;
|
18
15
|
c_nonce: z.ZodString;
|
19
16
|
c_nonce_expires_in: z.ZodNumber;
|
20
17
|
expires_in: z.ZodNumber;
|
@@ -22,9 +19,8 @@ export declare const TokenResponse: z.ZodObject<{
|
|
22
19
|
}, "strip", z.ZodTypeAny, {
|
23
20
|
authorization_details: {
|
24
21
|
type: "openid_credential";
|
25
|
-
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
26
22
|
credential_configuration_id: string;
|
27
|
-
}
|
23
|
+
};
|
28
24
|
access_token: string;
|
29
25
|
c_nonce: string;
|
30
26
|
c_nonce_expires_in: number;
|
@@ -33,9 +29,8 @@ export declare const TokenResponse: z.ZodObject<{
|
|
33
29
|
}, {
|
34
30
|
authorization_details: {
|
35
31
|
type: "openid_credential";
|
36
|
-
format: "vc+sd-jwt" | "vc+mdoc-cbor";
|
37
32
|
credential_configuration_id: string;
|
38
|
-
}
|
33
|
+
};
|
39
34
|
access_token: string;
|
40
35
|
c_nonce: string;
|
41
36
|
c_nonce_expires_in: number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,eAAO,MAAM,aAAa
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOxB,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAK7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;EAEjC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,eAAe,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"01-start-flow.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/01-start-flow.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,
|
1
|
+
{"version":3,"file":"01-start-flow.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/01-start-flow.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CA0B/C,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { RelyingPartyEntityConfiguration } from "../../trust/types";
|
1
|
+
import { RelyingPartyEntityConfiguration } from "../../entity/trust/types";
|
2
2
|
import type { StartFlow } from "../issuance/01-start-flow";
|
3
3
|
import type { Out } from "../../utils/misc";
|
4
4
|
export type EvaluateRelyingPartyTrust = (rpUrl: Out<StartFlow>["issuerUrl"], context?: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"02-evaluate-rp-trust.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/02-evaluate-rp-trust.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"02-evaluate-rp-trust.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/02-evaluate-rp-trust.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,MAAM,yBAAyB,GAAG,CACtC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,EAClC,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC;IACX,MAAM,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;CAChE,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,EAAE,yBAUvC,CAAC"}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { JWK } from "../../utils/jwk";
|
2
|
+
import { RelyingPartyEntityConfiguration } from "../../entity/trust/types";
|
3
|
+
/**
|
4
|
+
* Defines the signature for a function that retrieves JSON Web Key Sets (JWKS) from a client.
|
5
|
+
*
|
6
|
+
* @template T - The tuple type representing the function arguments.
|
7
|
+
* @param args - The arguments passed to the function.
|
8
|
+
* @returns A promise resolving to an object containing an array of JWKs.
|
9
|
+
*/
|
10
|
+
export type FetchJwks<T extends Array<unknown> = []> = (...args: T) => Promise<{
|
11
|
+
keys: JWK[];
|
12
|
+
}>;
|
13
|
+
/**
|
14
|
+
* Retrieves the JSON Web Key Set (JWKS) from the specified client's well-known endpoint.
|
15
|
+
*
|
16
|
+
* @param clientUrl - The base URL of the client entity from which to retrieve the JWKS.
|
17
|
+
* @param options - Optional context containing a custom fetch implementation.
|
18
|
+
* @param options.context - Optional context object.
|
19
|
+
* @param options.context.appFetch - Optional custom fetch function to use instead of the global `fetch`.
|
20
|
+
* @returns A promise resolving to an object containing an array of JWKs.
|
21
|
+
* @throws Will throw an error if the JWKS retrieval fails.
|
22
|
+
*/
|
23
|
+
export declare const fetchJwksFromUri: FetchJwks<[
|
24
|
+
string,
|
25
|
+
{
|
26
|
+
context?: {
|
27
|
+
appFetch?: GlobalFetch["fetch"];
|
28
|
+
};
|
29
|
+
}
|
30
|
+
]>;
|
31
|
+
/**
|
32
|
+
* Retrieves the JSON Web Key Set (JWKS) from a Relying Party's entity configuration.
|
33
|
+
*
|
34
|
+
* @param rpConfig - The configuration object of the Relying Party entity.
|
35
|
+
* @returns An object containing an array of JWKs.
|
36
|
+
* @throws Will throw an error if the configuration is invalid or if JWKS is not found.
|
37
|
+
*/
|
38
|
+
export declare const fetchJwksFromConfig: FetchJwks<[
|
39
|
+
RelyingPartyEntityConfiguration
|
40
|
+
]>;
|
41
|
+
//# sourceMappingURL=03-retrieve-jwks.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"03-retrieve-jwks.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/03-retrieve-jwks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAC7E,IAAI,EAAE,GAAG,EAAE,CAAC;CACb,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,CACtC;IAAC,MAAM;IAAE;QAAE,OAAO,CAAC,EAAE;YAAE,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;SAAE,CAAA;KAAE;CAAC,CAoB5D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,CACzC;IAAC,+BAA+B;CAAC,CAgBlC,CAAC"}
|