@pagopa/io-react-native-wallet 0.24.1 → 0.25.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/client/generated/wallet-provider.js +39 -16
- package/lib/commonjs/client/generated/wallet-provider.js.map +1 -1
- package/lib/commonjs/client/index.js +25 -10
- package/lib/commonjs/client/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js +1 -1
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +21 -14
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/05-authorize-access.js +5 -2
- package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/commonjs/credential/issuance/06-obtain-credential.js +26 -17
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/README.md +8 -14
- package/lib/commonjs/credential/issuance/errors.js +52 -0
- package/lib/commonjs/credential/issuance/errors.js.map +1 -0
- package/lib/commonjs/credential/issuance/index.js +7 -2
- package/lib/commonjs/credential/issuance/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/types.js +1 -5
- package/lib/commonjs/credential/issuance/types.js.map +1 -1
- package/lib/commonjs/credential/presentation/01-start-flow.js +1 -1
- package/lib/commonjs/credential/presentation/01-start-flow.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/04-send-authorization-response.js +2 -2
- package/lib/commonjs/credential/presentation/04-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/errors.js +49 -0
- package/lib/commonjs/credential/presentation/errors.js.map +1 -0
- package/lib/commonjs/credential/presentation/index.js +5 -0
- package/lib/commonjs/credential/presentation/index.js.map +1 -1
- package/lib/commonjs/credential/status/02-status-attestation.js +8 -6
- package/lib/commonjs/credential/status/02-status-attestation.js.map +1 -1
- package/lib/commonjs/credential/status/README.md +5 -2
- package/lib/commonjs/credential/status/types.js +1 -14
- package/lib/commonjs/credential/status/types.js.map +1 -1
- package/lib/commonjs/sd-jwt/errors.js +40 -0
- package/lib/commonjs/sd-jwt/errors.js.map +1 -0
- package/lib/commonjs/sd-jwt/index.js +8 -4
- package/lib/commonjs/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/verifier.js +5 -1
- package/lib/commonjs/sd-jwt/verifier.js.map +1 -1
- package/lib/commonjs/trust/index.js +2 -2
- package/lib/commonjs/trust/index.js.map +1 -1
- package/lib/commonjs/utils/decoder.js +3 -1
- package/lib/commonjs/utils/decoder.js.map +1 -1
- package/lib/commonjs/utils/error-codes.js +51 -0
- package/lib/commonjs/utils/error-codes.js.map +1 -0
- package/lib/commonjs/utils/errors.js +119 -463
- package/lib/commonjs/utils/errors.js.map +1 -1
- package/lib/commonjs/utils/misc.js +21 -14
- package/lib/commonjs/utils/misc.js.map +1 -1
- package/lib/commonjs/utils/par.js +2 -1
- package/lib/commonjs/utils/par.js.map +1 -1
- package/lib/commonjs/wallet-instance/README.md +26 -5
- package/lib/commonjs/wallet-instance/index.js +33 -7
- package/lib/commonjs/wallet-instance/index.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/README.md +8 -2
- package/lib/commonjs/wallet-instance-attestation/issuing.js +13 -10
- package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/module/client/generated/wallet-provider.js +31 -11
- package/lib/module/client/generated/wallet-provider.js.map +1 -1
- package/lib/module/client/index.js +22 -8
- package/lib/module/client/index.js.map +1 -1
- package/lib/module/credential/issuance/03-start-user-authorization.js +1 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js +16 -9
- package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/05-authorize-access.js +7 -4
- package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js +29 -20
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/README.md +8 -14
- package/lib/module/credential/issuance/errors.js +44 -0
- package/lib/module/credential/issuance/errors.js.map +1 -0
- package/lib/module/credential/issuance/index.js +3 -2
- package/lib/module/credential/issuance/index.js.map +1 -1
- package/lib/module/credential/issuance/types.js +0 -3
- package/lib/module/credential/issuance/types.js.map +1 -1
- package/lib/module/credential/presentation/01-start-flow.js +1 -1
- package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/module/credential/presentation/03-get-request-object.js +3 -3
- package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/module/credential/presentation/04-send-authorization-response.js +3 -3
- package/lib/module/credential/presentation/04-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/errors.js +42 -0
- package/lib/module/credential/presentation/errors.js.map +1 -0
- package/lib/module/credential/presentation/index.js +2 -1
- package/lib/module/credential/presentation/index.js.map +1 -1
- package/lib/module/credential/status/02-status-attestation.js +11 -9
- package/lib/module/credential/status/02-status-attestation.js.map +1 -1
- package/lib/module/credential/status/README.md +5 -2
- package/lib/module/credential/status/types.js +0 -12
- package/lib/module/credential/status/types.js.map +1 -1
- package/lib/module/sd-jwt/errors.js +32 -0
- package/lib/module/sd-jwt/errors.js.map +1 -0
- package/lib/module/sd-jwt/index.js +5 -5
- package/lib/module/sd-jwt/index.js.map +1 -1
- package/lib/module/sd-jwt/verifier.js +5 -1
- package/lib/module/sd-jwt/verifier.js.map +1 -1
- package/lib/module/trust/index.js +3 -3
- package/lib/module/trust/index.js.map +1 -1
- package/lib/module/utils/decoder.js +3 -1
- package/lib/module/utils/decoder.js.map +1 -1
- package/lib/module/utils/error-codes.js +43 -0
- package/lib/module/utils/error-codes.js.map +1 -0
- package/lib/module/utils/errors.js +98 -438
- package/lib/module/utils/errors.js.map +1 -1
- package/lib/module/utils/misc.js +18 -11
- package/lib/module/utils/misc.js.map +1 -1
- package/lib/module/utils/par.js +3 -2
- package/lib/module/utils/par.js.map +1 -1
- package/lib/module/wallet-instance/README.md +26 -5
- package/lib/module/wallet-instance/index.js +32 -7
- package/lib/module/wallet-instance/index.js.map +1 -1
- package/lib/module/wallet-instance-attestation/README.md +8 -2
- package/lib/module/wallet-instance-attestation/issuing.js +15 -12
- package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/typescript/client/generated/wallet-provider.d.ts +138 -27
- package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -1
- package/lib/typescript/client/index.d.ts +7 -1
- package/lib/typescript/client/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +1 -1
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +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.map +1 -1
- package/lib/typescript/credential/issuance/errors.d.ts +28 -0
- package/lib/typescript/credential/issuance/errors.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/index.d.ts +3 -2
- package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/types.d.ts +0 -8
- package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/04-send-authorization-response.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/errors.d.ts +25 -0
- package/lib/typescript/credential/presentation/errors.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/index.d.ts +2 -1
- package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
- package/lib/typescript/credential/status/02-status-attestation.d.ts.map +1 -1
- package/lib/typescript/credential/status/types.d.ts +0 -15
- package/lib/typescript/credential/status/types.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/errors.d.ts +20 -0
- package/lib/typescript/sd-jwt/errors.d.ts.map +1 -0
- package/lib/typescript/sd-jwt/index.d.ts +3 -2
- package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
- package/lib/typescript/utils/error-codes.d.ts +45 -0
- package/lib/typescript/utils/error-codes.d.ts.map +1 -0
- package/lib/typescript/utils/errors.d.ts +88 -225
- package/lib/typescript/utils/errors.d.ts.map +1 -1
- package/lib/typescript/utils/misc.d.ts +9 -4
- 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 +17 -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/lib/typescript/wallet-instance-attestation/types.d.ts +4 -4
- package/package.json +1 -1
- package/src/client/generated/wallet-provider.ts +43 -13
- package/src/client/index.ts +28 -15
- package/src/credential/issuance/03-start-user-authorization.ts +1 -1
- package/src/credential/issuance/04-complete-user-authorization.ts +21 -21
- package/src/credential/issuance/05-authorize-access.ts +7 -4
- package/src/credential/issuance/06-obtain-credential.ts +39 -39
- package/src/credential/issuance/README.md +8 -14
- package/src/credential/issuance/errors.ts +44 -0
- package/src/credential/issuance/index.ts +4 -2
- package/src/credential/issuance/types.ts +0 -8
- package/src/credential/presentation/01-start-flow.ts +1 -1
- package/src/credential/presentation/03-get-request-object.ts +3 -3
- package/src/credential/presentation/04-send-authorization-response.ts +3 -3
- package/src/credential/presentation/errors.ts +41 -0
- package/src/credential/presentation/index.ts +2 -0
- package/src/credential/status/02-status-attestation.ts +17 -25
- package/src/credential/status/README.md +5 -2
- package/src/credential/status/types.ts +0 -15
- package/src/sd-jwt/errors.ts +39 -0
- package/src/sd-jwt/index.ts +5 -8
- package/src/sd-jwt/verifier.ts +5 -5
- package/src/trust/index.ts +3 -3
- package/src/utils/decoder.ts +3 -3
- package/src/utils/error-codes.ts +50 -0
- package/src/utils/errors.ts +152 -476
- package/src/utils/misc.ts +20 -17
- package/src/utils/par.ts +3 -2
- package/src/wallet-instance/README.md +26 -5
- package/src/wallet-instance/index.ts +40 -18
- package/src/wallet-instance-attestation/README.md +8 -2
- package/src/wallet-instance-attestation/issuing.ts +28 -36
@@ -3,6 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.Errors = void 0;
|
6
7
|
Object.defineProperty(exports, "authorizeAccess", {
|
7
8
|
enumerable: true,
|
8
9
|
get: function () {
|
@@ -39,10 +40,10 @@ Object.defineProperty(exports, "obtainCredential", {
|
|
39
40
|
return _obtainCredential.obtainCredential;
|
40
41
|
}
|
41
42
|
});
|
42
|
-
Object.defineProperty(exports, "
|
43
|
+
Object.defineProperty(exports, "parseAuthorizationResponse", {
|
43
44
|
enumerable: true,
|
44
45
|
get: function () {
|
45
|
-
return _completeUserAuthorization.
|
46
|
+
return _completeUserAuthorization.parseAuthorizationResponse;
|
46
47
|
}
|
47
48
|
});
|
48
49
|
Object.defineProperty(exports, "startUserAuthorization", {
|
@@ -63,4 +64,8 @@ var _completeUserAuthorization = require("./04-complete-user-authorization");
|
|
63
64
|
var _authorizeAccess = require("./05-authorize-access");
|
64
65
|
var _obtainCredential = require("./06-obtain-credential");
|
65
66
|
var _verifyAndParseCredential = require("./07-verify-and-parse-credential");
|
67
|
+
var Errors = _interopRequireWildcard(require("./errors"));
|
68
|
+
exports.Errors = Errors;
|
69
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
70
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
66
71
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_completeUserAuthorization","_authorizeAccess","_obtainCredential","_verifyAndParseCredential"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":"
|
1
|
+
{"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_completeUserAuthorization","_authorizeAccess","_obtainCredential","_verifyAndParseCredential","Errors","_interopRequireWildcard","exports","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAIA,IAAAC,uBAAA,GAAAD,OAAA;AAIA,IAAAE,0BAAA,GAAAF,OAAA;AASA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAIA,IAAAK,yBAAA,GAAAL,OAAA;AAIA,IAAAM,MAAA,GAAAC,uBAAA,CAAAP,OAAA;AAAmCQ,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.TokenResponse = exports.ResponseUriResultShape = exports.CredentialResponse =
|
6
|
+
exports.TokenResponse = exports.ResponseUriResultShape = exports.CredentialResponse = void 0;
|
7
7
|
var _par = require("../../utils/par");
|
8
8
|
var z = _interopRequireWildcard(require("zod"));
|
9
9
|
var _const = require("./const");
|
@@ -33,8 +33,4 @@ const ResponseUriResultShape = z.object({
|
|
33
33
|
redirect_uri: z.string()
|
34
34
|
});
|
35
35
|
exports.ResponseUriResultShape = ResponseUriResultShape;
|
36
|
-
const CredentialIssuanceFailureResponse = z.object({
|
37
|
-
error: z.string()
|
38
|
-
});
|
39
|
-
exports.CredentialIssuanceFailureResponse = CredentialIssuanceFailureResponse;
|
40
36
|
//# sourceMappingURL=types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_par","require","z","_interopRequireWildcard","_const","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TokenResponse","object","access_token","string","authorization_details","array","AuthorizationDetail","c_nonce","c_nonce_expires_in","number","expires_in","token_type","exports","CredentialResponse","credential","format","SupportedCredentialFormat","ResponseUriResultShape","redirect_uri"
|
1
|
+
{"version":3,"names":["_par","require","z","_interopRequireWildcard","_const","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TokenResponse","object","access_token","string","authorization_details","array","AuthorizationDetail","c_nonce","c_nonce_expires_in","number","expires_in","token_type","exports","CredentialResponse","credential","format","SupportedCredentialFormat","ResponseUriResultShape","redirect_uri"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAoD,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WA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C,CAAC;EAC9BC,UAAU,EAAEnC,CAAC,CAACkC,MAAM,CAAC,CAAC;EACtBE,UAAU,EAAEpC,CAAC,CAAC4B,MAAM,CAAC;AACvB,CAAC,CAAC;AAACS,OAAA,CAAAZ,aAAA,GAAAA,aAAA;AAII,MAAMa,kBAAkB,GAAGtC,CAAC,CAAC0B,MAAM,CAAC;EACzCM,OAAO,EAAEhC,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACnBK,kBAAkB,EAAEjC,CAAC,CAACkC,MAAM,CAAC,CAAC;EAC9BK,UAAU,EAAEvC,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACtBY,MAAM,EAAEC;AACV,CAAC,CAAC;;AAEF;AACA;AACA;AAFAJ,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAGO,MAAMI,sBAAsB,GAAG1C,CAAC,CAAC0B,MAAM,CAAC;EAC7CiB,YAAY,EAAE3C,CAAC,CAAC4B,MAAM,CAAC;AACzB,CAAC,CAAC;AAACS,OAAA,CAAAK,sBAAA,GAAAA,sBAAA"}
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.startFlowFromQR = void 0;
|
7
7
|
var z = _interopRequireWildcard(require("zod"));
|
8
8
|
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
9
|
-
var _errors = require("
|
9
|
+
var _errors = require("./errors");
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
12
12
|
const QRCodePayload = z.object({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["z","_interopRequireWildcard","require","_ioReactNativeJwt","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","QRCodePayload","object","protocol","string","resource","clientId","requestURI","startFlowFromQR","qrcode","decoded","decodeBase64","decodedUrl","URL","hostname","searchParams","result","safeParse","success","data","AuthRequestDecodeError","error","message","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/01-start-flow.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;
|
1
|
+
{"version":3,"names":["z","_interopRequireWildcard","require","_ioReactNativeJwt","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","QRCodePayload","object","protocol","string","resource","clientId","requestURI","startFlowFromQR","qrcode","decoded","decodeBase64","decodedUrl","URL","hostname","searchParams","result","safeParse","success","data","AuthRequestDecodeError","error","message","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/01-start-flow.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA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AAC,CAAC8B,MAAM,CAAC,CAAC;EACpBC,QAAQ,EAAE/B,CAAC,CAAC8B,MAAM,CAAC,CAAC;EAAE;EACtBE,QAAQ,EAAEhC,CAAC,CAAC8B,MAAM,CAAC,CAAC;EACpBG,UAAU,EAAEjC,CAAC,CAAC8B,MAAM,CAAC;AACvB,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,eAAoC,GAAIC,MAAM,IAAK;EAC9D,MAAMC,OAAO,GAAG,IAAAC,8BAAY,EAACF,MAAM,CAAC;EACpC,MAAMG,UAAU,GAAG,IAAIC,GAAG,CAACH,OAAO,CAAC;EACnC,MAAMP,QAAQ,GAAGS,UAAU,CAACT,QAAQ;EACpC,MAAME,QAAQ,GAAGO,UAAU,CAACE,QAAQ;EACpC,MAAMP,UAAU,GAAGK,UAAU,CAACG,YAAY,CAAC1B,GAAG,CAAC,aAAa,CAAC;EAC7D,MAAMiB,QAAQ,GAAGM,UAAU,CAACG,YAAY,CAAC1B,GAAG,CAAC,WAAW,CAAC;EAEzD,MAAM2B,MAAM,GAAGf,aAAa,CAACgB,SAAS,CAAC;IACrCd,QAAQ;IACRE,QAAQ;IACRE,UAAU;IACVD;EACF,CAAC,CAAC;EAEF,IAAIU,MAAM,CAACE,OAAO,EAAE;IAClB,OAAOF,MAAM,CAACG,IAAI;EACpB,CAAC,MAAM;IACL,MAAM,IAAIC,8BAAsB,CAACJ,MAAM,CAACK,KAAK,CAACC,OAAO,EAAG,GAAEV,UAAW,EAAC,CAAC;EACzE;AACF,CAAC;AAACW,OAAA,CAAAf,eAAA,GAAAA,eAAA"}
|
@@ -7,7 +7,7 @@ exports.getRequestObject = void 0;
|
|
7
7
|
var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
|
8
8
|
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
9
9
|
var _dpop = require("../../utils/dpop");
|
10
|
-
var _errors = require("
|
10
|
+
var _errors = require("./errors");
|
11
11
|
var _misc = require("../../utils/misc");
|
12
12
|
var _types = require("./types");
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -40,7 +40,7 @@ const getRequestObject = async (requestUri, rpConf, _ref) => {
|
|
40
40
|
Authorization: `DPoP ${walletInstanceAttestation}`,
|
41
41
|
DPoP: signedWalletInstanceDPoP
|
42
42
|
}
|
43
|
-
}).then((0, _misc.
|
43
|
+
}).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.json()).then(responseJson => responseJson.response);
|
44
44
|
const responseJwt = (0, _ioReactNativeJwt.decode)(responseEncodedJwt);
|
45
45
|
|
46
46
|
// verify token signature according to RP's entity configuration
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNativeUuid","_interopRequireDefault","require","_ioReactNativeJwt","_dpop","_errors","_misc","_types","obj","__esModule","default","getRequestObject","requestUri","rpConf","_ref","wiaCryptoContext","appFetch","fetch","walletInstanceAttestation","signedWalletInstanceDPoP","createDPopToken","jti","uuid","v4","htm","htu","ath","sha256ToBase64","responseEncodedJwt","method","headers","Authorization","DPoP","then","
|
1
|
+
{"version":3,"names":["_reactNativeUuid","_interopRequireDefault","require","_ioReactNativeJwt","_dpop","_errors","_misc","_types","obj","__esModule","default","getRequestObject","requestUri","rpConf","_ref","wiaCryptoContext","appFetch","fetch","walletInstanceAttestation","signedWalletInstanceDPoP","createDPopToken","jti","uuid","v4","htm","htu","ath","sha256ToBase64","responseEncodedJwt","method","headers","Authorization","DPoP","then","hasStatusOrThrow","res","json","responseJson","response","responseJwt","decodeJwt","pubKey","wallet_relying_party","jwks","keys","find","_ref2","kid","protectedHeader","NoSuitableKeysFoundInEntityConfiguration","verify","requestObject","RequestObject","parse","payload","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/03-get-request-object.ts"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA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AC6B,oBAAoB,CAACC,IAAI,CAACC,IAAI,CAACC,IAAI,CACvDC,KAAA;MAAA,IAAC;QAAEC;MAAI,CAAC,GAAAD,KAAA;MAAA,OAAKC,GAAG,KAAKR,WAAW,CAACS,eAAe,CAACD,GAAG;IAAA,CACtD,CAAC;IACD,IAAI,CAACN,MAAM,EAAE;MACX,MAAM,IAAIQ,gDAAwC,CAChD,uCACF,CAAC;IACH;IACA,MAAM,IAAAC,wBAAM,EAACtB,kBAAkB,EAAEa,MAAM,CAAC;EAC1C;;EAEA;EACA,MAAMU,aAAa,GAAGC,oBAAa,CAACC,KAAK,CAACd,WAAW,CAACe,OAAO,CAAC;EAE9D,OAAO;IACLH;EACF,CAAC;AACH,CAAC;AAACI,OAAA,CAAA5C,gBAAA,GAAAA,gBAAA"}
|
@@ -7,7 +7,7 @@ exports.sendAuthorizationResponse = exports.AuthorizationResponse = void 0;
|
|
7
7
|
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
8
8
|
var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
|
9
9
|
var WalletInstanceAttestation = _interopRequireWildcard(require("../../wallet-instance-attestation"));
|
10
|
-
var _errors = require("
|
10
|
+
var _errors = require("./errors");
|
11
11
|
var _misc = require("../../utils/misc");
|
12
12
|
var _sdJwt = require("../../sd-jwt");
|
13
13
|
var z = _interopRequireWildcard(require("zod"));
|
@@ -133,7 +133,7 @@ const sendAuthorizationResponse = async (requestObject, rpConf, presentation, _r
|
|
133
133
|
"Content-Type": "application/x-www-form-urlencoded"
|
134
134
|
},
|
135
135
|
body
|
136
|
-
}).then((0, _misc.
|
136
|
+
}).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.json()).then(AuthorizationResponse.parse);
|
137
137
|
};
|
138
138
|
exports.sendAuthorizationResponse = sendAuthorizationResponse;
|
139
139
|
//# sourceMappingURL=04-send-authorization-response.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","_reactNativeUuid","_interopRequireDefault","WalletInstanceAttestation","_interopRequireWildcard","_errors","_misc","_sdJwt","z","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AuthorizationResponse","object","status","string","response_code","optional","exports","chooseRSAPublicKeyToEncrypt","entity","usingRsa256","wallet_relying_party","jwks","keys","filter","jwk","use","kty","NoSuitableKeysFoundInEntityConfiguration","prepareVpToken","requestObject","walletInstanceAttestation","_ref","vc","claims","cryptoCtx","token","vp","paths","disclose","payload","iss","decode","pidKid","getPublicKey","then","_","kid","vp_token","SignJWT","setProtectedHeader","typ","setPayload","jti","uuid","v4","nonce","setAudience","response_uri","setIssuedAt","setExpirationTime","sign","vc_scope","scope","presentation_submission","definition_id","id","descriptor_map","map","p","path","format","sendAuthorizationResponse","rpConf","presentation","_ref2","appFetch","fetch","rsaPublicJwk","authzResponsePayload","JSON","stringify","state","encrypted","EncryptJwe","alg","enc","encrypt","formBody","URLSearchParams","response","body","toString","method","headers","
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_reactNativeUuid","_interopRequireDefault","WalletInstanceAttestation","_interopRequireWildcard","_errors","_misc","_sdJwt","z","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AuthorizationResponse","object","status","string","response_code","optional","exports","chooseRSAPublicKeyToEncrypt","entity","usingRsa256","wallet_relying_party","jwks","keys","filter","jwk","use","kty","NoSuitableKeysFoundInEntityConfiguration","prepareVpToken","requestObject","walletInstanceAttestation","_ref","vc","claims","cryptoCtx","token","vp","paths","disclose","payload","iss","decode","pidKid","getPublicKey","then","_","kid","vp_token","SignJWT","setProtectedHeader","typ","setPayload","jti","uuid","v4","nonce","setAudience","response_uri","setIssuedAt","setExpirationTime","sign","vc_scope","scope","presentation_submission","definition_id","id","descriptor_map","map","p","path","format","sendAuthorizationResponse","rpConf","presentation","_ref2","appFetch","fetch","rsaPublicJwk","authzResponsePayload","JSON","stringify","state","encrypted","EncryptJwe","alg","enc","encrypt","formBody","URLSearchParams","response","body","toString","method","headers","hasStatusOrThrow","res","json","parse"],"sourceRoot":"../../../../src","sources":["credential/presentation/04-send-authorization-response.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AAGA,IAAAQ,CAAA,GAAAJ,uBAAA,CAAAJ,OAAA;AAAyB,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SA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M;IACdC,OAAO,EAAE;MACP,cAAc,EAAE;IAClB,CAAC;IACDH;EACF,CAAC,CAAC,CACC9C,IAAI,CAAC,IAAAkD,sBAAgB,EAAC,GAAG,CAAC,CAAC,CAC3BlD,IAAI,CAAEmD,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBpD,IAAI,CAAClC,qBAAqB,CAACuF,KAAK,CAAC;AACtC,CAAC;AAACjF,OAAA,CAAAuD,yBAAA,GAAAA,yBAAA"}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.NoSuitableKeysFoundInEntityConfiguration = exports.AuthRequestDecodeError = void 0;
|
7
|
+
var _errors = require("../../utils/errors");
|
8
|
+
/**
|
9
|
+
* An error subclass thrown when auth request decode fail
|
10
|
+
*
|
11
|
+
*/
|
12
|
+
class AuthRequestDecodeError extends _errors.IoWalletError {
|
13
|
+
code = "ERR_IO_WALLET_AUTHENTICATION_REQUEST_DECODE_FAILED";
|
14
|
+
|
15
|
+
/** The Claim for which the validation failed. */
|
16
|
+
|
17
|
+
/** Reason code for the validation failure. */
|
18
|
+
|
19
|
+
constructor(message) {
|
20
|
+
let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
|
21
|
+
let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
|
22
|
+
super((0, _errors.serializeAttrs)({
|
23
|
+
message,
|
24
|
+
claim,
|
25
|
+
reason
|
26
|
+
}));
|
27
|
+
this.claim = claim;
|
28
|
+
this.reason = reason;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* When selecting a public key from an entity configuration, and no one meets the requirements for the scenario
|
34
|
+
*
|
35
|
+
*/
|
36
|
+
exports.AuthRequestDecodeError = AuthRequestDecodeError;
|
37
|
+
class NoSuitableKeysFoundInEntityConfiguration extends _errors.IoWalletError {
|
38
|
+
code = "ERR_NO_SUITABLE_KEYS_NOT_FOUND";
|
39
|
+
|
40
|
+
/**
|
41
|
+
* @param scenario describe the scenario in which the error arise
|
42
|
+
*/
|
43
|
+
constructor(scenario) {
|
44
|
+
const message = `Entity configuration do not provide any suitable keys (${scenario}).`;
|
45
|
+
super(message);
|
46
|
+
}
|
47
|
+
}
|
48
|
+
exports.NoSuitableKeysFoundInEntityConfiguration = NoSuitableKeysFoundInEntityConfiguration;
|
49
|
+
//# sourceMappingURL=errors.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_errors","require","AuthRequestDecodeError","IoWalletError","code","constructor","message","claim","arguments","length","undefined","reason","serializeAttrs","exports","NoSuitableKeysFoundInEntityConfiguration","scenario"],"sourceRoot":"../../../../src","sources":["credential/presentation/errors.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,SAASC,qBAAa,CAAC;EACxDC,IAAI,GAAG,oDAAoD;;EAE3D;;EAGA;;EAGAC,WAAWA,CACTC,OAAe,EAGf;IAAA,IAFAC,KAAa,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IAAA,IAC7BG,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IAE9B,KAAK,CAAC,IAAAI,sBAAc,EAAC;MAAEN,OAAO;MAAEC,KAAK;MAAEI;IAAO,CAAC,CAAC,CAAC;IACjD,IAAI,CAACJ,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACI,MAAM,GAAGA,MAAM;EACtB;AACF;;AAEA;AACA;AACA;AACA;AAHAE,OAAA,CAAAX,sBAAA,GAAAA,sBAAA;AAIO,MAAMY,wCAAwC,SAASX,qBAAa,CAAC;EAC1EC,IAAI,GAAG,gCAAgC;;EAEvC;AACF;AACA;EACEC,WAAWA,CAACU,QAAgB,EAAE;IAC5B,MAAMT,OAAO,GAAI,0DAAyDS,QAAS,IAAG;IACtF,KAAK,CAACT,OAAO,CAAC;EAChB;AACF;AAACO,OAAA,CAAAC,wCAAA,GAAAA,wCAAA"}
|
@@ -3,6 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.Errors = void 0;
|
6
7
|
Object.defineProperty(exports, "evaluateRelyingPartyTrust", {
|
7
8
|
enumerable: true,
|
8
9
|
get: function () {
|
@@ -31,4 +32,8 @@ var _startFlow = require("./01-start-flow");
|
|
31
32
|
var _evaluateRpTrust = require("./02-evaluate-rp-trust");
|
32
33
|
var _getRequestObject = require("./03-get-request-object");
|
33
34
|
var _sendAuthorizationResponse = require("./04-send-authorization-response");
|
35
|
+
var Errors = _interopRequireWildcard(require("./errors"));
|
36
|
+
exports.Errors = Errors;
|
37
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
38
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
34
39
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_startFlow","require","_evaluateRpTrust","_getRequestObject","_sendAuthorizationResponse"],"sourceRoot":"../../../../src","sources":["credential/presentation/index.ts"],"mappings":"
|
1
|
+
{"version":3,"names":["_startFlow","require","_evaluateRpTrust","_getRequestObject","_sendAuthorizationResponse","Errors","_interopRequireWildcard","exports","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../../../src","sources":["credential/presentation/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAIA,IAAAE,iBAAA,GAAAF,OAAA;AAIA,IAAAG,0BAAA,GAAAH,OAAA;AAIA,IAAAI,MAAA,GAAAC,uBAAA,CAAAL,OAAA;AAAmCM,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
|
@@ -45,7 +45,7 @@ const statusAttestation = async function (issuerConf, credential, credentialCryp
|
|
45
45
|
"Content-Type": "application/json"
|
46
46
|
},
|
47
47
|
body: JSON.stringify(body)
|
48
|
-
}).then((0, _misc.
|
48
|
+
}).then((0, _misc.hasStatusOrThrow)(201)).then(raw => raw.json()).then(json => _types.StatusAttestationResponse.parse(json)).catch(handleStatusAttestationError);
|
49
49
|
return {
|
50
50
|
statusAttestation: result.status_attestation
|
51
51
|
};
|
@@ -63,10 +63,12 @@ const handleStatusAttestationError = e => {
|
|
63
63
|
if (!(e instanceof _errors.UnexpectedStatusCodeError)) {
|
64
64
|
throw e;
|
65
65
|
}
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
}
|
70
|
-
|
66
|
+
throw new _errors.ResponseErrorBuilder(_errors.IssuerResponseError).handle(404, {
|
67
|
+
code: _errors.IssuerResponseErrorCodes.CredentialInvalidStatus,
|
68
|
+
message: "Invalid status found for the given credential"
|
69
|
+
}).handle("*", {
|
70
|
+
code: _errors.IssuerResponseErrorCodes.StatusAttestationRequestFailed,
|
71
|
+
message: `Unable to obtain the status attestation for the given credential`
|
72
|
+
}).buildFrom(e);
|
71
73
|
};
|
72
74
|
//# sourceMappingURL=02-status-attestation.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_misc","require","_ioReactNativeJwt","_reactNativeUuid","_interopRequireDefault","_types","_errors","obj","__esModule","default","statusAttestation","issuerConf","credential","credentialCryptoContext","appFetch","arguments","length","undefined","fetch","jwk","getPublicKey","credentialHash","getCredentialHashWithouDiscloures","statusAttUrl","openid_credential_issuer","status_attestation_endpoint","credentialPop","SignJWT","setPayload","aud","jti","uuid","v4","toString","credential_hash","credential_hash_alg","setProtectedHeader","alg","typ","kid","setIssuedAt","setExpirationTime","sign","body","credential_pop","result","method","headers","JSON","stringify","then","
|
1
|
+
{"version":3,"names":["_misc","require","_ioReactNativeJwt","_reactNativeUuid","_interopRequireDefault","_types","_errors","obj","__esModule","default","statusAttestation","issuerConf","credential","credentialCryptoContext","appFetch","arguments","length","undefined","fetch","jwk","getPublicKey","credentialHash","getCredentialHashWithouDiscloures","statusAttUrl","openid_credential_issuer","status_attestation_endpoint","credentialPop","SignJWT","setPayload","aud","jti","uuid","v4","toString","credential_hash","credential_hash_alg","setProtectedHeader","alg","typ","kid","setIssuedAt","setExpirationTime","sign","body","credential_pop","result","method","headers","JSON","stringify","then","hasStatusOrThrow","raw","json","StatusAttestationResponse","parse","catch","handleStatusAttestationError","status_attestation","exports","e","UnexpectedStatusCodeError","ResponseErrorBuilder","IssuerResponseError","handle","code","IssuerResponseErrorCodes","CredentialInvalidStatus","message","StatusAttestationRequestFailed","buildFrom"],"sourceRoot":"../../../../src","sources":["credential/status/02-status-attestation.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAK4B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;EAC3B,CAAC,CAAC,CACCO,IAAI,CAAC,IAAAC,sBAAgB,EAAC,GAAG,CAAC,CAAC,CAC3BD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAAEG,IAAI,IAAKC,gCAAyB,CAACC,KAAK,CAACF,IAAI,CAAC,CAAC,CACrDG,KAAK,CAACC,4BAA4B,CAAC;EAEtC,OAAO;IAAE/C,iBAAiB,EAAEmC,MAAM,CAACa;EAAmB,CAAC;AACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANAC,OAAA,CAAAjD,iBAAA,GAAAA,iBAAA;AAOA,MAAM+C,4BAA4B,GAAIG,CAAU,IAAK;EACnD,IAAI,EAAEA,CAAC,YAAYC,iCAAyB,CAAC,EAAE;IAC7C,MAAMD,CAAC;EACT;EAEA,MAAM,IAAIE,4BAAoB,CAACC,2BAAmB,CAAC,CAChDC,MAAM,CAAC,GAAG,EAAE;IACXC,IAAI,EAAEC,gCAAwB,CAACC,uBAAuB;IACtDC,OAAO,EAAE;EACX,CAAC,CAAC,CACDJ,MAAM,CAAC,GAAG,EAAE;IACXC,IAAI,EAAEC,gCAAwB,CAACG,8BAA8B;IAC7DD,OAAO,EAAG;EACZ,CAAC,CAAC,CACDE,SAAS,CAACV,CAAC,CAAC;AACjB,CAAC"}
|
@@ -16,11 +16,14 @@ graph TD;
|
|
16
16
|
1 --> 2
|
17
17
|
```
|
18
18
|
|
19
|
+
|
19
20
|
## Mapped results
|
20
21
|
|
21
|
-
|
22
|
+
The following errors are mapped to a `IssuerResponseError` with specific codes.
|
22
23
|
|
23
|
-
|
24
|
+
|HTTP Status|Error Code|Description|
|
25
|
+
|-----------|----------|-----------|
|
26
|
+
|`404 Not Found`|`ERR_CREDENTIAL_INVALID_STATUS`|This response is returned by the credential issuer when the status attestation is invalid. It might contain more details in the `reason` property.|
|
24
27
|
|
25
28
|
## Example
|
26
29
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.StatusAttestationResponse = exports.ParsedStatusAttestation =
|
6
|
+
exports.StatusAttestationResponse = exports.ParsedStatusAttestation = void 0;
|
7
7
|
var _types = require("../../sd-jwt/types");
|
8
8
|
var _jwk = require("../../utils/jwk");
|
9
9
|
var z = _interopRequireWildcard(require("zod"));
|
@@ -44,18 +44,5 @@ const ParsedStatusAttestation = z.object({
|
|
44
44
|
iat: _types.UnixTime
|
45
45
|
})
|
46
46
|
});
|
47
|
-
|
48
|
-
/**
|
49
|
-
* Shape from parsing a status attestation response in case of error.
|
50
|
-
*/
|
51
47
|
exports.ParsedStatusAttestation = ParsedStatusAttestation;
|
52
|
-
const InvalidStatusAttestationResponse = z.object({
|
53
|
-
error: z.string()
|
54
|
-
});
|
55
|
-
|
56
|
-
/**
|
57
|
-
* Type from parsing a status attestation response in case of error.
|
58
|
-
* Inferred from {@link InvalidStatusAttestationResponse}.
|
59
|
-
*/
|
60
|
-
exports.InvalidStatusAttestationResponse = InvalidStatusAttestationResponse;
|
61
48
|
//# sourceMappingURL=types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StatusAttestationResponse","object","status_attestation","string","exports","ParsedStatusAttestation","header","typ","literal","alg","kid","optional","payload","credential_hash_alg","credential_hash","cnf","jwk","JWK","exp","UnixTime","iat"
|
1
|
+
{"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StatusAttestationResponse","object","status_attestation","string","exports","ParsedStatusAttestation","header","typ","literal","alg","kid","optional","payload","credential_hash_alg","credential_hash","cnf","jwk","JWK","exp","UnixTime","iat"],"sourceRoot":"../../../../src","sources":["credential/status/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAyB,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAF,wBAAAM,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAEzB;AACA;AACA;AACO,MAAMW,yBAAyB,GAAGxB,CAAC,CAACyB,MAAM,CAAC;EAChDC,kBAAkB,EAAE1B,CAAC,CAAC2B,MAAM,CAAC;AAC/B,CAAC,CAAC;;AAEF;AACA;AACA;AACA;;AAKA;AACA;AACA;AAFAC,OAAA,CAAAJ,yBAAA,GAAAA,yBAAA;AAKA;AACA;AACA;AACO,MAAMK,uBAAuB,GAAG7B,CAAC,CAACyB,MAAM,CAAC;EAC9CK,MAAM,EAAE9B,CAAC,CAACyB,MAAM,CAAC;IACfM,GAAG,EAAE/B,CAAC,CAACgC,OAAO,CAAC,wBAAwB,CAAC;IACxCC,GAAG,EAAEjC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IACfO,GAAG,EAAElC,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACQ,QAAQ,CAAC;EAC3B,CAAC,CAAC;EACFC,OAAO,EAAEpC,CAAC,CAACyB,MAAM,CAAC;IAChBY,mBAAmB,EAAErC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IAC/BW,eAAe,EAAEtC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IAC3BY,GAAG,EAAEvC,CAAC,CAACyB,MAAM,CAAC;MACZe,GAAG,EAAEC;IACP,CAAC,CAAC;IACFC,GAAG,EAAEC,eAAQ;IACbC,GAAG,EAAED;EACP,CAAC;AACH,CAAC,CAAC;AAACf,OAAA,CAAAC,uBAAA,GAAAA,uBAAA"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ClaimsNotFoundInToken = exports.ClaimsNotFoundBetweenDisclosures = void 0;
|
7
|
+
/**
|
8
|
+
* When claims are requested but not found in the credential
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
class ClaimsNotFoundBetweenDisclosures extends Error {
|
12
|
+
code = "ERR_CLAIMS_NOT_FOUND";
|
13
|
+
|
14
|
+
/** The Claims not found */
|
15
|
+
|
16
|
+
constructor(claims) {
|
17
|
+
const c = Array.isArray(claims) ? claims : [claims];
|
18
|
+
const message = `Some requested claims are not present in the disclosurable values, claims: ${c.join(", ")}`;
|
19
|
+
super(message);
|
20
|
+
this.claims = c;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* When the SD-JWT does not contain an hashed reference to a given set of claims
|
26
|
+
*/
|
27
|
+
exports.ClaimsNotFoundBetweenDisclosures = ClaimsNotFoundBetweenDisclosures;
|
28
|
+
class ClaimsNotFoundInToken extends Error {
|
29
|
+
code = "ERR_CLAIMS_NOT_FOUND_IN_TOKEN";
|
30
|
+
|
31
|
+
/** The Claims not found */
|
32
|
+
|
33
|
+
constructor(claims) {
|
34
|
+
const claimsArray = Array.isArray(claims) ? claims : [claims];
|
35
|
+
super(`Some requested claims are not present in the disclosurable values: ${claimsArray.join(", ")}`);
|
36
|
+
this.claims = claimsArray;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
exports.ClaimsNotFoundInToken = ClaimsNotFoundInToken;
|
40
|
+
//# sourceMappingURL=errors.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["ClaimsNotFoundBetweenDisclosures","Error","code","constructor","claims","c","Array","isArray","message","join","exports","ClaimsNotFoundInToken","claimsArray"],"sourceRoot":"../../../src","sources":["sd-jwt/errors.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACO,MAAMA,gCAAgC,SAASC,KAAK,CAAC;EAC1DC,IAAI,GAAG,sBAAsB;;EAE7B;;EAGAC,WAAWA,CAACC,MAAyB,EAAE;IACrC,MAAMC,CAAC,GAAGC,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC;IACnD,MAAMI,OAAO,GAAI,8EAA6EH,CAAC,CAACI,IAAI,CAClG,IACF,CAAE,EAAC;IACH,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACJ,MAAM,GAAGC,CAAC;EACjB;AACF;;AAEA;AACA;AACA;AAFAK,OAAA,CAAAV,gCAAA,GAAAA,gCAAA;AAGO,MAAMW,qBAAqB,SAASV,KAAK,CAAC;EAC/CC,IAAI,GAAG,+BAA+B;;EAEtC;;EAGAC,WAAWA,CAACC,MAAyB,EAAE;IACrC,MAAMQ,WAAW,GAAGN,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC;IAC7D,KAAK,CACF,sEAAqEQ,WAAW,CAACH,IAAI,CACpF,IACF,CAAE,EACJ,CAAC;IACD,IAAI,CAACL,MAAM,GAAGQ,WAAW;EAC3B;AACF;AAACF,OAAA,CAAAC,qBAAA,GAAAA,qBAAA"}
|
@@ -3,6 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.Errors = void 0;
|
6
7
|
Object.defineProperty(exports, "SdJwt4VC", {
|
7
8
|
enumerable: true,
|
8
9
|
get: function () {
|
@@ -13,8 +14,11 @@ exports.verify = exports.disclose = exports.decode = void 0;
|
|
13
14
|
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
14
15
|
var _types = require("./types");
|
15
16
|
var _verifier = require("./verifier");
|
16
|
-
var
|
17
|
+
var Errors = _interopRequireWildcard(require("./errors"));
|
18
|
+
exports.Errors = Errors;
|
17
19
|
var _jsBase = require("js-base64");
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
21
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
18
22
|
const decodeDisclosure = encoded => {
|
19
23
|
const utf8String = _jsBase.Base64.decode(encoded); // Decode Base64 into UTF-8 string
|
20
24
|
const decoded = _types.Disclosure.parse(JSON.parse(utf8String));
|
@@ -74,7 +78,7 @@ const decode = (token, customSchema) => {
|
|
74
78
|
* @param token The encoded token that represents a valid sd-jwt for verifiable credentials
|
75
79
|
* @param claims The list of claims to be disclosed
|
76
80
|
*
|
77
|
-
* @throws {
|
81
|
+
* @throws {ClaimsNotFoundBetweenDisclosures} When one or more claims does not relate to any discloure.
|
78
82
|
* @throws {ClaimsNotFoundInToken} When one or more claims are not contained in the SD-JWT token.
|
79
83
|
* @returns The encoded token with only the requested disclosures, along with the path each claim can be found on the SD-JWT token
|
80
84
|
*
|
@@ -98,7 +102,7 @@ const disclose = async (token, claims) => {
|
|
98
102
|
|
99
103
|
// check every claim represents a known disclosure
|
100
104
|
if (!disclosure) {
|
101
|
-
throw new
|
105
|
+
throw new Errors.ClaimsNotFoundBetweenDisclosures(claim);
|
102
106
|
}
|
103
107
|
const hash = await (0, _ioReactNativeJwt.sha256ToBase64)(disclosure.encoded);
|
104
108
|
|
@@ -111,7 +115,7 @@ const disclose = async (token, claims) => {
|
|
111
115
|
path: `verified_claims.claims._sd[${index}]`
|
112
116
|
};
|
113
117
|
}
|
114
|
-
throw new
|
118
|
+
throw new Errors.ClaimsNotFoundInToken(claim);
|
115
119
|
}));
|
116
120
|
const filteredDisclosures = rawDisclosures.filter(d => {
|
117
121
|
const {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","_types","_verifier","
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_types","_verifier","Errors","_interopRequireWildcard","exports","_jsBase","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","decodeDisclosure","encoded","utf8String","Base64","decode","decoded","Disclosure","parse","JSON","token","customSchema","slice","rawSdJwt","rawDisclosures","split","decodedJwt","decodeJwt","parser","SdJwt4VC","sdJwt","header","protectedHeader","payload","disclosures","map","disclose","claims","paths","Promise","all","claim","disclosure","find","_ref","name","ClaimsNotFoundBetweenDisclosures","hash","sha256ToBase64","_sd","includes","index","indexOf","path","ClaimsNotFoundInToken","filteredDisclosures","filter","d","disclosedToken","join","verify","publicKey","verifyJwt","verifyDisclosure"],"sourceRoot":"../../../src","sources":["sd-jwt/index.ts"],"mappings":";;;;;;;;;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAAmCK,OAAA,CAAAF,MAAA,GAAAA,MAAA;AACnC,IAAAG,OAAA,GAAAN,OAAA;AAAmC,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA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AgBO,MAAMwB,MAAM,GAAG,MAAAA,CACpBxC,KAAa,EACbyC,SAAsB,EACtBxC,YAAgB,KAC8C;EAC9D;EACA,MAAM,CAACE,QAAQ,GAAG,EAAE,CAAC,GAAGH,KAAK,CAACK,KAAK,CAAC,GAAG,CAAC;EACxC,MAAMT,OAAO,GAAGD,MAAM,CAACK,KAAK,EAAEC,YAAY,CAAC;;EAE3C;EACA,MAAM,IAAAyC,wBAAS,EAACvC,QAAQ,EAAEsC,SAAS,CAAC;;EAEpC;EACA,MAAMxB,MAAM,GAAG,CAAC,GAAGrB,OAAO,CAACc,KAAK,CAACG,OAAO,CAACgB,GAAG,CAAC;EAE7C,MAAMV,OAAO,CAACC,GAAG,CACfxB,OAAO,CAACkB,WAAW,CAACC,GAAG,CACrB,MAAOO,UAAU,IAAK,MAAM,IAAAqB,0BAAgB,EAACrB,UAAU,EAAEL,MAAM,CACjE,CACF,CAAC;EAED,OAAO;IACLP,KAAK,EAAEd,OAAO,CAACc,KAAK;IACpBI,WAAW,EAAElB,OAAO,CAACkB,WAAW,CAACC,GAAG,CAAEsB,CAAC,IAAKA,CAAC,CAACzC,OAAO;EACvD,CAAC;AACH,CAAC;AAAC7B,OAAA,CAAAyE,MAAA,GAAAA,MAAA"}
|
@@ -13,7 +13,11 @@ const verifyDisclosure = async (_ref, claims) => {
|
|
13
13
|
} = _ref;
|
14
14
|
let hash = await (0, _ioReactNativeJwt.sha256ToBase64)(encoded);
|
15
15
|
if (!claims.includes(hash)) {
|
16
|
-
throw new _errors.ValidationFailed(
|
16
|
+
throw new _errors.ValidationFailed({
|
17
|
+
message: "Validation of disclosure failed",
|
18
|
+
claim: `${decoded}`,
|
19
|
+
reason: "Disclosure hash not found in claims"
|
20
|
+
});
|
17
21
|
}
|
18
22
|
};
|
19
23
|
exports.verifyDisclosure = verifyDisclosure;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","_errors","verifyDisclosure","_ref","claims","encoded","decoded","hash","sha256ToBase64","includes","ValidationFailed","exports"],"sourceRoot":"../../../src","sources":["sd-jwt/verifier.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAGO,MAAME,gBAAgB,GAAG,MAAAA,CAAAC,IAAA,EAE9BC,MAAoC,KACjC;EAAA,IAFH;IAAEC,OAAO;IAAEC;EAA+B,CAAC,GAAAH,IAAA;EAG3C,IAAII,IAAI,GAAG,MAAM,IAAAC,gCAAc,EAACH,OAAO,CAAC;EACxC,IAAI,CAACD,MAAM,CAACK,QAAQ,CAACF,IAAI,CAAC,EAAE;IAC1B,MAAM,IAAIG,wBAAgB,
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_errors","verifyDisclosure","_ref","claims","encoded","decoded","hash","sha256ToBase64","includes","ValidationFailed","message","claim","reason","exports"],"sourceRoot":"../../../src","sources":["sd-jwt/verifier.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAGO,MAAME,gBAAgB,GAAG,MAAAA,CAAAC,IAAA,EAE9BC,MAAoC,KACjC;EAAA,IAFH;IAAEC,OAAO;IAAEC;EAA+B,CAAC,GAAAH,IAAA;EAG3C,IAAII,IAAI,GAAG,MAAM,IAAAC,gCAAc,EAACH,OAAO,CAAC;EACxC,IAAI,CAACD,MAAM,CAACK,QAAQ,CAACF,IAAI,CAAC,EAAE;IAC1B,MAAM,IAAIG,wBAAgB,CAAC;MACzBC,OAAO,EAAE,iCAAiC;MAC1CC,KAAK,EAAG,GAAEN,OAAQ,EAAC;MACnBO,MAAM,EAAE;IACV,CAAC,CAAC;EACJ;AACF,CAAC;AAACC,OAAA,CAAAZ,gBAAA,GAAAA,gBAAA"}
|
@@ -56,7 +56,7 @@ async function getSignedEntityConfiguration(entityBaseUrl) {
|
|
56
56
|
const wellKnownUrl = `${entityBaseUrl}/.well-known/openid-federation`;
|
57
57
|
return await appFetch(wellKnownUrl, {
|
58
58
|
method: "GET"
|
59
|
-
}).then((0, _misc.
|
59
|
+
}).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.text());
|
60
60
|
}
|
61
61
|
|
62
62
|
/**
|
@@ -143,6 +143,6 @@ async function getSignedEntityStatement(accreditationBodyBaseUrl, subordinatedEn
|
|
143
143
|
})}`;
|
144
144
|
return await appFetch(url, {
|
145
145
|
method: "GET"
|
146
|
-
}).then((0, _misc.
|
146
|
+
}).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.text());
|
147
147
|
}
|
148
148
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","_types","_chain","_misc","verifyTrustChain","trustAnchorEntity","chain","appFetch","fetch","renewOnFail","arguments","length","undefined","validateTrustChain","error","renewedChain","renewTrustChain","getSignedEntityConfiguration","entityBaseUrl","wellKnownUrl","method","then","
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_types","_chain","_misc","verifyTrustChain","trustAnchorEntity","chain","appFetch","fetch","renewOnFail","arguments","length","undefined","validateTrustChain","error","renewedChain","renewTrustChain","getSignedEntityConfiguration","entityBaseUrl","wellKnownUrl","method","then","hasStatusOrThrow","res","text","fetchAndParseEntityConfiguration","schema","responseText","responseJwt","decodeJwt","parse","header","protectedHeader","payload","getWalletProviderEntityConfiguration","options","WalletProviderEntityConfiguration","exports","getCredentialIssuerEntityConfiguration","CredentialIssuerEntityConfiguration","getTrustAnchorEntityConfiguration","TrustAnchorEntityConfiguration","getRelyingPartyEntityConfiguration","RelyingPartyEntityConfiguration","getEntityConfiguration","EntityConfiguration","getEntityStatement","accreditationBodyBaseUrl","subordinatedEntityBaseUrl","getSignedEntityStatement","EntityStatement","url","URLSearchParams","sub"],"sourceRoot":"../../../src","sources":["trust/index.ts"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAA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
50
50
|
}
|
51
51
|
}
|
52
|
-
throw new _errors.ValidationFailed(
|
52
|
+
throw new _errors.ValidationFailed({
|
53
|
+
message: `Unable to obtain JWT from form_post.jwt. Form data: ${formData}`
|
54
|
+
});
|
53
55
|
};
|
54
56
|
exports.getJwtFromFormPost = getJwtFromFormPost;
|
55
57
|
//# sourceMappingURL=decoder.js.map
|