@pagopa/io-react-native-wallet 0.16.2 → 0.16.3
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/credential/issuance/06-obtain-credential.js +18 -1
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/utils/errors.js +39 -1
- package/lib/commonjs/utils/errors.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js +19 -2
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/utils/errors.js +36 -0
- package/lib/module/utils/errors.js.map +1 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/utils/errors.d.ts +18 -0
- package/lib/typescript/utils/errors.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/credential/issuance/06-obtain-credential.ts +33 -2
- package/src/utils/errors.ts +36 -0
@@ -84,11 +84,28 @@ const obtainCredential = async (issuerConf, accessToken, clientId, credentialDef
|
|
84
84
|
Authorization: `${accessToken.token_type} ${accessToken.access_token}`
|
85
85
|
},
|
86
86
|
body: JSON.stringify(credentialRequestFormBody)
|
87
|
-
}).then((0, _misc.hasStatus)(200)).then(res => res.json()).then(body => _types.CredentialResponse.safeParse(body));
|
87
|
+
}).then((0, _misc.hasStatus)(200)).then(res => res.json()).then(body => _types.CredentialResponse.safeParse(body)).catch(handleObtainCredentialError);
|
88
88
|
if (!credentialRes.success) {
|
89
89
|
throw new _errors.ValidationFailed(credentialRes.error.message);
|
90
90
|
}
|
91
91
|
return credentialRes.data;
|
92
92
|
};
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Handle the credential error by mapping it to a custom exception.
|
96
|
+
* If the error is not an instance of {@link UnexpectedStatusCodeError}, it is thrown as is.
|
97
|
+
* @param e - The error to be handled
|
98
|
+
* @throws {@link StatusAttestationError} if the status code is different from 404
|
99
|
+
* @throws {@link StatusAttestationInvalid} if the status code is 404 (meaning the credential is invalid)
|
100
|
+
*/
|
93
101
|
exports.obtainCredential = obtainCredential;
|
102
|
+
const handleObtainCredentialError = e => {
|
103
|
+
if (!(e instanceof _errors.UnexpectedStatusCodeError)) {
|
104
|
+
throw e;
|
105
|
+
}
|
106
|
+
if (e.statusCode === 404) {
|
107
|
+
throw new _errors.CredentialNotEntitledError("Invalid status found for the given credential", e.message);
|
108
|
+
}
|
109
|
+
throw new _errors.CredentialRequestError(`Unable to obtain the requested credential [response status code: ${e.statusCode}]`, e.message);
|
110
|
+
};
|
94
111
|
//# sourceMappingURL=06-obtain-credential.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","_misc","_errors","_types","_dpop","_reactNativeUuid","_interopRequireDefault","obj","__esModule","default","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","SignJWT","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","exports","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credentialUrl","openid_credential_issuer","credential_endpoint","signedNonceProof","c_nonce","constainsCredentialDefinition","authorization_details","some","c","credential_configuration_id","format","type","ValidationFailed","credentialRequestFormBody","credential_definition","proof","jwt","proof_type","tokenRequestSignedDPop","createDPopToken","htm","htu","jti","uuid","v4","ath","sha256ToBase64","access_token","credentialRes","method","headers","DPoP","Authorization","token_type","body","JSON","stringify","then","hasStatus","res","json","CredentialResponse","safeParse","success","error","message","data"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_misc","_errors","_types","_dpop","_reactNativeUuid","_interopRequireDefault","obj","__esModule","default","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","SignJWT","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","exports","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credentialUrl","openid_credential_issuer","credential_endpoint","signedNonceProof","c_nonce","constainsCredentialDefinition","authorization_details","some","c","credential_configuration_id","format","type","ValidationFailed","credentialRequestFormBody","credential_definition","proof","jwt","proof_type","tokenRequestSignedDPop","createDPopToken","htm","htu","jti","uuid","v4","ath","sha256ToBase64","access_token","credentialRes","method","headers","DPoP","Authorization","token_type","body","JSON","stringify","then","hasStatus","res","json","CredentialResponse","safeParse","catch","handleObtainCredentialError","success","error","message","data","e","UnexpectedStatusCodeError","statusCode","CredentialNotEntitledError","CredentialRequestError"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAMA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAC,sBAAA,CAAAN,OAAA;AAAqC,SAAAM,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAc9B,MAAMG,gBAAgB,GAAG,MAAAA,CAC9BC,KAAa,EACbC,MAAc,EACdC,QAAgB,EAChBC,GAAkB,KACE;EACpB,MAAMC,GAAG,GAAG,MAAMD,GAAG,CAACE,YAAY,CAAC,CAAC;EACpC,OAAO,IAAIC,yBAAO,CAACH,GAAG,CAAC,CACpBI,UAAU,CAAC;IACVP;EACF,CAAC,CAAC,CACDQ,kBAAkB,CAAC;IAClBC,GAAG,EAAE,sBAAsB;IAC3BL;EACF,CAAC,CAAC,CACDM,WAAW,CAACR,QAAQ,CAAC,CACrBS,SAAS,CAACV,MAAM,CAAC,CACjBW,WAAW,CAAC,CAAC,CACbC,iBAAiB,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,CAAC;EACH;EAEA,MAAM,IAAIM,8BAAsB,CAC7B,oEAAmEJ,CAAC,CAACE,UAAW,GAAE,EACnFF,CAAC,CAACF,OACJ,CAAC;AACH,CAAC"}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.serializeAttrs = exports.WalletProviderResponseError = exports.WalletInstanceRevokedError = exports.WalletInstanceNotFoundError = exports.WalletInstanceAttestationIssuingError = exports.ValidationFailed = exports.UnexpectedStatusCodeError = exports.StatusAttestationInvalid = exports.StatusAttestationError = exports.PidMetadataError = exports.PidIssuingError = exports.OperationAbortedError = exports.NoSuitableKeysFoundInEntityConfiguration = exports.IoWalletError = exports.ClaimsNotFoundInToken = exports.ClaimsNotFoundBetweenDislosures = exports.AuthorizationIdpError = exports.AuthorizationError = exports.AuthRequestDecodeError = void 0;
|
6
|
+
exports.serializeAttrs = exports.WalletProviderResponseError = exports.WalletInstanceRevokedError = exports.WalletInstanceNotFoundError = exports.WalletInstanceAttestationIssuingError = exports.ValidationFailed = exports.UnexpectedStatusCodeError = exports.StatusAttestationInvalid = exports.StatusAttestationError = exports.PidMetadataError = exports.PidIssuingError = exports.OperationAbortedError = exports.NoSuitableKeysFoundInEntityConfiguration = exports.IoWalletError = exports.CredentialRequestError = exports.CredentialNotEntitledError = exports.ClaimsNotFoundInToken = exports.ClaimsNotFoundBetweenDislosures = exports.AuthorizationIdpError = exports.AuthorizationError = exports.AuthRequestDecodeError = void 0;
|
7
7
|
/**
|
8
8
|
* utility to format a set of attributes into an error message string
|
9
9
|
*
|
@@ -415,5 +415,43 @@ class StatusAttestationError extends IoWalletError {
|
|
415
415
|
this.reason = reason;
|
416
416
|
}
|
417
417
|
}
|
418
|
+
|
419
|
+
/**
|
420
|
+
* Error subclass thrown when the the user is not entitled to receive the requested credential.
|
421
|
+
*/
|
418
422
|
exports.StatusAttestationError = StatusAttestationError;
|
423
|
+
class CredentialNotEntitledError extends IoWalletError {
|
424
|
+
static get code() {
|
425
|
+
return "CREDENTIAL_NOT_ENTITLED_ERROR";
|
426
|
+
}
|
427
|
+
code = "CREDENTIAL_NOT_ENTITLED_ERROR";
|
428
|
+
constructor(message) {
|
429
|
+
let reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
|
430
|
+
super(serializeAttrs({
|
431
|
+
message,
|
432
|
+
reason
|
433
|
+
}));
|
434
|
+
this.reason = reason;
|
435
|
+
}
|
436
|
+
}
|
437
|
+
|
438
|
+
/**
|
439
|
+
* Error subclass thrown when an error occurs while requesting a credential.
|
440
|
+
*/
|
441
|
+
exports.CredentialNotEntitledError = CredentialNotEntitledError;
|
442
|
+
class CredentialRequestError extends IoWalletError {
|
443
|
+
static get code() {
|
444
|
+
return "CREDENTIAL_REQUEST_ERROR";
|
445
|
+
}
|
446
|
+
code = "CREDENTIAL_REQUEST_ERROR";
|
447
|
+
constructor(message) {
|
448
|
+
let reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
|
449
|
+
super(serializeAttrs({
|
450
|
+
message,
|
451
|
+
reason
|
452
|
+
}));
|
453
|
+
this.reason = reason;
|
454
|
+
}
|
455
|
+
}
|
456
|
+
exports.CredentialRequestError = CredentialRequestError;
|
419
457
|
//# sourceMappingURL=errors.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","exports","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","UnexpectedStatusCodeError","statusCode","toString","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError","WalletInstanceRevokedError","WalletInstanceNotFoundError","AuthorizationError","AuthorizationIdpError","error","errorDescription","OperationAbortedError","operation","StatusAttestationInvalid","StatusAttestationError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GACzBC,KAAsC,IAEtCC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,GAAG,CAACC,IAAA;EAAA,IAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;EAAA,OAAK,CAACC,CAAC,EAAEE,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAI,IAAGA,CAAC,CAACG,IAAI,CAAC,IAAI,CAAE,GAAE,GAAGH,CAAC,CAAC;AAAA,EAAC,CAChEH,GAAG,CAAEO,CAAC,IAAKA,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC,CAAC,CACvBA,IAAI,CAAC,GAAG,CAAC;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVAE,OAAA,CAAAZ,cAAA,GAAAA,cAAA;AAWO,MAAMa,aAAa,SAASC,KAAK,CAAC;EACvC;EACA,WAAWC,IAAIA,CAAA,EAAW;IACxB,OAAO,uBAAuB;EAChC;;EAEA;EACAA,IAAI,GAAW,uBAAuB;EAEtCC,WAAWA,CAACC,OAAgB,EAAE;IAAA,IAAAC,qBAAA;IAC5B,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,IAAI,CAACH,WAAW,CAACG,IAAI;IACjC;IACA,CAAAD,qBAAA,GAAAJ,KAAK,CAACM,iBAAiB,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,KAAK,EAAqB,IAAI,EAAE,IAAI,CAACE,WAAW,CAAC;EACnD;AACF;;AAEA;AACA;AACA;AAFAJ,OAAA,CAAAC,aAAA,GAAAA,aAAA;AAGO,MAAMS,yBAAyB,SAAST,aAAa,CAAC;EAC3D,WAAWE,IAAIA,CAAA,EAAiC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kC;IAAA,IAAhCa,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC3B,cAAc,CAAC;MAAEiB,OAAO;MAAEa;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;;AAEA;AACA;AACA;AAFAlB,OAAA,CAAAsC,wBAAA,GAAAA,wBAAA;AAGO,MAAMC,sBAAsB,SAAStC,aAAa,CAAC;EACxD,WAAWE,IAAIA,CAAA,EAAmC;IAChD,OAAO,8BAA8B;EACvC;EAEAA,IAAI,GAAG,8BAA8B;EAIrCC,WAAWA,CAACC,OAAe,EAAkC;IAAA,IAAhCa,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC3B,cAAc,CAAC;MAAEiB,OAAO;MAAEa;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;
|
1
|
+
{"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","exports","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","UnexpectedStatusCodeError","statusCode","toString","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError","WalletInstanceRevokedError","WalletInstanceNotFoundError","AuthorizationError","AuthorizationIdpError","error","errorDescription","OperationAbortedError","operation","StatusAttestationInvalid","StatusAttestationError","CredentialNotEntitledError","CredentialRequestError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC3B,cAAc,CAAC;MAAEiB,OAAO;MAAEa;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;AAAClB,OAAA,CAAAyC,sBAAA,GAAAA,sBAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { sha256ToBase64, SignJWT } from "@pagopa/io-react-native-jwt";
|
2
2
|
import { hasStatus } from "../../utils/misc";
|
3
|
-
import { ValidationFailed } from "../../utils/errors";
|
3
|
+
import { CredentialNotEntitledError, CredentialRequestError, UnexpectedStatusCodeError, ValidationFailed } from "../../utils/errors";
|
4
4
|
import { CredentialResponse } from "./types";
|
5
5
|
import { createDPopToken } from "../../utils/dpop";
|
6
6
|
import uuid from "react-native-uuid";
|
@@ -76,10 +76,27 @@ export const obtainCredential = async (issuerConf, accessToken, clientId, creden
|
|
76
76
|
Authorization: `${accessToken.token_type} ${accessToken.access_token}`
|
77
77
|
},
|
78
78
|
body: JSON.stringify(credentialRequestFormBody)
|
79
|
-
}).then(hasStatus(200)).then(res => res.json()).then(body => CredentialResponse.safeParse(body));
|
79
|
+
}).then(hasStatus(200)).then(res => res.json()).then(body => CredentialResponse.safeParse(body)).catch(handleObtainCredentialError);
|
80
80
|
if (!credentialRes.success) {
|
81
81
|
throw new ValidationFailed(credentialRes.error.message);
|
82
82
|
}
|
83
83
|
return credentialRes.data;
|
84
84
|
};
|
85
|
+
|
86
|
+
/**
|
87
|
+
* Handle the credential error by mapping it to a custom exception.
|
88
|
+
* If the error is not an instance of {@link UnexpectedStatusCodeError}, it is thrown as is.
|
89
|
+
* @param e - The error to be handled
|
90
|
+
* @throws {@link StatusAttestationError} if the status code is different from 404
|
91
|
+
* @throws {@link StatusAttestationInvalid} if the status code is 404 (meaning the credential is invalid)
|
92
|
+
*/
|
93
|
+
const handleObtainCredentialError = e => {
|
94
|
+
if (!(e instanceof UnexpectedStatusCodeError)) {
|
95
|
+
throw e;
|
96
|
+
}
|
97
|
+
if (e.statusCode === 404) {
|
98
|
+
throw new CredentialNotEntitledError("Invalid status found for the given credential", e.message);
|
99
|
+
}
|
100
|
+
throw new CredentialRequestError(`Unable to obtain the requested credential [response status code: ${e.statusCode}]`, e.message);
|
101
|
+
};
|
85
102
|
//# sourceMappingURL=06-obtain-credential.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["sha256ToBase64","SignJWT","hasStatus","ValidationFailed","CredentialResponse","createDPopToken","uuid","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credentialUrl","openid_credential_issuer","credential_endpoint","signedNonceProof","c_nonce","constainsCredentialDefinition","authorization_details","some","c","credential_configuration_id","format","type","credentialRequestFormBody","credential_definition","proof","jwt","proof_type","tokenRequestSignedDPop","htm","htu","jti","v4","ath","access_token","credentialRes","method","headers","DPoP","Authorization","token_type","body","JSON","stringify","then","res","json","safeParse","success","error","message","data"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":"AAAA,SACEA,cAAc,EACdC,OAAO,QAEF,6BAA6B;AAGpC,SAASC,SAAS,QAAkB,kBAAkB;AAEtD,
|
1
|
+
{"version":3,"names":["sha256ToBase64","SignJWT","hasStatus","CredentialNotEntitledError","CredentialRequestError","UnexpectedStatusCodeError","ValidationFailed","CredentialResponse","createDPopToken","uuid","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credentialUrl","openid_credential_issuer","credential_endpoint","signedNonceProof","c_nonce","constainsCredentialDefinition","authorization_details","some","c","credential_configuration_id","format","type","credentialRequestFormBody","credential_definition","proof","jwt","proof_type","tokenRequestSignedDPop","htm","htu","jti","v4","ath","access_token","credentialRes","method","headers","DPoP","Authorization","token_type","body","JSON","stringify","then","res","json","safeParse","catch","handleObtainCredentialError","success","error","message","data","e","statusCode"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":"AAAA,SACEA,cAAc,EACdC,OAAO,QAEF,6BAA6B;AAGpC,SAASC,SAAS,QAAkB,kBAAkB;AAEtD,SACEC,0BAA0B,EAC1BC,sBAAsB,EACtBC,yBAAyB,EACzBC,gBAAgB,QACX,oBAAoB;AAC3B,SAASC,kBAAkB,QAAQ,SAAS;AAE5C,SAASC,eAAe,QAAQ,kBAAkB;AAClD,OAAOC,IAAI,MAAM,mBAAmB;AAcpC,OAAO,MAAMC,gBAAgB,GAAG,MAAAA,CAC9BC,KAAa,EACbC,MAAc,EACdC,QAAgB,EAChBC,GAAkB,KACE;EACpB,MAAMC,GAAG,GAAG,MAAMD,GAAG,CAACE,YAAY,CAAC,CAAC;EACpC,OAAO,IAAIf,OAAO,CAACa,GAAG,CAAC,CACpBG,UAAU,CAAC;IACVN;EACF,CAAC,CAAC,CACDO,kBAAkB,CAAC;IAClBC,GAAG,EAAE,sBAAsB;IAC3BJ;EACF,CAAC,CAAC,CACDK,WAAW,CAACP,QAAQ,CAAC,CACrBQ,SAAS,CAACT,MAAM,CAAC,CACjBU,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,MAAM,CAAC,CACzBC,IAAI,CAAC,CAAC;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAkC,GAAG,MAAAA,CAChDC,UAAU,EACVC,WAAW,EACXC,QAAQ,EACRC,oBAAoB,EACpBC,OAAO,KACJ;EACH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EAAE;MACP,cAAc,EAAE,kBAAkB;MAClCC,IAAI,EAAEV,sBAAsB;MAC5BW,aAAa,EAAG,GAAEpC,WAAW,CAACqC,UAAW,IAAGrC,WAAW,CAAC+B,YAAa;IACvE,CAAC;IACDO,IAAI,EAAEC,IAAI,CAACC,SAAS,CAACpB,yBAAyB;EAChD,CAAC,CAAC,CACCqB,IAAI,CAAClE,SAAS,CAAC,GAAG,CAAC,CAAC,CACpBkE,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBF,IAAI,CAAEH,IAAI,IAAK1D,kBAAkB,CAACgE,SAAS,CAACN,IAAI,CAAC,CAAC,CAClDO,KAAK,CAACC,2BAA2B,CAAC;EAErC,IAAI,CAACd,aAAa,CAACe,OAAO,EAAE;IAC1B,MAAM,IAAIpE,gBAAgB,CAACqD,aAAa,CAACgB,KAAK,CAACC,OAAO,CAAC;EACzD;EAEA,OAAOjB,aAAa,CAACkB,IAAI;AAC3B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMJ,2BAA2B,GAAIK,CAAU,IAAK;EAClD,IAAI,EAAEA,CAAC,YAAYzE,yBAAyB,CAAC,EAAE;IAC7C,MAAMyE,CAAC;EACT;EAEA,IAAIA,CAAC,CAACC,UAAU,KAAK,GAAG,EAAE;IACxB,MAAM,IAAI5E,0BAA0B,CAClC,+CAA+C,EAC/C2E,CAAC,CAACF,OACJ,CAAC;EACH;EAEA,MAAM,IAAIxE,sBAAsB,CAC7B,oEAAmE0E,CAAC,CAACC,UAAW,GAAE,EACnFD,CAAC,CAACF,OACJ,CAAC;AACH,CAAC"}
|
@@ -391,4 +391,40 @@ export class StatusAttestationError extends IoWalletError {
|
|
391
391
|
this.reason = reason;
|
392
392
|
}
|
393
393
|
}
|
394
|
+
|
395
|
+
/**
|
396
|
+
* Error subclass thrown when the the user is not entitled to receive the requested credential.
|
397
|
+
*/
|
398
|
+
export class CredentialNotEntitledError extends IoWalletError {
|
399
|
+
static get code() {
|
400
|
+
return "CREDENTIAL_NOT_ENTITLED_ERROR";
|
401
|
+
}
|
402
|
+
code = "CREDENTIAL_NOT_ENTITLED_ERROR";
|
403
|
+
constructor(message) {
|
404
|
+
let reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
|
405
|
+
super(serializeAttrs({
|
406
|
+
message,
|
407
|
+
reason
|
408
|
+
}));
|
409
|
+
this.reason = reason;
|
410
|
+
}
|
411
|
+
}
|
412
|
+
|
413
|
+
/**
|
414
|
+
* Error subclass thrown when an error occurs while requesting a credential.
|
415
|
+
*/
|
416
|
+
export class CredentialRequestError extends IoWalletError {
|
417
|
+
static get code() {
|
418
|
+
return "CREDENTIAL_REQUEST_ERROR";
|
419
|
+
}
|
420
|
+
code = "CREDENTIAL_REQUEST_ERROR";
|
421
|
+
constructor(message) {
|
422
|
+
let reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
|
423
|
+
super(serializeAttrs({
|
424
|
+
message,
|
425
|
+
reason
|
426
|
+
}));
|
427
|
+
this.reason = reason;
|
428
|
+
}
|
429
|
+
}
|
394
430
|
//# sourceMappingURL=errors.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","UnexpectedStatusCodeError","statusCode","toString","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError","WalletInstanceRevokedError","WalletInstanceNotFoundError","AuthorizationError","AuthorizationIdpError","error","errorDescription","OperationAbortedError","operation","StatusAttestationInvalid","StatusAttestationError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AAAA;AACA;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AEA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,SAASnC,aAAa,CAAC;EACvD,WAAWE,IAAIA,CAAA,EAAsC;IACnD,OAAO,iCAAiC;EAC1C;EAEAA,IAAI,GAAG,iCAAiC;;EAExC;;EAGAC,WAAWA,CAACiC,SAAiB,EAAE;IAC7B,KAAK,CAAChD,cAAc,CAAC;MAAEgD;IAAU,CAAC,CAAC,CAAC;IACpC,IAAI,CAACA,SAAS,GAAGA,SAAS;EAC5B;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,SAASrC,aAAa,CAAC;EAC1D,WAAWE,IAAIA,CAAA,EAAqC;IAClD,OAAO,gCAAgC;EACzC;EAEAA,IAAI,GAAG,gCAAgC;EAIvCC,WAAWA,CAACC,OAAe,EAAkC;IAAA,IAAhCa,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC1B,cAAc,CAAC;MAAEgB,OAAO;MAAEa;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMqB,sBAAsB,SAAStC,aAAa,CAAC;EACxD,WAAWE,IAAIA,CAAA,EAAmC;IAChD,OAAO,8BAA8B;EACvC;EAEAA,IAAI,GAAG,8BAA8B;EAIrCC,WAAWA,CAACC,OAAe,EAAkC;IAAA,IAAhCa,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC1B,cAAc,CAAC;MAAEgB,OAAO;MAAEa;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF"}
|
1
|
+
{"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","UnexpectedStatusCodeError","statusCode","toString","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError","WalletInstanceRevokedError","WalletInstanceNotFoundError","AuthorizationError","AuthorizationIdpError","error","errorDescription","OperationAbortedError","operation","StatusAttestationInvalid","StatusAttestationError","CredentialNotEntitledError","CredentialRequestError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,cAAc,GACzBC,KAAsC,IAEtCC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,GAAG,CAACC,IAAA;EAAA,IAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;EAAA,OAAK,CAACC,CAAC,EAAEE,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAI,IAAGA,CAAC,CAACG,IAAI,CAAC,IAAI,CAAE,GAAE,GAAGH,CAAC,CAAC;AAAA,EAAC,CAChEH,GAAG,CAAEO,CAAC,IAAKA,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC,CAAC,CACvBA,IAAI,CAAC,GAAG,CAAC;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,aAAa,SAASC,KAAK,CAAC;EACvC;EACA,WAAWC,IAAIA,CAAA,EAAW;IACxB,OAAO,uBAAuB;EAChC;;EAEA;EACAA,IAAI,GAAW,uBAAuB;EAEtCC,WAAWA,CAACC,OAAgB,EAAE;IAAA,IAAAC,qBAAA;IAC5B,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,IAAI,CAACH,WAAW,CAACG,IAAI;IACjC;IACA,CAAAD,qBAAA,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8BAA8B;EACvC;EAEAA,IAAI,GAAG,8BAA8B;EAIrCC,WAAWA,CAACC,OAAe,EAAkC;IAAA,IAAhCa,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC1B,cAAc,CAAC;MAAEgB,OAAO;MAAEa;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMsB,0BAA0B,SAASvC,aAAa,CAAC;EAC5D,WAAWE,IAAIA,CAAA,EAAoC;IACjD,OAAO,+BAA+B;EACxC;EAEAA,IAAI,GAAG,+BAA+B;EAItCC,WAAWA,CAACC,OAAe,EAAkC;IAAA,IAAhCa,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC1B,cAAc,CAAC;MAAEgB,OAAO;MAAEa;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMuB,sBAAsB,SAASxC,aAAa,CAAC;EACxD,WAAWE,IAAIA,CAAA,EAA+B;IAC5C,OAAO,0BAA0B;EACnC;EAEAA,IAAI,GAAG,0BAA0B;EAIjCC,WAAWA,CAACC,OAAe,EAAkC;IAAA,IAAhCa,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC1B,cAAc,CAAC;MAAEgB,OAAO;MAAEa;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"06-obtain-credential.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/06-obtain-credential.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;
|
1
|
+
{"version":3,"file":"06-obtain-credential.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/06-obtain-credential.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAO5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAK7C,MAAM,MAAM,gBAAgB,GAAG,CAC7B,UAAU,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAClD,WAAW,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,EAChD,QAAQ,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,UAAU,CAAC,EACjD,oBAAoB,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,EACzE,OAAO,EAAE;IACP,iBAAiB,EAAE,aAAa,CAAC;IACjC,uBAAuB,EAAE,aAAa,CAAC;IACvC,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEjC,eAAO,MAAM,gBAAgB,UACpB,MAAM,UACL,MAAM,YACJ,MAAM,OACX,aAAa,KACjB,QAAQ,MAAM,CAehB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAkF9B,CAAC"}
|
@@ -206,4 +206,22 @@ export declare class StatusAttestationError extends IoWalletError {
|
|
206
206
|
reason: string;
|
207
207
|
constructor(message: string, reason?: string);
|
208
208
|
}
|
209
|
+
/**
|
210
|
+
* Error subclass thrown when the the user is not entitled to receive the requested credential.
|
211
|
+
*/
|
212
|
+
export declare class CredentialNotEntitledError extends IoWalletError {
|
213
|
+
static get code(): "CREDENTIAL_NOT_ENTITLED_ERROR";
|
214
|
+
code: string;
|
215
|
+
reason: string;
|
216
|
+
constructor(message: string, reason?: string);
|
217
|
+
}
|
218
|
+
/**
|
219
|
+
* Error subclass thrown when an error occurs while requesting a credential.
|
220
|
+
*/
|
221
|
+
export declare class CredentialRequestError extends IoWalletError {
|
222
|
+
static get code(): "CREDENTIAL_REQUEST_ERROR";
|
223
|
+
code: string;
|
224
|
+
reason: string;
|
225
|
+
constructor(message: string, reason?: string);
|
226
|
+
}
|
209
227
|
//# sourceMappingURL=errors.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,UAClB,OAAO,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KACrC,MAIW,CAAC;AAEf;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,6DAA6D;IAC7D,MAAM,KAAK,IAAI,IAAI,MAAM,CAExB;IAED,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAA2B;gBAE3B,OAAO,CAAC,EAAE,MAAM;CAM7B;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,aAAa;IAC1D,MAAM,KAAK,IAAI,IA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KAAK,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM;CAOrD;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,aAAa;IACtD,MAAM,KAAK,IAAI,IAAI,iCAAiC,CAEnD;IAED,IAAI,SAAqC;IAEzC,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;gBAEN,SAAS,EAAE,MAAM;CAI9B;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,aAAa;IACzD,MAAM,KAAK,IAAI,IAAI,gCAAgC,CAElD;IAED,IAAI,SAAoC;IAExC,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAsB;CAI5D;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,MAAM,KAAK,IAAI,IAAI,8BAA8B,CAEhD;IAED,IAAI,SAAkC;IAEtC,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAsB;CAI5D;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,aAAa;IAC3D,MAAM,KAAK,IAAI,IAAI,+BAA+B,CAEjD;IAED,IAAI,SAAmC;IAEvC,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAsB;CAI5D;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,MAAM,KAAK,IAAI,IAAI,0BAA0B,CAE5C;IAED,IAAI,SAA8B;IAElC,MAAM,EAAE,MAAM,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAsB;CAI5D"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pagopa/io-react-native-wallet",
|
3
|
-
"version": "0.16.
|
3
|
+
"version": "0.16.3",
|
4
4
|
"description": "Provide data structures, helpers and API for IO Wallet",
|
5
5
|
"main": "lib/commonjs/index",
|
6
6
|
"module": "lib/module/index",
|
@@ -29,7 +29,7 @@
|
|
29
29
|
"scripts": {
|
30
30
|
"test": "jest",
|
31
31
|
"tsc": "tsc --noEmit",
|
32
|
-
"lint": "eslint
|
32
|
+
"lint": "eslint . -c .eslintrc.js --ext .ts,.tsx",
|
33
33
|
"prepack": "bob build",
|
34
34
|
"release": "release-it",
|
35
35
|
"example": "yarn --cwd example",
|
@@ -60,7 +60,7 @@
|
|
60
60
|
"@react-native/eslint-config": "^0.72.2",
|
61
61
|
"@rushstack/eslint-patch": "^1.3.2",
|
62
62
|
"@types/jest": "^28.1.2",
|
63
|
-
"@types/react": "
|
63
|
+
"@types/react": "^18.0.24",
|
64
64
|
"@types/react-native": "0.70.0",
|
65
65
|
"del-cli": "^5.0.0",
|
66
66
|
"eslint": "^8.4.1",
|
@@ -75,7 +75,7 @@
|
|
75
75
|
"typescript": "^5.0.2"
|
76
76
|
},
|
77
77
|
"resolutions": {
|
78
|
-
"@types/react": "
|
78
|
+
"@types/react": "^18.0.24"
|
79
79
|
},
|
80
80
|
"peerDependencies": {
|
81
81
|
"@pagopa/io-react-native-crypto": "*",
|
@@ -7,7 +7,12 @@ import type { AuthorizeAccess } from "./05-authorize-access";
|
|
7
7
|
import type { EvaluateIssuerTrust } from "./02-evaluate-issuer-trust";
|
8
8
|
import { hasStatus, type Out } from "../../utils/misc";
|
9
9
|
import type { StartUserAuthorization } from "./03-start-user-authorization";
|
10
|
-
import {
|
10
|
+
import {
|
11
|
+
CredentialNotEntitledError,
|
12
|
+
CredentialRequestError,
|
13
|
+
UnexpectedStatusCodeError,
|
14
|
+
ValidationFailed,
|
15
|
+
} from "../../utils/errors";
|
11
16
|
import { CredentialResponse } from "./types";
|
12
17
|
|
13
18
|
import { createDPopToken } from "../../utils/dpop";
|
@@ -137,7 +142,8 @@ export const obtainCredential: ObtainCredential = async (
|
|
137
142
|
})
|
138
143
|
.then(hasStatus(200))
|
139
144
|
.then((res) => res.json())
|
140
|
-
.then((body) => CredentialResponse.safeParse(body))
|
145
|
+
.then((body) => CredentialResponse.safeParse(body))
|
146
|
+
.catch(handleObtainCredentialError);
|
141
147
|
|
142
148
|
if (!credentialRes.success) {
|
143
149
|
throw new ValidationFailed(credentialRes.error.message);
|
@@ -145,3 +151,28 @@ export const obtainCredential: ObtainCredential = async (
|
|
145
151
|
|
146
152
|
return credentialRes.data;
|
147
153
|
};
|
154
|
+
|
155
|
+
/**
|
156
|
+
* Handle the credential error by mapping it to a custom exception.
|
157
|
+
* If the error is not an instance of {@link UnexpectedStatusCodeError}, it is thrown as is.
|
158
|
+
* @param e - The error to be handled
|
159
|
+
* @throws {@link StatusAttestationError} if the status code is different from 404
|
160
|
+
* @throws {@link StatusAttestationInvalid} if the status code is 404 (meaning the credential is invalid)
|
161
|
+
*/
|
162
|
+
const handleObtainCredentialError = (e: unknown) => {
|
163
|
+
if (!(e instanceof UnexpectedStatusCodeError)) {
|
164
|
+
throw e;
|
165
|
+
}
|
166
|
+
|
167
|
+
if (e.statusCode === 404) {
|
168
|
+
throw new CredentialNotEntitledError(
|
169
|
+
"Invalid status found for the given credential",
|
170
|
+
e.message
|
171
|
+
);
|
172
|
+
}
|
173
|
+
|
174
|
+
throw new CredentialRequestError(
|
175
|
+
`Unable to obtain the requested credential [response status code: ${e.statusCode}]`,
|
176
|
+
e.message
|
177
|
+
);
|
178
|
+
};
|
package/src/utils/errors.ts
CHANGED
@@ -426,3 +426,39 @@ export class StatusAttestationError extends IoWalletError {
|
|
426
426
|
this.reason = reason;
|
427
427
|
}
|
428
428
|
}
|
429
|
+
|
430
|
+
/**
|
431
|
+
* Error subclass thrown when the the user is not entitled to receive the requested credential.
|
432
|
+
*/
|
433
|
+
export class CredentialNotEntitledError extends IoWalletError {
|
434
|
+
static get code(): "CREDENTIAL_NOT_ENTITLED_ERROR" {
|
435
|
+
return "CREDENTIAL_NOT_ENTITLED_ERROR";
|
436
|
+
}
|
437
|
+
|
438
|
+
code = "CREDENTIAL_NOT_ENTITLED_ERROR";
|
439
|
+
|
440
|
+
reason: string;
|
441
|
+
|
442
|
+
constructor(message: string, reason: string = "unspecified") {
|
443
|
+
super(serializeAttrs({ message, reason }));
|
444
|
+
this.reason = reason;
|
445
|
+
}
|
446
|
+
}
|
447
|
+
|
448
|
+
/**
|
449
|
+
* Error subclass thrown when an error occurs while requesting a credential.
|
450
|
+
*/
|
451
|
+
export class CredentialRequestError extends IoWalletError {
|
452
|
+
static get code(): "CREDENTIAL_REQUEST_ERROR" {
|
453
|
+
return "CREDENTIAL_REQUEST_ERROR";
|
454
|
+
}
|
455
|
+
|
456
|
+
code = "CREDENTIAL_REQUEST_ERROR";
|
457
|
+
|
458
|
+
reason: string;
|
459
|
+
|
460
|
+
constructor(message: string, reason: string = "unspecified") {
|
461
|
+
super(serializeAttrs({ message, reason }));
|
462
|
+
this.reason = reason;
|
463
|
+
}
|
464
|
+
}
|