@pagopa/io-react-native-wallet 0.28.1 → 0.29.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/README.md +43 -0
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js +5 -0
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +17 -3
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/05-authorize-access.js +5 -0
- package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/commonjs/credential/issuance/06-obtain-credential.js +13 -2
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +10 -0
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/commonjs/credential/presentation/01-start-flow.js +14 -14
- package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js +4 -2
- package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
- package/lib/commonjs/credential/presentation/03-get-request-object.js +2 -2
- package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/05-verify-request-object.js +11 -4
- package/lib/commonjs/credential/presentation/05-verify-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +54 -14
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +26 -7
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js +4 -4
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/README.md +96 -2
- package/lib/commonjs/credential/presentation/errors.js +16 -19
- package/lib/commonjs/credential/presentation/errors.js.map +1 -1
- package/lib/commonjs/credential/presentation/index.js +27 -2
- package/lib/commonjs/credential/presentation/index.js.map +1 -1
- package/lib/commonjs/credential/presentation/types.js +1 -1
- package/lib/commonjs/credential/presentation/types.js.map +1 -1
- package/lib/commonjs/credential/status/02-status-attestation.js +2 -0
- package/lib/commonjs/credential/status/02-status-attestation.js.map +1 -1
- package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js +3 -0
- package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js.map +1 -1
- package/lib/commonjs/credential/trustmark/get-credential-trustmark.js +5 -0
- package/lib/commonjs/credential/trustmark/get-credential-trustmark.js.map +1 -1
- package/lib/commonjs/index.js +3 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/decoder.js +2 -0
- package/lib/commonjs/utils/decoder.js.map +1 -1
- package/lib/commonjs/utils/logging.js +68 -0
- package/lib/commonjs/utils/logging.js.map +1 -0
- package/lib/commonjs/utils/misc.js +2 -0
- package/lib/commonjs/utils/misc.js.map +1 -1
- package/lib/commonjs/utils/par.js +2 -0
- package/lib/commonjs/utils/par.js.map +1 -1
- package/lib/commonjs/wallet-instance/index.js +4 -0
- package/lib/commonjs/wallet-instance/index.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/issuing.js +5 -0
- package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/module/credential/issuance/03-start-user-authorization.js +5 -0
- package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js +17 -3
- package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/05-authorize-access.js +5 -0
- package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js +13 -2
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js +10 -0
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/module/credential/presentation/01-start-flow.js +14 -14
- package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/module/credential/presentation/02-evaluate-rp-trust.js +4 -2
- package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
- package/lib/module/credential/presentation/03-get-request-object.js +2 -2
- package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/module/credential/presentation/05-verify-request-object.js +11 -4
- package/lib/module/credential/presentation/05-verify-request-object.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js +55 -14
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +25 -6
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/module/credential/presentation/08-send-authorization-response.js +4 -4
- package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/README.md +96 -2
- package/lib/module/credential/presentation/errors.js +13 -16
- package/lib/module/credential/presentation/errors.js.map +1 -1
- 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 +1 -1
- package/lib/module/credential/presentation/types.js.map +1 -1
- package/lib/module/credential/status/02-status-attestation.js +2 -0
- package/lib/module/credential/status/02-status-attestation.js.map +1 -1
- package/lib/module/credential/status/03-verify-and-parse-status-attestation.js +3 -0
- package/lib/module/credential/status/03-verify-and-parse-status-attestation.js.map +1 -1
- package/lib/module/credential/trustmark/get-credential-trustmark.js +5 -0
- package/lib/module/credential/trustmark/get-credential-trustmark.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/decoder.js +2 -0
- package/lib/module/utils/decoder.js.map +1 -1
- package/lib/module/utils/logging.js +62 -0
- package/lib/module/utils/logging.js.map +1 -0
- package/lib/module/utils/misc.js +2 -0
- package/lib/module/utils/misc.js.map +1 -1
- package/lib/module/utils/par.js +2 -0
- package/lib/module/utils/par.js.map +1 -1
- package/lib/module/wallet-instance/index.js +4 -0
- package/lib/module/wallet-instance/index.js.map +1 -1
- package/lib/module/wallet-instance-attestation/issuing.js +5 -0
- package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
- 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 +2 -2
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +1 -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/presentation/01-start-flow.d.ts +17 -19
- 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 -0
- package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/03-get-request-object.d.ts +1 -4
- package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/05-verify-request-object.d.ts +4 -2
- package/lib/typescript/credential/presentation/05-verify-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts +13 -5
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts +7 -2
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts +3 -3
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/errors.d.ts +14 -9
- package/lib/typescript/credential/presentation/errors.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 +3 -3
- package/lib/typescript/credential/status/02-status-attestation.d.ts.map +1 -1
- package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts.map +1 -1
- package/lib/typescript/credential/trustmark/get-credential-trustmark.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/utils/decoder.d.ts.map +1 -1
- package/lib/typescript/utils/logging.d.ts +35 -0
- package/lib/typescript/utils/logging.d.ts.map +1 -0
- package/lib/typescript/utils/misc.d.ts.map +1 -1
- package/lib/typescript/utils/par.d.ts.map +1 -1
- package/lib/typescript/wallet-instance/index.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/credential/issuance/03-start-user-authorization.ts +18 -0
- package/src/credential/issuance/04-complete-user-authorization.ts +57 -3
- package/src/credential/issuance/05-authorize-access.ts +16 -0
- package/src/credential/issuance/06-obtain-credential.ts +31 -2
- package/src/credential/issuance/07-verify-and-parse-credential.ts +27 -1
- package/src/credential/presentation/01-start-flow.ts +18 -20
- package/src/credential/presentation/02-evaluate-rp-trust.ts +3 -2
- package/src/credential/presentation/03-get-request-object.ts +4 -6
- package/src/credential/presentation/05-verify-request-object.ts +17 -6
- package/src/credential/presentation/07-evaluate-dcql-query.ts +60 -17
- package/src/credential/presentation/07-evaluate-input-descriptor.ts +53 -39
- package/src/credential/presentation/08-send-authorization-response.ts +9 -7
- package/src/credential/presentation/README.md +96 -2
- package/src/credential/presentation/errors.ts +21 -14
- package/src/credential/presentation/index.ts +22 -4
- package/src/credential/presentation/types.ts +1 -1
- package/src/credential/status/02-status-attestation.ts +3 -0
- package/src/credential/status/03-verify-and-parse-status-attestation.ts +10 -0
- package/src/credential/trustmark/get-credential-trustmark.ts +19 -0
- package/src/index.ts +2 -0
- package/src/utils/decoder.ts +5 -0
- package/src/utils/logging.ts +68 -0
- package/src/utils/misc.ts +5 -0
- package/src/utils/par.ts +6 -0
- package/src/wallet-instance/index.ts +17 -1
- package/src/wallet-instance-attestation/issuing.ts +19 -0
@@ -2,7 +2,9 @@ import type { RelyingPartyEntityConfiguration } from "../../trust";
|
|
2
2
|
import { RequestObject } from "./types";
|
3
3
|
export type VerifyRequestObject = (requestObjectEncodedJwt: string, context: {
|
4
4
|
clientId: string;
|
5
|
-
rpConf: RelyingPartyEntityConfiguration["payload"];
|
5
|
+
rpConf: RelyingPartyEntityConfiguration["payload"]["metadata"];
|
6
|
+
rpSubject: string;
|
7
|
+
state?: string;
|
6
8
|
}) => Promise<{
|
7
9
|
requestObject: RequestObject;
|
8
10
|
}>;
|
@@ -10,8 +12,8 @@ export type VerifyRequestObject = (requestObjectEncodedJwt: string, context: {
|
|
10
12
|
* Function to verify the Request Object's signature and the client ID.
|
11
13
|
* @param requestObjectEncodedJwt The Request Object in JWT format
|
12
14
|
* @param context.clientId The client ID to verify
|
13
|
-
* @param context.jwkKeys The set of keys to verify the signature
|
14
15
|
* @param context.rpConf The Entity Configuration of the Relying Party
|
16
|
+
* @param context.state Optional state
|
15
17
|
* @returns The verified Request Object
|
16
18
|
*/
|
17
19
|
export declare const verifyRequestObject: VerifyRequestObject;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"05-verify-request-object.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/05-verify-request-object.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,MAAM,MAAM,mBAAmB,GAAG,CAChC,uBAAuB,EAAE,MAAM,EAC/B,OAAO,EAAE;IACP,QAAQ,EAAE,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"05-verify-request-object.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/05-verify-request-object.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,MAAM,MAAM,mBAAmB,GAAG,CAChC,uBAAuB,EAAE,MAAM,EAC/B,OAAO,EAAE;IACP,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,KACE,OAAO,CAAC;IAAE,aAAa,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,mBAsCjC,CAAC"}
|
@@ -1,14 +1,22 @@
|
|
1
1
|
import { DcqlQuery } from "dcql";
|
2
|
-
import type {
|
2
|
+
import type { Disclosure } from "../../sd-jwt/types";
|
3
3
|
import type { RemotePresentation } from "./types";
|
4
|
-
|
4
|
+
/**
|
5
|
+
* The purpose for the credential request by the RP.
|
6
|
+
*/
|
7
|
+
type CredentialPurpose = {
|
8
|
+
required: boolean;
|
9
|
+
description?: string;
|
10
|
+
};
|
11
|
+
export type EvaluateDcqlQuery = (credentialsSdJwt: [string, string][], query: DcqlQuery.Input) => {
|
5
12
|
id: string;
|
13
|
+
vct: string;
|
6
14
|
credential: string;
|
7
15
|
keyTag: string;
|
8
|
-
requiredDisclosures:
|
9
|
-
|
16
|
+
requiredDisclosures: Disclosure[];
|
17
|
+
purposes: CredentialPurpose[];
|
10
18
|
}[];
|
11
|
-
type PrepareRemotePresentations = (credentials: {
|
19
|
+
export type PrepareRemotePresentations = (credentials: {
|
12
20
|
id: string;
|
13
21
|
credential: string;
|
14
22
|
keyTag: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"07-evaluate-dcql-query.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/07-evaluate-dcql-query.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIV,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"07-evaluate-dcql-query.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/07-evaluate-dcql-query.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIV,MAAM,MAAM,CAAC;AAGd,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD;;GAEG;AACH,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAC9B,gBAAgB,EAAE,CAAC,MAAM,EAAe,MAAM,CAAkB,EAAE,EAClE,KAAK,EAAE,SAAS,CAAC,KAAK,KACnB;IACH,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,UAAU,EAAE,CAAC;IAClC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B,EAAE,CAAC;AAEJ,MAAM,MAAM,0BAA0B,GAAG,CACvC,WAAW,EAAE;IACX,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,EAAE,EACH,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;AAwEnC,eAAO,MAAM,iBAAiB,EAAE,iBAsE/B,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,0BAqBxC,CAAC"}
|
@@ -12,7 +12,10 @@ export type EvaluateInputDescriptors = (descriptors: InputDescriptor[], credenti
|
|
12
12
|
credential: string;
|
13
13
|
keyTag: string;
|
14
14
|
}[]>;
|
15
|
-
|
15
|
+
/**
|
16
|
+
* @deprecated Use `prepareRemotePresentations` from DCQL
|
17
|
+
*/
|
18
|
+
export type PrepareLegacyRemotePresentations = (credentialAndDescriptors: {
|
16
19
|
requestedClaims: string[];
|
17
20
|
inputDescriptor: InputDescriptor;
|
18
21
|
credential: string;
|
@@ -76,6 +79,8 @@ export declare const evaluateInputDescriptors: EvaluateInputDescriptors;
|
|
76
79
|
* - Validates the credential format.
|
77
80
|
* - Generates a verifiable presentation token (vpToken) using the provided nonce and client identifier.
|
78
81
|
*
|
82
|
+
* @deprecated Use `prepareRemotePresentations` from DCQL
|
83
|
+
*
|
79
84
|
* @param credentialAndDescriptors - An array containing objects with requested claims,
|
80
85
|
* input descriptor, credential, and keyTag.
|
81
86
|
* @param nonce - A unique nonce for the verifiable presentation token.
|
@@ -83,6 +88,6 @@ export declare const evaluateInputDescriptors: EvaluateInputDescriptors;
|
|
83
88
|
* @returns A promise that resolves to an array of RemotePresentation objects.
|
84
89
|
* @throws {CredentialNotFoundError} When the credential format is unsupported.
|
85
90
|
*/
|
86
|
-
export declare const
|
91
|
+
export declare const prepareLegacyRemotePresentations: PrepareLegacyRemotePresentations;
|
87
92
|
export {};
|
88
93
|
//# sourceMappingURL=07-evaluate-input-descriptor.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"07-evaluate-input-descriptor.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/07-evaluate-input-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAU1E,MAAM,MAAM,oBAAoB,GAAG;IACjC,mBAAmB,EAAE,qBAAqB,EAAE,CAAC;IAC7C,mBAAmB,EAAE,qBAAqB,EAAE,CAAC;IAC7C,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,CAC5C,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,QAAQ,CAAC,SAAS,CAAC,EACtC,WAAW,EAAE,qBAAqB,EAAE,KACjC,oBAAoB,CAAC;AAE1B,MAAM,MAAM,wBAAwB,GAAG,CACrC,WAAW,EAAE,eAAe,EAAE,EAC9B,gBAAgB,EAAE,CAAC,MAAM,EAAe,MAAM,CAAkB,EAAE,KAC/D,OAAO,CACV;IACE,mBAAmB,EAAE,oBAAoB,CAAC;IAC1C,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,EAAE,CACJ,CAAC;AAEF,MAAM,MAAM,
|
1
|
+
{"version":3,"file":"07-evaluate-input-descriptor.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/07-evaluate-input-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAU1E,MAAM,MAAM,oBAAoB,GAAG;IACjC,mBAAmB,EAAE,qBAAqB,EAAE,CAAC;IAC7C,mBAAmB,EAAE,qBAAqB,EAAE,CAAC;IAC7C,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,CAC5C,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,QAAQ,CAAC,SAAS,CAAC,EACtC,WAAW,EAAE,qBAAqB,EAAE,KACjC,oBAAoB,CAAC;AAE1B,MAAM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wks>["keys"
|
|
36
36
|
* @param payload - Object that contains the VP token to encrypt and the mapping of the credential disclosures
|
37
37
|
* @returns A URL-encoded string for an `application/x-www-form-urlencoded` POST body, where `response` contains the encrypted JWE.
|
38
38
|
*/
|
39
|
-
export declare const buildDirectPostJwtBody: (requestObject: Out<VerifyRequestObject>["requestObject"], rpConf: RelyingPartyEntityConfiguration["payload"], payload: DirectAuthorizationBodyPayload | LegacyDirectAuthorizationBodyPayload) => Promise<string>;
|
39
|
+
export declare const buildDirectPostJwtBody: (requestObject: Out<VerifyRequestObject>["requestObject"], rpConf: RelyingPartyEntityConfiguration["payload"]["metadata"], payload: DirectAuthorizationBodyPayload | LegacyDirectAuthorizationBodyPayload) => Promise<string>;
|
40
40
|
/**
|
41
41
|
* Type definition for the function that sends the authorization response
|
42
42
|
* to the Relying Party, completing the presentation flow.
|
43
43
|
* Use with `presentation_definition`.
|
44
44
|
* @deprecated Use `sendAuthorizationResponse`
|
45
45
|
*/
|
46
|
-
export type SendLegacyAuthorizationResponse = (requestObject: Out<VerifyRequestObject>["requestObject"], presentationDefinitionId: string, remotePresentations: LegacyRemotePresentation[], rpConf: RelyingPartyEntityConfiguration["payload"], context?: {
|
46
|
+
export type SendLegacyAuthorizationResponse = (requestObject: Out<VerifyRequestObject>["requestObject"], presentationDefinitionId: string, remotePresentations: LegacyRemotePresentation[], rpConf: RelyingPartyEntityConfiguration["payload"]["metadata"], context?: {
|
47
47
|
appFetch?: GlobalFetch["fetch"];
|
48
48
|
}) => Promise<AuthorizationResponse>;
|
49
49
|
/**
|
@@ -63,7 +63,7 @@ export declare const sendLegacyAuthorizationResponse: SendLegacyAuthorizationRes
|
|
63
63
|
* to the Relying Party, completing the presentation flow.
|
64
64
|
* Use with DCQL queries.
|
65
65
|
*/
|
66
|
-
export type SendAuthorizationResponse = (requestObject: Out<VerifyRequestObject>["requestObject"], remotePresentations: RemotePresentation[], rpConf: RelyingPartyEntityConfiguration["payload"], context?: {
|
66
|
+
export type SendAuthorizationResponse = (requestObject: Out<VerifyRequestObject>["requestObject"], remotePresentations: RemotePresentation[], rpConf: RelyingPartyEntityConfiguration["payload"]["metadata"], context?: {
|
67
67
|
appFetch?: GlobalFetch["fetch"];
|
68
68
|
}) => Promise<AuthorizationResponse>;
|
69
69
|
export declare const sendAuthorizationResponse: SendAuthorizationResponse;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"08-send-authorization-response.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/08-send-authorization-response.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAoB,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EACL,KAAK,kBAAkB,EACvB,8BAA8B,EAC9B,KAAK,wBAAwB,EAC7B,oCAAoC,EACrC,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAUhC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,cACxB,IAAI,SAAS,CAAC,CAAC,MAAM,CAAC,KAChC,GAWF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,kBAClB,IAAI,mBAAmB,CAAC,CAAC,eAAe,CAAC,UAChD,+BAA+B,CAAC,SAAS,CAAC,
|
1
|
+
{"version":3,"file":"08-send-authorization-response.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/08-send-authorization-response.ts"],"names":[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AC,qBAAqB,CAAC,CAAC;AAEpC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,+BAA+B,EAAE,+BAkD3C,CAAC;AAEJ;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,CACtC,aAAa,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,eAAe,CAAC,EACxD,mBAAmB,EAAE,kBAAkB,EAAE,EACzC,MAAM,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,EAC9D,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpC,eAAO,MAAM,yBAAyB,EAAE,yBA4BvC,CAAC"}
|
@@ -28,10 +28,9 @@ export declare class NoSuitableKeysFoundInEntityConfiguration extends IoWalletEr
|
|
28
28
|
*/
|
29
29
|
export declare class InvalidQRCodeError extends IoWalletError {
|
30
30
|
code: string;
|
31
|
-
/**
|
32
|
-
|
33
|
-
|
34
|
-
constructor(detail: string);
|
31
|
+
/** Detailed reason for the QR code validation failure. */
|
32
|
+
reason: string;
|
33
|
+
constructor(reason: string);
|
35
34
|
}
|
36
35
|
/**
|
37
36
|
* When the entity is unverified because the Relying Party is not trusted.
|
@@ -55,15 +54,21 @@ export declare class MissingDataError extends IoWalletError {
|
|
55
54
|
*/
|
56
55
|
constructor(missingAttributes: string);
|
57
56
|
}
|
57
|
+
export type NotFoundDetail = {
|
58
|
+
id: string;
|
59
|
+
reason?: string;
|
60
|
+
vctValues?: string[];
|
61
|
+
};
|
58
62
|
/**
|
59
|
-
*
|
60
|
-
*
|
63
|
+
* Error thrown when one or more credentials cannot be found in the wallet
|
64
|
+
* and the presentation request cannot be satisfied.
|
61
65
|
*/
|
62
|
-
export declare class
|
66
|
+
export declare class CredentialsNotFoundError extends IoWalletError {
|
63
67
|
code: string;
|
68
|
+
details: NotFoundDetail[];
|
64
69
|
/**
|
65
|
-
* @param
|
70
|
+
* @param details The details of the credentials that could not be found.
|
66
71
|
*/
|
67
|
-
constructor(
|
72
|
+
constructor(details: NotFoundDetail[]);
|
68
73
|
}
|
69
74
|
//# sourceMappingURL=errors.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,oBAAoB,CAAC;AAEnE;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,IAAI,SAAwD;IAE5D,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;gBAGb,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,MAAsB,EAC7B,MAAM,GAAE,MAAsB;CAMjC;AAED;;;GAGG;AACH,qBAAa,wCAAyC,SAAQ,aAAa;IACzE,IAAI,SAAoC;IAExC;;OAEG;gBACS,QAAQ,EAAE,MAAM;CAI7B;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,IAAI,SAAyB;IAE7B
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,oBAAoB,CAAC;AAEnE;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,IAAI,SAAwD;IAE5D,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;gBAGb,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,MAAsB,EAC7B,MAAM,GAAE,MAAsB;CAMjC;AAED;;;GAGG;AACH,qBAAa,wCAAyC,SAAQ,aAAa;IACzE,IAAI,SAAoC;IAExC;;OAEG;gBACS,QAAQ,EAAE,MAAM;CAI7B;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,IAAI,SAAyB;IAE7B,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;gBAEH,MAAM,EAAE,MAAM;CAI3B;AAED;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,aAAa;IACtD,IAAI,SAA8B;IAElC;;OAEG;gBACS,MAAM,EAAE,MAAM;CAI3B;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,IAAI,SAAsB;IAE1B;;OAEG;gBACS,iBAAiB,EAAE,MAAM;CAItC;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,aAAa;IACzD,IAAI,SAA+B;IACnC,OAAO,EAAE,cAAc,EAAE,CAAC;IAE1B;;OAEG;gBACS,OAAO,EAAE,cAAc,EAAE;CAItC"}
|
@@ -4,9 +4,10 @@ import { getRequestObject, type GetRequestObject } from "./03-get-request-object
|
|
4
4
|
import { getJwksFromConfig, type FetchJwks } from "./04-retrieve-rp-jwks";
|
5
5
|
import { verifyRequestObject, type VerifyRequestObject } from "./05-verify-request-object";
|
6
6
|
import { fetchPresentDefinition, type FetchPresentationDefinition } from "./06-fetch-presentation-definition";
|
7
|
-
import {
|
8
|
-
import {
|
7
|
+
import { evaluateInputDescriptors, prepareLegacyRemotePresentations, type EvaluateInputDescriptors, type PrepareLegacyRemotePresentations } from "./07-evaluate-input-descriptor";
|
8
|
+
import { evaluateDcqlQuery, prepareRemotePresentations, type EvaluateDcqlQuery, type PrepareRemotePresentations } from "./07-evaluate-dcql-query";
|
9
|
+
import { sendAuthorizationResponse, type SendAuthorizationResponse, sendLegacyAuthorizationResponse, type SendLegacyAuthorizationResponse } from "./08-send-authorization-response";
|
9
10
|
import * as Errors from "./errors";
|
10
|
-
export { startFlowFromQR, evaluateRelyingPartyTrust, getRequestObject, getJwksFromConfig, verifyRequestObject, fetchPresentDefinition,
|
11
|
-
export type { StartFlow, EvaluateRelyingPartyTrust, GetRequestObject, FetchJwks, VerifyRequestObject, FetchPresentationDefinition,
|
11
|
+
export { startFlowFromQR, evaluateRelyingPartyTrust, getRequestObject, getJwksFromConfig, verifyRequestObject, fetchPresentDefinition, evaluateInputDescriptors, evaluateDcqlQuery, prepareLegacyRemotePresentations, prepareRemotePresentations, sendAuthorizationResponse, sendLegacyAuthorizationResponse, Errors, };
|
12
|
+
export type { StartFlow, EvaluateRelyingPartyTrust, GetRequestObject, FetchJwks, VerifyRequestObject, FetchPresentationDefinition, EvaluateInputDescriptors, EvaluateDcqlQuery, PrepareLegacyRemotePresentations, PrepareRemotePresentations, SendAuthorizationResponse, SendLegacyAuthorizationResponse, };
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EACL,mBAAmB,EACnB,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,EACjC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eA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
346
|
iss: z.ZodString;
|
347
347
|
iat: z.ZodNumber;
|
348
348
|
exp: z.ZodNumber;
|
349
|
-
state: z.ZodString
|
349
|
+
state: z.ZodOptional<z.ZodString>;
|
350
350
|
nonce: z.ZodString;
|
351
351
|
response_uri: z.ZodString;
|
352
352
|
response_uri_method: z.ZodOptional<z.ZodString>;
|
@@ -573,7 +573,6 @@ export declare const RequestObject: z.ZodObject<{
|
|
573
573
|
}[] | undefined;
|
574
574
|
}>>;
|
575
575
|
}, "strip", z.ZodTypeAny, {
|
576
|
-
state: string;
|
577
576
|
iss: string;
|
578
577
|
iat: number;
|
579
578
|
exp: number;
|
@@ -582,6 +581,7 @@ export declare const RequestObject: z.ZodObject<{
|
|
582
581
|
response_type: "vp_token";
|
583
582
|
response_mode: "direct_post.jwt";
|
584
583
|
client_id: string;
|
584
|
+
state?: string | undefined;
|
585
585
|
response_uri_method?: string | undefined;
|
586
586
|
dcql_query?: Record<string, any> | undefined;
|
587
587
|
scope?: string | undefined;
|
@@ -623,7 +623,6 @@ export declare const RequestObject: z.ZodObject<{
|
|
623
623
|
}[] | undefined;
|
624
624
|
} | undefined;
|
625
625
|
}, {
|
626
|
-
state: string;
|
627
626
|
iss: string;
|
628
627
|
iat: number;
|
629
628
|
exp: number;
|
@@ -632,6 +631,7 @@ export declare const RequestObject: z.ZodObject<{
|
|
632
631
|
response_type: "vp_token";
|
633
632
|
response_mode: "direct_post.jwt";
|
634
633
|
client_id: string;
|
634
|
+
state?: string | undefined;
|
635
635
|
response_uri_method?: string | undefined;
|
636
636
|
dcql_query?: Record<string, any> | undefined;
|
637
637
|
scope?: string | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"02-status-attestation.d.ts","sourceRoot":"","sources":["../../../../src/credential/status/02-status-attestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,GAAG,EACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,KAAK,aAAa,EAAW,MAAM,6BAA6B,CAAC;AAE1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;
|
1
|
+
{"version":3,"file":"02-status-attestation.d.ts","sourceRoot":"","sources":["../../../../src/credential/status/02-status-attestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,GAAG,EACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,KAAK,aAAa,EAAW,MAAM,6BAA6B,CAAC;AAE1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AASpD,MAAM,MAAM,iBAAiB,GAAG,CAC9B,UAAU,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAClD,UAAU,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC,YAAY,CAAC,EAC/C,uBAAuB,EAAE,aAAa,EACtC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,KAC5B,OAAO,CAAC;IACX,iBAAiB,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,CAAC;CACpE,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBA6C/B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"03-verify-and-parse-status-attestation.d.ts","sourceRoot":"","sources":["../../../../src/credential/status/03-verify-and-parse-status-attestation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;
|
1
|
+
{"version":3,"file":"03-verify-and-parse-status-attestation.d.ts","sourceRoot":"","sources":["../../../../src/credential/status/03-verify-and-parse-status-attestation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAIlD,MAAM,MAAM,+BAA+B,GAAG,CAC5C,UAAU,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAClD,iBAAiB,EAAE,GAAG,CAAC,iBAAiB,CAAC,EACzC,OAAO,EAAE;IACP,uBAAuB,EAAE,aAAa,CAAC;CACxC,KACE,OAAO,CAAC;IAAE,uBAAuB,EAAE,uBAAuB,CAAA;CAAE,CAAC,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,+BAA+B,EAAE,+BAwC3C,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-credential-trustmark.d.ts","sourceRoot":"","sources":["../../../../src/credential/trustmark/get-credential-trustmark.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;
|
1
|
+
{"version":3,"file":"get-credential-trustmark.d.ts","sourceRoot":"","sources":["../../../../src/credential/trustmark/get-credential-trustmark.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AAMrC,MAAM,MAAM,yBAAyB,GAAG,CAAC,MAAM,EAAE;IAC/C;;OAEG;IACH,yBAAyB,EAAE,MAAM,CAAC;IAClC;;OAEG;IACH,gBAAgB,EAAE,aAAa,CAAC;IAChC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAClC,KAAK,OAAO,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,EAAE,yBA6EpC,CAAC"}
|
@@ -8,9 +8,10 @@ import * as Errors from "./utils/errors";
|
|
8
8
|
import * as WalletInstanceAttestation from "./wallet-instance-attestation";
|
9
9
|
import * as Trust from "./trust";
|
10
10
|
import * as WalletInstance from "./wallet-instance";
|
11
|
+
import * as Logging from "./utils/logging";
|
11
12
|
import { AuthorizationDetail, AuthorizationDetails } from "./utils/par";
|
12
13
|
import { createCryptoContextFor } from "./utils/crypto";
|
13
14
|
import type { IntegrityContext } from "./utils/integrity";
|
14
|
-
export { SdJwt, PID, Credential, WalletInstanceAttestation, WalletInstance, Errors, Trust, createCryptoContextFor, AuthorizationDetail, AuthorizationDetails, fixBase64EncodingOnKey, };
|
15
|
+
export { SdJwt, PID, Credential, WalletInstanceAttestation, WalletInstance, Errors, Trust, createCryptoContextFor, AuthorizationDetail, AuthorizationDetails, fixBase64EncodingOnKey, Logging, };
|
15
16
|
export type { IntegrityContext, AuthorizationContext };
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAGrD,OAAO,gCAAgC,CAAC;AAExC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,KAAK,M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,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EACL,KAAK,EACL,GAAG,EACH,UAAU,EACV,yBAAyB,EACzB,cAAc,EACd,MAAM,EACN,KAAK,EACL,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,OAAO,GACR,CAAC;AAEF,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../../src/utils/decoder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../../src/utils/decoder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAgC7C,eAAO,MAAM,kBAAkB,aACnB,MAAM,KACf,QAAQ;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,eAAe,CAAA;CAAE,CAsBtD,CAAC"}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/**
|
2
|
+
* Logger interface which can be provided to the Logger class as a custom implementation.
|
3
|
+
*/
|
4
|
+
export interface LoggingContext {
|
5
|
+
logDebug: (msg: string) => void;
|
6
|
+
logInfo: (msg: string) => void;
|
7
|
+
logWarn: (msg: string) => void;
|
8
|
+
logError: (msg: string) => void;
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* Supported debug levels.
|
12
|
+
*/
|
13
|
+
export declare enum LogLevel {
|
14
|
+
DEBUG = 0,
|
15
|
+
INFO = 1,
|
16
|
+
WARN = 2,
|
17
|
+
ERROR = 3
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* Logger singleton class which provides a simple logging interface with an init function to set the logging context and
|
21
|
+
* a static log function to log messages based on the debug level.
|
22
|
+
* This can be used as follows:
|
23
|
+
* const logger = Logger.getInstance();
|
24
|
+
* logger.initLogging(yourLoggingContext);
|
25
|
+
* logger.log(LogLevel.DEBUG, "Debug message");
|
26
|
+
*/
|
27
|
+
export declare class Logger {
|
28
|
+
private static instance;
|
29
|
+
private static loggingContext?;
|
30
|
+
private constructor();
|
31
|
+
static getInstance(): Logger;
|
32
|
+
initLogging(loggingCtx: LoggingContext): void;
|
33
|
+
static log(level: LogLevel, msg: string): void;
|
34
|
+
}
|
35
|
+
//# sourceMappingURL=logging.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../src/utils/logging.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED;;GAEG;AACH,oBAAY,QAAQ;IAClB,KAAK,IAAA;IACL,IAAI,IAAA;IACJ,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AAED;;;;;;;GAOG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAuB;IAC9C,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAiB;IAG/C,OAAO;WAGO,WAAW,IAAI,MAAM;IAQ5B,WAAW,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI;WAKtC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;CAkBtD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/utils/misc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,yBAAyB,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/utils/misc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAIpE;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,WAClB,MAAM,gBAAgB,gCAAgC,WACnD,QAAQ,KAAG,QAAQ,QAAQ,CActC,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,oBAAoB,gDACrB,QAAQ,iCAIC,CAAC;AAItB,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,GAC7D,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,GACvB,EAAE,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAChC,UAAU,CAAC,EAAE,CAAC,GACd,KAAK,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,SAAU,MAAM,WAGjD,CAAC;AAEb;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,eAChC,MAAM,KACjB,QAAQ,MAAM,CAMhB,CAAC;AAEF,eAAO,MAAM,aAAa,YAAa,MAAM,0CAM5C,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"par.d.ts","sourceRoot":"","sources":["../../../src/utils/par.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;
|
1
|
+
{"version":3,"file":"par.d.ts","sourceRoot":"","sources":["../../../src/utils/par.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAOzB,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACxE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;WAA+B,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,cAAc;sBAKL,aAAa;cACrB,WAAW,CAAC,OAAO,CAAC;iBAGpB,MAAM,gBACF,MAAM,eACP,MAAM,gBACL,MAAM,eACP,MAAM,6BACQ,MAAM;;;;oBAElB,MAAM,KACpB,QAAQ,MAAM,CA8EhB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wallet-instance/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wallet-instance/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAG3C,wBAAsB,oBAAoB,CAAC,OAAO,EAAE;IAClD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,mBAiCA;AAyBD;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhB;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAC,OAAO,EAAE;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAM9B;AAED;;;GAGG;AACH,wBAAsB,8BAA8B,CAAC,OAAO,EAAE;IAC5D,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAI9B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"issuing.d.ts","sourceRoot":"","sources":["../../../src/wallet-instance-attestation/issuing.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;
|
1
|
+
{"version":3,"file":"issuing.d.ts","sourceRoot":"","sources":["../../../src/wallet-instance-attestation/issuing.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAS3C;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,aAAa,EAC/B,gBAAgB,EAAE,gBAAgB,EAClC,qBAAqB,EAAE,MAAM,GAC5B,OAAO,CAAC,MAAM,CAAC,CAoCjB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;sBAMP,aAAa;sBACb,gBAAgB;2BACX,MAAM;;;;;MAE3B,QAAQ,MAAM,CA0CjB,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pagopa/io-react-native-wallet",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.29.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",
|
@@ -54,8 +54,8 @@
|
|
54
54
|
},
|
55
55
|
"devDependencies": {
|
56
56
|
"@pagopa/io-react-native-crypto": "^0.2.3",
|
57
|
-
"@react-native/eslint-config": "^0.75.5",
|
58
57
|
"@pagopa/io-react-native-jwt": "^2.1.0",
|
58
|
+
"@react-native/eslint-config": "^0.75.5",
|
59
59
|
"@rushstack/eslint-patch": "^1.3.2",
|
60
60
|
"@types/jest": "^28.1.2",
|
61
61
|
"@types/react": "^18.2.6",
|
@@ -114,7 +114,7 @@
|
|
114
114
|
]
|
115
115
|
},
|
116
116
|
"dependencies": {
|
117
|
-
"dcql": "^0.2.
|
117
|
+
"dcql": "^0.2.21",
|
118
118
|
"js-base64": "^3.7.7",
|
119
119
|
"js-sha256": "^0.9.0",
|
120
120
|
"jsonpath-plus": "^10.2.0",
|
@@ -5,6 +5,7 @@ import type { EvaluateIssuerTrust } from "./02-evaluate-issuer-trust";
|
|
5
5
|
import type { StartFlow } from "./01-start-flow";
|
6
6
|
import { AuthorizationDetail, makeParRequest } from "../../utils/par";
|
7
7
|
import { ASSERTION_TYPE } from "./const";
|
8
|
+
import { LogLevel, Logger } from "../../utils/logging";
|
8
9
|
|
9
10
|
export type StartUserAuthorization = (
|
10
11
|
issuerConf: Out<EvaluateIssuerTrust>["issuerConf"],
|
@@ -49,6 +50,10 @@ const selectCredentialDefinition = (
|
|
49
50
|
}));
|
50
51
|
|
51
52
|
if (!result) {
|
53
|
+
Logger.log(
|
54
|
+
LogLevel.ERROR,
|
55
|
+
`Requested credential type ${credentialType} is not supported by the issuer according to its configuration ${JSON.stringify(credential_configurations_supported)}`
|
56
|
+
);
|
52
57
|
throw new Error(`No credential support the type '${credentialType}'`);
|
53
58
|
}
|
54
59
|
return result;
|
@@ -70,7 +75,16 @@ const selectResponseMode = (
|
|
70
75
|
const responseMode =
|
71
76
|
credentialType === "PersonIdentificationData" ? "query" : "form_post.jwt";
|
72
77
|
|
78
|
+
Logger.log(
|
79
|
+
LogLevel.DEBUG,
|
80
|
+
`Selected response mode ${responseMode} for credential type ${credentialType}`
|
81
|
+
);
|
82
|
+
|
73
83
|
if (!responseModeSupported.includes(responseMode)) {
|
84
|
+
Logger.log(
|
85
|
+
LogLevel.ERROR,
|
86
|
+
`Requested response mode ${responseMode} is not supported by the issuer according to its configuration ${JSON.stringify(responseModeSupported)}`
|
87
|
+
);
|
74
88
|
throw new Error(`No response mode support the type '${credentialType}'`);
|
75
89
|
}
|
76
90
|
|
@@ -109,6 +123,10 @@ export const startUserAuthorization: StartUserAuthorization = async (
|
|
109
123
|
|
110
124
|
const clientId = await wiaCryptoContext.getPublicKey().then((_) => _.kid);
|
111
125
|
if (!clientId) {
|
126
|
+
Logger.log(
|
127
|
+
LogLevel.ERROR,
|
128
|
+
`Public key associated with kid ${clientId} not found in the device`
|
129
|
+
);
|
112
130
|
throw new Error("No public key found");
|
113
131
|
}
|
114
132
|
const codeVerifier = generateRandomAlphaNumericString(64);
|
@@ -19,6 +19,7 @@ import { v4 as uuidv4 } from "uuid";
|
|
19
19
|
import { ResponseUriResultShape } from "./types";
|
20
20
|
import { getJwtFromFormPost } from "../../utils/decoder";
|
21
21
|
import { AuthorizationError, AuthorizationIdpError } from "./errors";
|
22
|
+
import { LogLevel, Logger } from "../../utils/logging";
|
22
23
|
|
23
24
|
/**
|
24
25
|
* The interface of the phase to complete User authorization via strong identification when the response mode is "query" and the request credential is a PersonIdentificationData.
|
@@ -49,7 +50,7 @@ export type BuildAuthorizationUrl = (
|
|
49
50
|
issuerRequestUri: Out<StartUserAuthorization>["issuerRequestUri"],
|
50
51
|
clientId: Out<StartUserAuthorization>["clientId"],
|
51
52
|
issuerConf: Out<EvaluateIssuerTrust>["issuerConf"],
|
52
|
-
idpHint
|
53
|
+
idpHint?: string
|
53
54
|
) => Promise<{
|
54
55
|
authUrl: string;
|
55
56
|
}>;
|
@@ -60,7 +61,7 @@ export type BuildAuthorizationUrl = (
|
|
60
61
|
* @param issuerRequestUri the URI of the issuer where the request is sent
|
61
62
|
* @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
|
62
63
|
* @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
|
63
|
-
* @param idpHint Unique identifier of the IDP selected by the user
|
64
|
+
* @param idpHint Unique identifier of the IDP selected by the user (optional)
|
64
65
|
* @returns An object containing the authorization URL
|
65
66
|
*/
|
66
67
|
export const buildAuthorizationUrl: BuildAuthorizationUrl = async (
|
@@ -75,9 +76,12 @@ export const buildAuthorizationUrl: BuildAuthorizationUrl = async (
|
|
75
76
|
const params = new URLSearchParams({
|
76
77
|
client_id: clientId,
|
77
78
|
request_uri: issuerRequestUri,
|
78
|
-
idphint: idpHint,
|
79
79
|
});
|
80
80
|
|
81
|
+
if (idpHint) {
|
82
|
+
params.append("idphint", idpHint);
|
83
|
+
}
|
84
|
+
|
81
85
|
const authUrl = `${authzRequestEndpoint}?${params}`;
|
82
86
|
|
83
87
|
return { authUrl };
|
@@ -92,6 +96,10 @@ export const buildAuthorizationUrl: BuildAuthorizationUrl = async (
|
|
92
96
|
*/
|
93
97
|
export const completeUserAuthorizationWithQueryMode: CompleteUserAuthorizationWithQueryMode =
|
94
98
|
async (authRedirectUrl) => {
|
99
|
+
Logger.log(
|
100
|
+
LogLevel.DEBUG,
|
101
|
+
`The requeste credential is a PersonIdentificationData, completing the user authorization with query mode`
|
102
|
+
);
|
95
103
|
const query = parseUrl(authRedirectUrl).query;
|
96
104
|
|
97
105
|
return parseAuthorizationResponse(query);
|
@@ -111,6 +119,10 @@ export const completeUserAuthorizationWithQueryMode: CompleteUserAuthorizationWi
|
|
111
119
|
*/
|
112
120
|
export const getRequestedCredentialToBePresented: GetRequestedCredentialToBePresented =
|
113
121
|
async (issuerRequestUri, clientId, issuerConf, appFetch = fetch) => {
|
122
|
+
Logger.log(
|
123
|
+
LogLevel.DEBUG,
|
124
|
+
`The requeste credential is not a PersonIdentificationData, requesting the credential to be presented`
|
125
|
+
);
|
114
126
|
const authzRequestEndpoint =
|
115
127
|
issuerConf.oauth_authorization_server.authorization_endpoint;
|
116
128
|
const params = new URLSearchParams({
|
@@ -118,6 +130,11 @@ export const getRequestedCredentialToBePresented: GetRequestedCredentialToBePres
|
|
118
130
|
request_uri: issuerRequestUri,
|
119
131
|
});
|
120
132
|
|
133
|
+
Logger.log(
|
134
|
+
LogLevel.DEBUG,
|
135
|
+
`Requesting the request object to ${authzRequestEndpoint}?${params.toString()}`
|
136
|
+
);
|
137
|
+
|
121
138
|
const requestObject = await appFetch(
|
122
139
|
`${authzRequestEndpoint}?${params.toString()}`,
|
123
140
|
{ method: "GET" }
|
@@ -128,6 +145,10 @@ export const getRequestedCredentialToBePresented: GetRequestedCredentialToBePres
|
|
128
145
|
.then((reqObj) => RequestObject.safeParse(reqObj.payload));
|
129
146
|
|
130
147
|
if (!requestObject.success) {
|
148
|
+
Logger.log(
|
149
|
+
LogLevel.ERROR,
|
150
|
+
`Error while validating the response object: ${requestObject.error.message}`
|
151
|
+
);
|
131
152
|
throw new ValidationFailed({
|
132
153
|
message: "Request Object validation failed",
|
133
154
|
reason: requestObject.error.message,
|
@@ -154,6 +175,11 @@ export const getRequestedCredentialToBePresented: GetRequestedCredentialToBePres
|
|
154
175
|
*/
|
155
176
|
export const completeUserAuthorizationWithFormPostJwtMode: CompleteUserAuthorizationWithFormPostJwtMode =
|
156
177
|
async (requestObject, ctx) => {
|
178
|
+
Logger.log(
|
179
|
+
LogLevel.DEBUG,
|
180
|
+
`The requeste credential is not a PersonIdentificationData, completing the user authorization with form_post.jwt mode`
|
181
|
+
);
|
182
|
+
|
157
183
|
const {
|
158
184
|
wiaCryptoContext,
|
159
185
|
pidCryptoContext,
|
@@ -192,6 +218,11 @@ export const completeUserAuthorizationWithFormPostJwtMode: CompleteUserAuthoriza
|
|
192
218
|
.setAudience(requestObject.response_uri)
|
193
219
|
.sign();
|
194
220
|
|
221
|
+
Logger.log(
|
222
|
+
LogLevel.DEBUG,
|
223
|
+
`Wallet instance attestation JWT token: ${wiaWpToken}`
|
224
|
+
);
|
225
|
+
|
195
226
|
/* The path parameter refers to the vp_token variable of the authzResponsePayload and must point to the plain credential which
|
196
227
|
* is cointaned in the `vp` property of the signed jwt token payload
|
197
228
|
*/
|
@@ -212,6 +243,11 @@ export const completeUserAuthorizationWithFormPostJwtMode: CompleteUserAuthoriza
|
|
212
243
|
],
|
213
244
|
};
|
214
245
|
|
246
|
+
Logger.log(
|
247
|
+
LogLevel.DEBUG,
|
248
|
+
`Presentation submission: ${JSON.stringify(presentationSubmission)}`
|
249
|
+
);
|
250
|
+
|
215
251
|
const authzResponsePayload = encodeBase64(
|
216
252
|
JSON.stringify({
|
217
253
|
state: requestObject.state,
|
@@ -220,6 +256,11 @@ export const completeUserAuthorizationWithFormPostJwtMode: CompleteUserAuthoriza
|
|
220
256
|
})
|
221
257
|
);
|
222
258
|
|
259
|
+
Logger.log(
|
260
|
+
LogLevel.DEBUG,
|
261
|
+
`Authz response payload: ${authzResponsePayload}`
|
262
|
+
);
|
263
|
+
|
223
264
|
// Note: according to the spec, the response should be encrypted with the public key of the RP however this is not implemented yet
|
224
265
|
// https://openid.net/specs/openid-4-verifiable-presentations-1_0.html#name-signed-and-encrypted-response
|
225
266
|
// const rsaPublicJwk = chooseRSAPublicKeyToEncrypt(rpConf);
|
@@ -232,6 +273,7 @@ export const completeUserAuthorizationWithFormPostJwtMode: CompleteUserAuthoriza
|
|
232
273
|
const body = new URLSearchParams({
|
233
274
|
response: authzResponsePayload,
|
234
275
|
}).toString();
|
276
|
+
|
235
277
|
const resUriRes = await appFetch(requestObject.response_uri, {
|
236
278
|
method: "POST",
|
237
279
|
headers: {
|
@@ -244,6 +286,10 @@ export const completeUserAuthorizationWithFormPostJwtMode: CompleteUserAuthoriza
|
|
244
286
|
|
245
287
|
const responseUri = ResponseUriResultShape.safeParse(resUriRes);
|
246
288
|
if (!responseUri.success) {
|
289
|
+
Logger.log(
|
290
|
+
LogLevel.ERROR,
|
291
|
+
`Error while validating the response uri: ${responseUri.error.message}`
|
292
|
+
);
|
247
293
|
throw new ValidationFailed({
|
248
294
|
message: "Response Uri validation failed",
|
249
295
|
reason: responseUri.error.message,
|
@@ -271,8 +317,16 @@ export const parseAuthorizationResponse = (
|
|
271
317
|
if (!authResParsed.success) {
|
272
318
|
const authErr = AuthorizationErrorShape.safeParse(authRes);
|
273
319
|
if (!authErr.success) {
|
320
|
+
Logger.log(
|
321
|
+
LogLevel.ERROR,
|
322
|
+
`Error while parsing the authorization response: ${authResParsed.error.message}`
|
323
|
+
);
|
274
324
|
throw new AuthorizationError(authResParsed.error.message); // an error occured while parsing the result and the error
|
275
325
|
}
|
326
|
+
Logger.log(
|
327
|
+
LogLevel.ERROR,
|
328
|
+
`Error while authorizating with the idp: ${JSON.stringify(authErr)}`
|
329
|
+
);
|
276
330
|
throw new AuthorizationIdpError(
|
277
331
|
authErr.data.error,
|
278
332
|
authErr.data.error_description
|