@pagopa/io-react-native-wallet 0.28.2 → 0.30.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 +12 -0
- 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 +9 -8
- package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/commonjs/credential/presentation/03-get-request-object.js +3 -2
- package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/05-verify-request-object.js +57 -22
- package/lib/commonjs/credential/presentation/05-verify-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +43 -16
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +16 -4
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js +85 -3
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/README.md +27 -9
- package/lib/commonjs/credential/presentation/errors.js +28 -23
- package/lib/commonjs/credential/presentation/errors.js.map +1 -1
- package/lib/commonjs/credential/presentation/index.js +6 -0
- package/lib/commonjs/credential/presentation/index.js.map +1 -1
- package/lib/commonjs/credential/presentation/types.js +14 -7
- 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/error-codes.js +9 -1
- package/lib/commonjs/utils/error-codes.js.map +1 -1
- package/lib/commonjs/utils/errors.js +31 -14
- package/lib/commonjs/utils/errors.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 +12 -0
- 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 +9 -8
- package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/module/credential/presentation/03-get-request-object.js +3 -2
- package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/module/credential/presentation/05-verify-request-object.js +58 -23
- package/lib/module/credential/presentation/05-verify-request-object.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js +44 -17
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +17 -5
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/module/credential/presentation/08-send-authorization-response.js +82 -1
- package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/README.md +27 -9
- package/lib/module/credential/presentation/errors.js +17 -19
- package/lib/module/credential/presentation/errors.js.map +1 -1
- package/lib/module/credential/presentation/index.js +2 -2
- package/lib/module/credential/presentation/index.js.map +1 -1
- package/lib/module/credential/presentation/types.js +12 -6
- 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/error-codes.js +7 -0
- package/lib/module/utils/error-codes.js.map +1 -1
- package/lib/module/utils/errors.js +23 -14
- package/lib/module/utils/errors.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.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 -14
- package/lib/typescript/credential/presentation/01-start-flow.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/03-get-request-object.d.ts +1 -3
- 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 +2 -1
- 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.map +1 -1
- 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 +30 -2
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/errors.d.ts +17 -12
- package/lib/typescript/credential/presentation/errors.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/index.d.ts +3 -3
- package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/types.d.ts +24 -17
- package/lib/typescript/credential/presentation/types.d.ts.map +1 -1
- 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/error-codes.d.ts +8 -0
- package/lib/typescript/utils/error-codes.d.ts.map +1 -1
- package/lib/typescript/utils/errors.d.ts +32 -18
- package/lib/typescript/utils/errors.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 +1 -1
- package/src/credential/issuance/03-start-user-authorization.ts +18 -0
- package/src/credential/issuance/04-complete-user-authorization.ts +51 -0
- 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 +12 -11
- package/src/credential/presentation/03-get-request-object.ts +5 -5
- package/src/credential/presentation/05-verify-request-object.ts +73 -15
- package/src/credential/presentation/07-evaluate-dcql-query.ts +43 -18
- package/src/credential/presentation/07-evaluate-input-descriptor.ts +25 -13
- package/src/credential/presentation/08-send-authorization-response.ts +110 -3
- package/src/credential/presentation/README.md +27 -9
- package/src/credential/presentation/errors.ts +24 -17
- package/src/credential/presentation/index.ts +4 -0
- package/src/credential/presentation/types.ts +22 -10
- 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/error-codes.ts +11 -0
- package/src/utils/errors.ts +59 -29
- 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
@@ -1,4 +1,5 @@
|
|
1
1
|
import { IoWalletError } from "../../utils/errors";
|
2
|
+
export { DcqlError } from "dcql";
|
2
3
|
/**
|
3
4
|
* An error subclass thrown when auth request decode fail
|
4
5
|
*
|
@@ -33,15 +34,13 @@ export declare class InvalidQRCodeError extends IoWalletError {
|
|
33
34
|
constructor(reason: string);
|
34
35
|
}
|
35
36
|
/**
|
36
|
-
* When the
|
37
|
-
*
|
37
|
+
* When the Request Object sent by the Relying Party is not valid
|
38
38
|
*/
|
39
|
-
export declare class
|
39
|
+
export declare class InvalidRequestObjectError extends IoWalletError {
|
40
40
|
code: string;
|
41
|
-
/**
|
42
|
-
|
43
|
-
|
44
|
-
constructor(reason: string);
|
41
|
+
/** Detailed reason for the Request Object validation failure. */
|
42
|
+
reason: string;
|
43
|
+
constructor(message: string, reason?: string);
|
45
44
|
}
|
46
45
|
/**
|
47
46
|
* When some required data is missing to continue because certain attributes are not contained inside the wallet.
|
@@ -54,15 +53,21 @@ export declare class MissingDataError extends IoWalletError {
|
|
54
53
|
*/
|
55
54
|
constructor(missingAttributes: string);
|
56
55
|
}
|
56
|
+
export type NotFoundDetail = {
|
57
|
+
id: string;
|
58
|
+
reason?: string;
|
59
|
+
vctValues?: string[];
|
60
|
+
};
|
57
61
|
/**
|
58
|
-
*
|
59
|
-
*
|
62
|
+
* Error thrown when one or more credentials cannot be found in the wallet
|
63
|
+
* and the presentation request cannot be satisfied.
|
60
64
|
*/
|
61
|
-
export declare class
|
65
|
+
export declare class CredentialsNotFoundError extends IoWalletError {
|
62
66
|
code: string;
|
67
|
+
details: NotFoundDetail[];
|
63
68
|
/**
|
64
|
-
* @param
|
69
|
+
* @param details The details of the credentials that could not be found.
|
65
70
|
*/
|
66
|
-
constructor(
|
71
|
+
constructor(details: NotFoundDetail[]);
|
67
72
|
}
|
68
73
|
//# 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;
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC;;;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;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,aAAa;IAC1D,IAAI,SAAgC;IAEpC,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAgB;CAIpD;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"}
|
@@ -6,8 +6,8 @@ import { verifyRequestObject, type VerifyRequestObject } from "./05-verify-reque
|
|
6
6
|
import { fetchPresentDefinition, type FetchPresentationDefinition } from "./06-fetch-presentation-definition";
|
7
7
|
import { evaluateInputDescriptors, prepareLegacyRemotePresentations, type EvaluateInputDescriptors, type PrepareLegacyRemotePresentations } from "./07-evaluate-input-descriptor";
|
8
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
|
+
import { sendAuthorizationResponse, type SendAuthorizationResponse, sendLegacyAuthorizationResponse, type SendLegacyAuthorizationResponse, sendAuthorizationErrorResponse, type SendAuthorizationErrorResponse } from "./08-send-authorization-response";
|
10
10
|
import * as Errors from "./errors";
|
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, };
|
11
|
+
export { startFlowFromQR, evaluateRelyingPartyTrust, getRequestObject, getJwksFromConfig, verifyRequestObject, fetchPresentDefinition, evaluateInputDescriptors, evaluateDcqlQuery, prepareLegacyRemotePresentations, prepareRemotePresentations, sendAuthorizationResponse, sendLegacyAuthorizationResponse, sendAuthorizationErrorResponse, Errors, };
|
12
|
+
export type { StartFlow, EvaluateRelyingPartyTrust, GetRequestObject, FetchJwks, VerifyRequestObject, FetchPresentationDefinition, EvaluateInputDescriptors, EvaluateDcqlQuery, PrepareLegacyRemotePresentations, PrepareRemotePresentations, SendAuthorizationResponse, SendLegacyAuthorizationResponse, SendAuthorizationErrorResponse, };
|
13
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,wBAAwB,EACxB,gCAAgC,EAChC,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,EACtC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,+BAA+B,EAC/B,KAAK,+BAA+B,
|
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,wBAAwB,EACxB,gCAAgC,EAChC,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,EACtC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,+BAA+B,EAC/B,KAAK,+BAA+B,EACpC,8BAA8B,EAC9B,KAAK,8BAA8B,EACpC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,EAC1B,yBAAyB,EACzB,+BAA+B,EAC/B,8BAA8B,EAC9B,MAAM,GACP,CAAC;AACF,YAAY,EACV,SAAS,EACT,yBAAyB,EACzB,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,EAC1B,yBAAyB,EACzB,+BAA+B,EAC/B,8BAA8B,GAC/B,CAAC"}
|
@@ -755,14 +755,32 @@ export declare const RequestObjectWalletCapabilities: z.ZodObject<{
|
|
755
755
|
wallet_nonce?: string | undefined;
|
756
756
|
}>;
|
757
757
|
/**
|
758
|
-
*
|
759
|
-
*
|
758
|
+
* This type models the possible error responses the OpenID4VP protocol allows for a presentation of a credential.
|
759
|
+
* When the Wallet encounters one of these errors, it will notify the Relying Party through the `response_uri` endpoint.
|
760
|
+
* See https://italia.github.io/eid-wallet-it-docs/versione-corrente/en/pid-eaa-presentation.html#authorization-response-errors for more information.
|
760
761
|
*/
|
761
|
-
export type
|
762
|
+
export type ErrorResponse = z.infer<typeof ErrorResponse>;
|
763
|
+
export declare const ErrorResponse: z.ZodEnum<["invalid_request_object", "invalid_request_uri", "vp_formats_not_supported", "invalid_request", "access_denied", "invalid_client"]>;
|
762
764
|
/**
|
763
|
-
*
|
765
|
+
* Authorization Response payload sent to the Relying Party.
|
764
766
|
*/
|
765
|
-
export
|
767
|
+
export type DirectAuthorizationBodyPayload = z.infer<typeof DirectAuthorizationBodyPayload>;
|
768
|
+
export declare const DirectAuthorizationBodyPayload: z.ZodUnion<[z.ZodObject<{
|
769
|
+
vp_token: z.ZodRecord<z.ZodString, z.ZodString>;
|
770
|
+
}, "strip", z.ZodTypeAny, {
|
771
|
+
vp_token: Record<string, string>;
|
772
|
+
}, {
|
773
|
+
vp_token: Record<string, string>;
|
774
|
+
}>, z.ZodObject<{
|
775
|
+
error: z.ZodEnum<["invalid_request_object", "invalid_request_uri", "vp_formats_not_supported", "invalid_request", "access_denied", "invalid_client"]>;
|
776
|
+
error_description: z.ZodString;
|
777
|
+
}, "strip", z.ZodTypeAny, {
|
778
|
+
error: "invalid_request_object" | "invalid_request_uri" | "vp_formats_not_supported" | "invalid_request" | "access_denied" | "invalid_client";
|
779
|
+
error_description: string;
|
780
|
+
}, {
|
781
|
+
error: "invalid_request_object" | "invalid_request_uri" | "vp_formats_not_supported" | "invalid_request" | "access_denied" | "invalid_client";
|
782
|
+
error_description: string;
|
783
|
+
}>, z.ZodObject<{
|
766
784
|
vp_token: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
767
785
|
presentation_submission: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
768
786
|
}, "strip", z.ZodTypeAny, {
|
@@ -771,16 +789,5 @@ export declare const LegacyDirectAuthorizationBodyPayload: z.ZodObject<{
|
|
771
789
|
}, {
|
772
790
|
presentation_submission: Record<string, unknown>;
|
773
791
|
vp_token?: string | string[] | undefined;
|
774
|
-
}>;
|
775
|
-
/**
|
776
|
-
* Authorization Response payload when using DCQL queries.
|
777
|
-
*/
|
778
|
-
export type DirectAuthorizationBodyPayload = z.infer<typeof DirectAuthorizationBodyPayload>;
|
779
|
-
export declare const DirectAuthorizationBodyPayload: z.ZodObject<{
|
780
|
-
vp_token: z.ZodRecord<z.ZodString, z.ZodString>;
|
781
|
-
}, "strip", z.ZodTypeAny, {
|
782
|
-
vp_token: Record<string, string>;
|
783
|
-
}, {
|
784
|
-
vp_token: Record<string, string>;
|
785
|
-
}>;
|
792
|
+
}>]>;
|
786
793
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/credential/presentation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACO,MAAM;IACzB,MAAM,EAAE;IACsC,aAAa;CACzE,CAAC;AAEF;;;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M,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;EAWzB,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,+BAA+B,CACvC,CAAC;AACF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG1C,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,eAAO,MAAM,aAAa,gJAOxB,CAAC;AAUH;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,8BAA8B,CACtC,CAAC;AACF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;IAMzC,CAAC"}
|
@@ -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,MAAM,UAAU,CAAC;AAClC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,yBAAyB,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,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,
|
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,MAAM,UAAU,CAAC;AAClC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,yBAAyB,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,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"}
|
@@ -40,6 +40,14 @@ export declare const WalletProviderResponseErrorCodes: {
|
|
40
40
|
*/
|
41
41
|
readonly WalletInstanceNotFound: "ERR_IO_WALLET_INSTANCE_NOT_FOUND";
|
42
42
|
};
|
43
|
+
export declare const RelyingPartyResponseErrorCodes: {
|
44
|
+
readonly RelyingPartyGenericError: "ERR_RP_GENERIC_ERROR";
|
45
|
+
/**
|
46
|
+
* An error code thrown then the Relying Party rejects the Wallet's Authorization Response.
|
47
|
+
*/
|
48
|
+
readonly InvalidAuthorizationResponse: "ERR_RP_INVALID_AUTHORIZATION_RESPONSE";
|
49
|
+
};
|
43
50
|
export type IssuerResponseErrorCode = (typeof IssuerResponseErrorCodes)[keyof typeof IssuerResponseErrorCodes];
|
44
51
|
export type WalletProviderResponseErrorCode = (typeof WalletProviderResponseErrorCodes)[keyof typeof WalletProviderResponseErrorCodes];
|
52
|
+
export type RelyingPartyResponseErrorCode = (typeof RelyingPartyResponseErrorCodes)[keyof typeof RelyingPartyResponseErrorCodes];
|
45
53
|
//# sourceMappingURL=error-codes.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../src/utils/error-codes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB;;IAEnC;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AAEX,eAAO,MAAM,gCAAgC;;IAE3C;;OAEG;;IAEH;;OAEG;;IAGH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC;AAE3E,MAAM,MAAM,+BAA+B,GACzC,CAAC,OAAO,gCAAgC,CAAC,CAAC,MAAM,OAAO,gCAAgC,CAAC,CAAC"}
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../src/utils/error-codes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB;;IAEnC;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AAEX,eAAO,MAAM,gCAAgC;;IAE3C;;OAEG;;IAEH;;OAEG;;IAGH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AAEX,eAAO,MAAM,8BAA8B;;IAEzC;;OAEG;;CAEK,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC;AAE3E,MAAM,MAAM,+BAA+B,GACzC,CAAC,OAAO,gCAAgC,CAAC,CAAC,MAAM,OAAO,gCAAgC,CAAC,CAAC;AAE3F,MAAM,MAAM,6BAA6B,GACvC,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,OAAO,8BAA8B,CAAC,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { ProblemDetail } from "../client/generated/wallet-provider";
|
2
2
|
import type { CredentialIssuerEntityConfiguration } from "../trust";
|
3
|
-
import { IssuerResponseErrorCodes, WalletProviderResponseErrorCodes, type IssuerResponseErrorCode, type WalletProviderResponseErrorCode } from "./error-codes";
|
4
|
-
export { IssuerResponseErrorCodes, WalletProviderResponseErrorCodes };
|
3
|
+
import { IssuerResponseErrorCodes, WalletProviderResponseErrorCodes, RelyingPartyResponseErrorCodes, type IssuerResponseErrorCode, type WalletProviderResponseErrorCode, type RelyingPartyResponseErrorCode } from "./error-codes";
|
4
|
+
export { IssuerResponseErrorCodes, WalletProviderResponseErrorCodes, RelyingPartyResponseErrorCodes, };
|
5
5
|
type GenericErrorReason = string | Record<string, unknown>;
|
6
6
|
/**
|
7
7
|
* utility to format a set of attributes into an error message string
|
@@ -62,8 +62,6 @@ export declare class UnexpectedStatusCodeError extends IoWalletError {
|
|
62
62
|
/**
|
63
63
|
* An error subclass thrown when an Issuer HTTP request fails.
|
64
64
|
* The specific error can be found in the `code` property.
|
65
|
-
*
|
66
|
-
* The class is generic over the error code to narrow down the reason.
|
67
65
|
*/
|
68
66
|
export declare class IssuerResponseError extends UnexpectedStatusCodeError {
|
69
67
|
code: IssuerResponseErrorCode;
|
@@ -88,6 +86,19 @@ export declare class WalletProviderResponseError extends UnexpectedStatusCodeErr
|
|
88
86
|
statusCode: number;
|
89
87
|
});
|
90
88
|
}
|
89
|
+
/**
|
90
|
+
* An error subclass thrown when a Relying Party HTTP request fails.
|
91
|
+
* The specific error can be found in the `code` property.
|
92
|
+
*/
|
93
|
+
export declare class RelyingPartyResponseError extends UnexpectedStatusCodeError {
|
94
|
+
code: RelyingPartyResponseErrorCode;
|
95
|
+
constructor(params: {
|
96
|
+
code?: RelyingPartyResponseErrorCode;
|
97
|
+
message: string;
|
98
|
+
reason: GenericErrorReason;
|
99
|
+
statusCode: number;
|
100
|
+
});
|
101
|
+
}
|
91
102
|
type LocalizedIssuanceError = {
|
92
103
|
[locale: string]: {
|
93
104
|
title: string;
|
@@ -106,21 +117,24 @@ export declare function extractErrorMessageFromIssuerConf(errorCode: string, { i
|
|
106
117
|
issuerConf: CredentialIssuerEntityConfiguration["payload"]["metadata"];
|
107
118
|
credentialType: string;
|
108
119
|
}): LocalizedIssuanceError | undefined;
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
120
|
+
export declare const isIssuerResponseError: (error: unknown, code?: IssuerResponseErrorCode | undefined) => error is IssuerResponseError;
|
121
|
+
export declare const isWalletProviderResponseError: (error: unknown, code?: WalletProviderResponseErrorCode | undefined) => error is WalletProviderResponseError;
|
122
|
+
export declare const isRelyingPartyResponseError: (error: unknown, code?: RelyingPartyResponseErrorCode | undefined) => error is RelyingPartyResponseError;
|
123
|
+
type ErrorCodeMap = {
|
124
|
+
type: typeof IssuerResponseError;
|
125
|
+
code: IssuerResponseErrorCode;
|
126
|
+
} | {
|
127
|
+
type: typeof WalletProviderResponseError;
|
128
|
+
code: WalletProviderResponseErrorCode;
|
129
|
+
} | {
|
130
|
+
type: typeof RelyingPartyResponseError;
|
131
|
+
code: RelyingPartyResponseErrorCode;
|
132
|
+
};
|
133
|
+
type ExtractErrorCode<T> = Extract<ErrorCodeMap, {
|
134
|
+
type: T;
|
135
|
+
}>["code"];
|
122
136
|
type ErrorCase<T> = {
|
123
|
-
code:
|
137
|
+
code: ExtractErrorCode<T>;
|
124
138
|
message: string;
|
125
139
|
reason?: GenericErrorReason;
|
126
140
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,8BAA8B,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EACnC,MAAM,eAAe,CAAC;A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CAC/B,GACD;IACE,IAAI,EAAE,OAAO,2BAA2B,CAAC;IACzC,IAAI,EAAE,+BAA+B,CAAC;CACvC,GACD;IACE,IAAI,EAAE,OAAO,yBAAyB,CAAC;IACvC,IAAI,EAAE,6BAA6B,CAAC;CACrC,CAAC;AAEN,KAAK,gBAAgB,CAAC,CAAC,IAAI,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,KAAK,SAAS,CAAC,CAAC,IAAI;IAClB,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,qBAAa,oBAAoB,CAAC,CAAC,SAAS,OAAO,yBAAyB;IAK9D,OAAO,CAAC,UAAU;IAJ9B,OAAO,CAAC,UAAU,CAEX;gBAEa,UAAU,EAAE,CAAC;IAEjC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IAKjD,SAAS,CAAC,aAAa,EAAE,yBAAyB;CAUnD"}
|
@@ -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
@@ -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.
|
@@ -95,6 +96,10 @@ export const buildAuthorizationUrl: BuildAuthorizationUrl = async (
|
|
95
96
|
*/
|
96
97
|
export const completeUserAuthorizationWithQueryMode: CompleteUserAuthorizationWithQueryMode =
|
97
98
|
async (authRedirectUrl) => {
|
99
|
+
Logger.log(
|
100
|
+
LogLevel.DEBUG,
|
101
|
+
`The requeste credential is a PersonIdentificationData, completing the user authorization with query mode`
|
102
|
+
);
|
98
103
|
const query = parseUrl(authRedirectUrl).query;
|
99
104
|
|
100
105
|
return parseAuthorizationResponse(query);
|
@@ -114,6 +119,10 @@ export const completeUserAuthorizationWithQueryMode: CompleteUserAuthorizationWi
|
|
114
119
|
*/
|
115
120
|
export const getRequestedCredentialToBePresented: GetRequestedCredentialToBePresented =
|
116
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
|
+
);
|
117
126
|
const authzRequestEndpoint =
|
118
127
|
issuerConf.oauth_authorization_server.authorization_endpoint;
|
119
128
|
const params = new URLSearchParams({
|
@@ -121,6 +130,11 @@ export const getRequestedCredentialToBePresented: GetRequestedCredentialToBePres
|
|
121
130
|
request_uri: issuerRequestUri,
|
122
131
|
});
|
123
132
|
|
133
|
+
Logger.log(
|
134
|
+
LogLevel.DEBUG,
|
135
|
+
`Requesting the request object to ${authzRequestEndpoint}?${params.toString()}`
|
136
|
+
);
|
137
|
+
|
124
138
|
const requestObject = await appFetch(
|
125
139
|
`${authzRequestEndpoint}?${params.toString()}`,
|
126
140
|
{ method: "GET" }
|
@@ -131,6 +145,10 @@ export const getRequestedCredentialToBePresented: GetRequestedCredentialToBePres
|
|
131
145
|
.then((reqObj) => RequestObject.safeParse(reqObj.payload));
|
132
146
|
|
133
147
|
if (!requestObject.success) {
|
148
|
+
Logger.log(
|
149
|
+
LogLevel.ERROR,
|
150
|
+
`Error while validating the response object: ${requestObject.error.message}`
|
151
|
+
);
|
134
152
|
throw new ValidationFailed({
|
135
153
|
message: "Request Object validation failed",
|
136
154
|
reason: requestObject.error.message,
|
@@ -157,6 +175,11 @@ export const getRequestedCredentialToBePresented: GetRequestedCredentialToBePres
|
|
157
175
|
*/
|
158
176
|
export const completeUserAuthorizationWithFormPostJwtMode: CompleteUserAuthorizationWithFormPostJwtMode =
|
159
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
|
+
|
160
183
|
const {
|
161
184
|
wiaCryptoContext,
|
162
185
|
pidCryptoContext,
|
@@ -195,6 +218,11 @@ export const completeUserAuthorizationWithFormPostJwtMode: CompleteUserAuthoriza
|
|
195
218
|
.setAudience(requestObject.response_uri)
|
196
219
|
.sign();
|
197
220
|
|
221
|
+
Logger.log(
|
222
|
+
LogLevel.DEBUG,
|
223
|
+
`Wallet instance attestation JWT token: ${wiaWpToken}`
|
224
|
+
);
|
225
|
+
|
198
226
|
/* The path parameter refers to the vp_token variable of the authzResponsePayload and must point to the plain credential which
|
199
227
|
* is cointaned in the `vp` property of the signed jwt token payload
|
200
228
|
*/
|
@@ -215,6 +243,11 @@ export const completeUserAuthorizationWithFormPostJwtMode: CompleteUserAuthoriza
|
|
215
243
|
],
|
216
244
|
};
|
217
245
|
|
246
|
+
Logger.log(
|
247
|
+
LogLevel.DEBUG,
|
248
|
+
`Presentation submission: ${JSON.stringify(presentationSubmission)}`
|
249
|
+
);
|
250
|
+
|
218
251
|
const authzResponsePayload = encodeBase64(
|
219
252
|
JSON.stringify({
|
220
253
|
state: requestObject.state,
|
@@ -223,6 +256,11 @@ export const completeUserAuthorizationWithFormPostJwtMode: CompleteUserAuthoriza
|
|
223
256
|
})
|
224
257
|
);
|
225
258
|
|
259
|
+
Logger.log(
|
260
|
+
LogLevel.DEBUG,
|
261
|
+
`Authz response payload: ${authzResponsePayload}`
|
262
|
+
);
|
263
|
+
|
226
264
|
// Note: according to the spec, the response should be encrypted with the public key of the RP however this is not implemented yet
|
227
265
|
// https://openid.net/specs/openid-4-verifiable-presentations-1_0.html#name-signed-and-encrypted-response
|
228
266
|
// const rsaPublicJwk = chooseRSAPublicKeyToEncrypt(rpConf);
|
@@ -235,6 +273,7 @@ export const completeUserAuthorizationWithFormPostJwtMode: CompleteUserAuthoriza
|
|
235
273
|
const body = new URLSearchParams({
|
236
274
|
response: authzResponsePayload,
|
237
275
|
}).toString();
|
276
|
+
|
238
277
|
const resUriRes = await appFetch(requestObject.response_uri, {
|
239
278
|
method: "POST",
|
240
279
|
headers: {
|
@@ -247,6 +286,10 @@ export const completeUserAuthorizationWithFormPostJwtMode: CompleteUserAuthoriza
|
|
247
286
|
|
248
287
|
const responseUri = ResponseUriResultShape.safeParse(resUriRes);
|
249
288
|
if (!responseUri.success) {
|
289
|
+
Logger.log(
|
290
|
+
LogLevel.ERROR,
|
291
|
+
`Error while validating the response uri: ${responseUri.error.message}`
|
292
|
+
);
|
250
293
|
throw new ValidationFailed({
|
251
294
|
message: "Response Uri validation failed",
|
252
295
|
reason: responseUri.error.message,
|
@@ -274,8 +317,16 @@ export const parseAuthorizationResponse = (
|
|
274
317
|
if (!authResParsed.success) {
|
275
318
|
const authErr = AuthorizationErrorShape.safeParse(authRes);
|
276
319
|
if (!authErr.success) {
|
320
|
+
Logger.log(
|
321
|
+
LogLevel.ERROR,
|
322
|
+
`Error while parsing the authorization response: ${authResParsed.error.message}`
|
323
|
+
);
|
277
324
|
throw new AuthorizationError(authResParsed.error.message); // an error occured while parsing the result and the error
|
278
325
|
}
|
326
|
+
Logger.log(
|
327
|
+
LogLevel.ERROR,
|
328
|
+
`Error while authorizating with the idp: ${JSON.stringify(authErr)}`
|
329
|
+
);
|
279
330
|
throw new AuthorizationIdpError(
|
280
331
|
authErr.data.error,
|
281
332
|
authErr.data.error_description
|
@@ -10,6 +10,7 @@ import { ASSERTION_TYPE } from "./const";
|
|
10
10
|
import { TokenResponse } from "./types";
|
11
11
|
import { IssuerResponseError, ValidationFailed } from "../../utils/errors";
|
12
12
|
import type { CompleteUserAuthorizationWithQueryMode } from "./04-complete-user-authorization";
|
13
|
+
import { LogLevel, Logger } from "../../utils/logging";
|
13
14
|
|
14
15
|
export type AuthorizeAccess = (
|
15
16
|
issuerConf: Out<EvaluateIssuerTrust>["issuerConf"],
|
@@ -76,6 +77,8 @@ export const authorizeAccess: AuthorizeAccess = async (
|
|
76
77
|
dPopCryptoContext
|
77
78
|
);
|
78
79
|
|
80
|
+
Logger.log(LogLevel.DEBUG, `Token request DPoP: ${tokenRequestSignedDPop}`);
|
81
|
+
|
79
82
|
const signedWiaPoP = await createPopToken(
|
80
83
|
{
|
81
84
|
jti: `${uuidv4()}`,
|
@@ -85,6 +88,8 @@ export const authorizeAccess: AuthorizeAccess = async (
|
|
85
88
|
wiaCryptoContext
|
86
89
|
);
|
87
90
|
|
91
|
+
Logger.log(LogLevel.DEBUG, `WIA DPoP token: ${signedWiaPoP}`);
|
92
|
+
|
88
93
|
const requestBody = {
|
89
94
|
grant_type: "authorization_code",
|
90
95
|
client_id: clientId,
|
@@ -96,6 +101,12 @@ export const authorizeAccess: AuthorizeAccess = async (
|
|
96
101
|
};
|
97
102
|
|
98
103
|
const authorizationRequestFormBody = new URLSearchParams(requestBody);
|
104
|
+
|
105
|
+
Logger.log(
|
106
|
+
LogLevel.DEBUG,
|
107
|
+
`Auth form request body: ${authorizationRequestFormBody}`
|
108
|
+
);
|
109
|
+
|
99
110
|
const tokenRes = await appFetch(tokenUrl, {
|
100
111
|
method: "POST",
|
101
112
|
headers: {
|
@@ -109,6 +120,11 @@ export const authorizeAccess: AuthorizeAccess = async (
|
|
109
120
|
.then((body) => TokenResponse.safeParse(body));
|
110
121
|
|
111
122
|
if (!tokenRes.success) {
|
123
|
+
Logger.log(
|
124
|
+
LogLevel.ERROR,
|
125
|
+
`Token Response validation failed: ${tokenRes.error.message}`
|
126
|
+
);
|
127
|
+
|
112
128
|
throw new ValidationFailed({
|
113
129
|
message: "Token Response validation failed",
|
114
130
|
reason: tokenRes.error.message,
|