@verii/vnf-nodejs-wallet-sdk 1.2.0-pre.1779931146 → 1.2.0-pre.1780194446
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/entities/VCLJwt.js +2 -13
- package/dist/api/entities/VCLJwt.js.map +1 -1
- package/dist/api/entities/error/VCLErrorCode.d.ts +1 -0
- package/dist/api/entities/error/VCLErrorCode.js +1 -0
- package/dist/api/entities/error/VCLErrorCode.js.map +1 -1
- package/dist/impl/data/repositories/CredentialManifestRepositoryImpl.d.ts +2 -1
- package/dist/impl/data/repositories/CredentialManifestRepositoryImpl.js +3 -17
- package/dist/impl/data/repositories/CredentialManifestRepositoryImpl.js.map +1 -1
- package/dist/impl/data/repositories/PresentationRequestRepositoryImpl.d.ts +2 -1
- package/dist/impl/data/repositories/PresentationRequestRepositoryImpl.js +3 -17
- package/dist/impl/data/repositories/PresentationRequestRepositoryImpl.js.map +1 -1
- package/dist/impl/data/repositories/VerifiedProfileRepositoryImpl.js +11 -0
- package/dist/impl/data/repositories/VerifiedProfileRepositoryImpl.js.map +1 -1
- package/dist/impl/data/usecases/CredentialManifestUseCaseImpl.d.ts +1 -4
- package/dist/impl/data/usecases/CredentialManifestUseCaseImpl.js +24 -20
- package/dist/impl/data/usecases/CredentialManifestUseCaseImpl.js.map +1 -1
- package/dist/impl/data/usecases/PresentationRequestUseCaseImpl.d.ts +0 -1
- package/dist/impl/data/usecases/PresentationRequestUseCaseImpl.js +12 -14
- package/dist/impl/data/usecases/PresentationRequestUseCaseImpl.js.map +1 -1
- package/dist/impl/data/verifiers/CredentialManifestByDeepLinkVerifierImpl.d.ts +1 -2
- package/dist/impl/data/verifiers/CredentialManifestByDeepLinkVerifierImpl.js +7 -31
- package/dist/impl/data/verifiers/CredentialManifestByDeepLinkVerifierImpl.js.map +1 -1
- package/dist/impl/data/verifiers/PresentationRequestByDeepLinkVerifierImpl.d.ts +1 -2
- package/dist/impl/data/verifiers/PresentationRequestByDeepLinkVerifierImpl.js +6 -32
- package/dist/impl/data/verifiers/PresentationRequestByDeepLinkVerifierImpl.js.map +1 -1
- package/dist/impl/domain/repositories/CredentialManifestRepository.d.ts +2 -1
- package/dist/impl/domain/repositories/PresentationRequestRepository.d.ts +2 -1
- package/dist/impl/domain/verifiers/CredentialManifestByDeepLinkVerifier.d.ts +1 -1
- package/dist/impl/domain/verifiers/PresentationRequestByDeepLinkVerifier.d.ts +1 -1
- package/dist/impl/utils/ErrorTaxonomy.d.ts +1 -0
- package/dist/impl/utils/ErrorTaxonomy.js +34 -17
- package/dist/impl/utils/ErrorTaxonomy.js.map +1 -1
- package/dist/impl/utils/ErrorTaxonomyCompatibilityMapper.js +2 -1
- package/dist/impl/utils/ErrorTaxonomyCompatibilityMapper.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.SignedJWT = void 0;
|
|
7
|
-
const VCLLog_1 = __importDefault(require("../../impl/utils/VCLLog"));
|
|
8
4
|
class VCLJwt {
|
|
9
5
|
constructor(signedJwt) {
|
|
10
6
|
this.signedJwt = signedJwt;
|
|
@@ -16,15 +12,8 @@ class VCLJwt {
|
|
|
16
12
|
}
|
|
17
13
|
static fromEncodedJwt(encodedJwt) {
|
|
18
14
|
var _a, _b, _c;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const encodedJwtArr = encodedJwt.split('.');
|
|
22
|
-
item = new VCLJwt(new SignedJWT((_a = encodedJwtArr[0]) !== null && _a !== void 0 ? _a : '', (_b = encodedJwtArr[1]) !== null && _b !== void 0 ? _b : '', (_c = encodedJwtArr[2]) !== null && _c !== void 0 ? _c : ''));
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
VCLLog_1.default.error(e);
|
|
26
|
-
}
|
|
27
|
-
return item;
|
|
15
|
+
const encodedJwtArr = encodedJwt.split('.');
|
|
16
|
+
return new VCLJwt(new SignedJWT((_a = encodedJwtArr[0]) !== null && _a !== void 0 ? _a : '', (_b = encodedJwtArr[1]) !== null && _b !== void 0 ? _b : '', (_c = encodedJwtArr[2]) !== null && _c !== void 0 ? _c : ''));
|
|
28
17
|
}
|
|
29
18
|
get kid() {
|
|
30
19
|
var _a, _b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VCLJwt.js","sourceRoot":"","sources":["../../../src/api/entities/VCLJwt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VCLJwt.js","sourceRoot":"","sources":["../../../src/api/entities/VCLJwt.ts"],"names":[],"mappings":";;;AAGA,MAAqB,MAAM;IASvB,YAAmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;QACnC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;QAExC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,UAAkB;;QACpC,MAAM,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5C,OAAO,IAAI,MAAM,CACb,IAAI,SAAS,CACT,MAAA,aAAa,CAAC,CAAC,CAAC,mCAAI,EAAE,EACtB,MAAA,aAAa,CAAC,CAAC,CAAC,mCAAI,EAAE,EACtB,MAAA,aAAa,CAAC,CAAC,CAAC,mCAAI,EAAE,CACzB,CACJ,CAAC;IACN,CAAC;IAED,IAAI,GAAG;;QACH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AAK,CAAC;AAEf,eAAI,GAAG,GAAG,CAAC;AAEX,eAAI,GAAG,GAAG,CAAC;AAEX,oBAAS,GAAG,QAAQ,CAAC;AAErB,qBAAU,GAAG,SAAS,CAAC;AAEvB,uBAAY,GAAG,WAAW,CAAC;AAE3B,iBAAM,GAAG,KAAK,CAAC;AAEf,iBAAM,GAAG,KAAK,CAAC;AAEf,iBAAM,GAAG,KAAK,CAAC;AAEf,iBAAM,GAAG,KAAK,CAAC;AAEf,iBAAM,GAAG,KAAK,CAAC;AAEf,iBAAM,GAAG,KAAK,CAAC;AAEf,iBAAM,GAAG,KAAK,CAAC;AAEf,mBAAQ,GAAG,OAAO,CAAC"}
|
|
@@ -19,6 +19,7 @@ declare enum VCLErrorCode {
|
|
|
19
19
|
VerifierDidUnresolvable = "verifier_did_unresolvable",
|
|
20
20
|
IssuerNotRegistered = "issuer_not_registered",
|
|
21
21
|
VerifierNotRegistered = "verifier_not_registered",
|
|
22
|
+
RegistrationCheckInconclusive = "registration_check_inconclusive",
|
|
22
23
|
IssuerRequestInvalid = "issuer_request_invalid",
|
|
23
24
|
VerifierRequestInvalid = "verifier_request_invalid",
|
|
24
25
|
IssuerRequestUnauthorized = "issuer_request_unauthorized",
|
|
@@ -22,6 +22,7 @@ var VCLErrorCode;
|
|
|
22
22
|
VCLErrorCode["VerifierDidUnresolvable"] = "verifier_did_unresolvable";
|
|
23
23
|
VCLErrorCode["IssuerNotRegistered"] = "issuer_not_registered";
|
|
24
24
|
VCLErrorCode["VerifierNotRegistered"] = "verifier_not_registered";
|
|
25
|
+
VCLErrorCode["RegistrationCheckInconclusive"] = "registration_check_inconclusive";
|
|
25
26
|
VCLErrorCode["IssuerRequestInvalid"] = "issuer_request_invalid";
|
|
26
27
|
VCLErrorCode["VerifierRequestInvalid"] = "verifier_request_invalid";
|
|
27
28
|
VCLErrorCode["IssuerRequestUnauthorized"] = "issuer_request_unauthorized";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VCLErrorCode.js","sourceRoot":"","sources":["../../../../src/api/entities/error/VCLErrorCode.ts"],"names":[],"mappings":";;AAAA,IAAK,
|
|
1
|
+
{"version":3,"file":"VCLErrorCode.js","sourceRoot":"","sources":["../../../../src/api/entities/error/VCLErrorCode.ts"],"names":[],"mappings":";;AAAA,IAAK,YAoCJ;AApCD,WAAK,YAAY;IAEb,6EAA6D,CAAA;IAC7D,wEAAwD,CAAA;IAGxD,8EAA8D,CAAA;IAC9D,wFAAwE,CAAA;IACxE,oFAAoE,CAAA;IACpE,gFAAgE,CAAA;IAChE,sFAAsE,CAAA;IACtE,0FAA0E,CAAA;IAG1E,4EAA4D,CAAA;IAC5D,wEAAwD,CAAA;IACxD,kFAAkE,CAAA;IAClE,2GAA2F,CAAA;IAG3F,4CAA4B,CAAA;IAC5B,4DAA4C,CAAA;IAC5C,yEAAyD,CAAA;IACzD,iEAAiD,CAAA;IACjD,iEAAiD,CAAA;IACjD,qEAAqD,CAAA;IACrD,6DAA6C,CAAA;IAC7C,iEAAiD,CAAA;IACjD,iFAAiE,CAAA;IACjE,+DAA+C,CAAA;IAC/C,mEAAmD,CAAA;IACnD,yEAAyD,CAAA;IACzD,6EAA6D,CAAA;IAG7D,sCAAsB,CAAA;AAC1B,CAAC,EApCI,YAAY,KAAZ,YAAY,QAoChB;AACD,kBAAe,YAAY,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import VCLCredentialManifestDescriptor from '../../../api/entities/VCLCredentialManifestDescriptor';
|
|
2
|
+
import { Nullish } from '../../../api/VCLTypes';
|
|
2
3
|
import NetworkService from '../../domain/infrastructure/network/NetworkService';
|
|
3
4
|
import CredentialManifestRepository from '../../domain/repositories/CredentialManifestRepository';
|
|
4
5
|
export default class CredentialManifestRepositoryImpl implements CredentialManifestRepository {
|
|
5
6
|
private readonly networkService;
|
|
6
7
|
constructor(networkService: NetworkService);
|
|
7
|
-
getCredentialManifest(credentialManifestDescriptor: VCLCredentialManifestDescriptor): Promise<string
|
|
8
|
+
getCredentialManifest(credentialManifestDescriptor: VCLCredentialManifestDescriptor): Promise<Nullish<string>>;
|
|
8
9
|
}
|
|
@@ -17,25 +17,18 @@ const VCLError_1 = __importDefault(require("../../../api/entities/error/VCLError
|
|
|
17
17
|
const Urls_1 = require("./Urls");
|
|
18
18
|
const HttpMethod_1 = require("../infrastructure/network/HttpMethod");
|
|
19
19
|
const ErrorTaxonomy_1 = require("../../utils/ErrorTaxonomy");
|
|
20
|
-
const VelocityDeepLinkValidator_1 = __importDefault(require("../../utils/VelocityDeepLinkValidator"));
|
|
21
20
|
class CredentialManifestRepositoryImpl {
|
|
22
21
|
constructor(networkService) {
|
|
23
22
|
this.networkService = networkService;
|
|
24
23
|
}
|
|
25
24
|
getCredentialManifest(credentialManifestDescriptor) {
|
|
26
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
var _a;
|
|
27
27
|
const { endpoint } = credentialManifestDescriptor;
|
|
28
|
-
if (!endpoint) {
|
|
29
|
-
throw (0, ErrorTaxonomy_1.invalidLink)({
|
|
30
|
-
message: 'credentialManifestDescriptor.endpoint = null',
|
|
31
|
-
sourceErrorCode: VelocityDeepLinkValidator_1.default.SourceInvalidOrMissingRequestEndpoint,
|
|
32
|
-
requestKind: ErrorTaxonomy_1.ErrorTaxonomy.RequestKindIssuing,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
28
|
let credentialManifestResponse;
|
|
36
29
|
try {
|
|
37
30
|
credentialManifestResponse = yield this.networkService.sendRequest({
|
|
38
|
-
endpoint,
|
|
31
|
+
endpoint: endpoint,
|
|
39
32
|
method: HttpMethod_1.HttpMethod.GET,
|
|
40
33
|
body: null,
|
|
41
34
|
headers: {
|
|
@@ -49,14 +42,7 @@ class CredentialManifestRepositoryImpl {
|
|
|
49
42
|
requestKind: ErrorTaxonomy_1.ErrorTaxonomy.RequestKindIssuing,
|
|
50
43
|
});
|
|
51
44
|
}
|
|
52
|
-
|
|
53
|
-
if (!issuingRequest) {
|
|
54
|
-
throw (0, ErrorTaxonomy_1.toClientRequestFetchError)(new VCLError_1.default({ message: 'Missing issuing_request' }), {
|
|
55
|
-
requestUri: endpoint,
|
|
56
|
-
requestKind: ErrorTaxonomy_1.ErrorTaxonomy.RequestKindIssuing,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
return issuingRequest;
|
|
45
|
+
return (_a = credentialManifestResponse.payload) === null || _a === void 0 ? void 0 : _a[VCLCredentialManifest_1.default.KeyIssuingRequest];
|
|
60
46
|
});
|
|
61
47
|
}
|
|
62
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialManifestRepositoryImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/repositories/CredentialManifestRepositoryImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wGAAgF;AAEhF,oFAA4D;
|
|
1
|
+
{"version":3,"file":"CredentialManifestRepositoryImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/repositories/CredentialManifestRepositoryImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wGAAgF;AAEhF,oFAA4D;AAI5D,iCAAkD;AAClD,qEAAkE;AAClE,6DAGmC;AAEnC,MAAqB,gCAAgC;IACjD,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAEzD,qBAAqB,CACvB,4BAA6D;;;YAE7D,MAAM,EAAE,QAAQ,EAAE,GAAG,4BAA4B,CAAC;YAClD,IAAI,0BAA0B,CAAC;YAC/B,IAAI,CAAC;gBACD,0BAA0B,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;oBAC/D,QAAQ,EAAE,QAAS;oBACnB,MAAM,EAAE,uBAAU,CAAC,GAAG;oBACtB,IAAI,EAAE,IAAI;oBACV,OAAO,EAAE;wBACL,CAAC,iBAAU,CAAC,mBAAmB,CAAC,EAC5B,mBAAY,CAAC,mBAAmB;qBACvC;iBACJ,CAAC,CAAC;YACP,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,MAAM,IAAA,yCAAyB,EAAC,kBAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;oBACvD,UAAU,EAAE,QAAQ;oBACpB,WAAW,EAAE,6BAAa,CAAC,kBAAkB;iBAChD,CAAC,CAAC;YACP,CAAC;YACD,OAAO,MAAA,0BAA0B,CAAC,OAAO,0CACrC,+BAAqB,CAAC,iBAAiB,CAC1C,CAAC;QACN,CAAC;KAAA;CACJ;AA5BD,mDA4BC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import VCLPresentationRequestDescriptor from '../../../api/entities/VCLPresentationRequestDescriptor';
|
|
2
|
+
import { Nullish } from '../../../api/VCLTypes';
|
|
2
3
|
import NetworkService from '../../domain/infrastructure/network/NetworkService';
|
|
3
4
|
import PresentationRequestRepository from '../../domain/repositories/PresentationRequestRepository';
|
|
4
5
|
export default class PresentationRequestRepositoryImpl implements PresentationRequestRepository {
|
|
5
6
|
private readonly networkService;
|
|
6
7
|
constructor(networkService: NetworkService);
|
|
7
|
-
getPresentationRequest(presentationRequestDescriptor: VCLPresentationRequestDescriptor): Promise<string
|
|
8
|
+
getPresentationRequest(presentationRequestDescriptor: VCLPresentationRequestDescriptor): Promise<Nullish<string>>;
|
|
8
9
|
}
|
|
@@ -17,25 +17,18 @@ const VCLPresentationRequest_1 = __importDefault(require("../../../api/entities/
|
|
|
17
17
|
const Urls_1 = require("./Urls");
|
|
18
18
|
const HttpMethod_1 = require("../infrastructure/network/HttpMethod");
|
|
19
19
|
const ErrorTaxonomy_1 = require("../../utils/ErrorTaxonomy");
|
|
20
|
-
const VelocityDeepLinkValidator_1 = __importDefault(require("../../utils/VelocityDeepLinkValidator"));
|
|
21
20
|
class PresentationRequestRepositoryImpl {
|
|
22
21
|
constructor(networkService) {
|
|
23
22
|
this.networkService = networkService;
|
|
24
23
|
}
|
|
25
24
|
getPresentationRequest(presentationRequestDescriptor) {
|
|
26
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
var _a;
|
|
27
27
|
const { endpoint } = presentationRequestDescriptor;
|
|
28
|
-
if (!endpoint) {
|
|
29
|
-
throw (0, ErrorTaxonomy_1.invalidLink)({
|
|
30
|
-
message: 'presentationRequestDescriptor.endpoint = null',
|
|
31
|
-
sourceErrorCode: VelocityDeepLinkValidator_1.default.SourceInvalidOrMissingRequestEndpoint,
|
|
32
|
-
requestKind: ErrorTaxonomy_1.ErrorTaxonomy.RequestKindPresentation,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
28
|
let presentationRequestResponse;
|
|
36
29
|
try {
|
|
37
30
|
presentationRequestResponse = yield this.networkService.sendRequest({
|
|
38
|
-
endpoint,
|
|
31
|
+
endpoint: endpoint,
|
|
39
32
|
method: HttpMethod_1.HttpMethod.GET,
|
|
40
33
|
headers: {
|
|
41
34
|
[Urls_1.HeaderKeys.XVnfProtocolVersion]: Urls_1.HeaderValues.XVnfProtocolVersion,
|
|
@@ -48,14 +41,7 @@ class PresentationRequestRepositoryImpl {
|
|
|
48
41
|
requestKind: ErrorTaxonomy_1.ErrorTaxonomy.RequestKindPresentation,
|
|
49
42
|
});
|
|
50
43
|
}
|
|
51
|
-
|
|
52
|
-
if (!presentationRequest) {
|
|
53
|
-
throw (0, ErrorTaxonomy_1.toClientRequestFetchError)(new VCLError_1.default({ message: 'Missing presentation_request' }), {
|
|
54
|
-
requestUri: endpoint,
|
|
55
|
-
requestKind: ErrorTaxonomy_1.ErrorTaxonomy.RequestKindPresentation,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
return presentationRequest;
|
|
44
|
+
return (_a = presentationRequestResponse.payload) === null || _a === void 0 ? void 0 : _a[VCLPresentationRequest_1.default.KeyPresentationRequest];
|
|
59
45
|
});
|
|
60
46
|
}
|
|
61
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationRequestRepositoryImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/repositories/PresentationRequestRepositoryImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oFAA4D;AAC5D,0GAAkF;
|
|
1
|
+
{"version":3,"file":"PresentationRequestRepositoryImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/repositories/PresentationRequestRepositoryImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oFAA4D;AAC5D,0GAAkF;AAKlF,iCAAkD;AAClD,qEAAkE;AAClE,6DAGmC;AAEnC,MAAqB,iCAAiC;IAClD,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAEzD,sBAAsB,CACxB,6BAA+D;;;YAE/D,MAAM,EAAE,QAAQ,EAAE,GAAG,6BAA6B,CAAC;YACnD,IAAI,2BAA2B,CAAC;YAChC,IAAI,CAAC;gBACD,2BAA2B,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAC/D;oBACI,QAAQ,EAAE,QAAS;oBACnB,MAAM,EAAE,uBAAU,CAAC,GAAG;oBACtB,OAAO,EAAE;wBACL,CAAC,iBAAU,CAAC,mBAAmB,CAAC,EAC5B,mBAAY,CAAC,mBAAmB;qBACvC;iBACJ,CACJ,CAAC;YACN,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,MAAM,IAAA,yCAAyB,EAAC,kBAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;oBACvD,UAAU,EAAE,QAAQ;oBACpB,WAAW,EAAE,6BAAa,CAAC,uBAAuB;iBACrD,CAAC,CAAC;YACP,CAAC;YACD,OAAO,MAAA,2BAA2B,CAAC,OAAO,0CACtC,gCAAsB,CAAC,sBAAsB,CAChD,CAAC;QACN,CAAC;KAAA;CACJ;AA7BD,oDA6BC"}
|
|
@@ -46,6 +46,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
const VCLVerifiedProfile_1 = __importDefault(require("../../../api/entities/VCLVerifiedProfile"));
|
|
49
|
+
const VCLError_1 = __importDefault(require("../../../api/entities/error/VCLError"));
|
|
50
|
+
const ErrorTaxonomy_1 = require("../../utils/ErrorTaxonomy");
|
|
49
51
|
const Urls_1 = __importStar(require("./Urls"));
|
|
50
52
|
const HttpMethod_1 = require("../infrastructure/network/HttpMethod");
|
|
51
53
|
class VerifiedProfileRepositoryImpl {
|
|
@@ -62,6 +64,15 @@ class VerifiedProfileRepositoryImpl {
|
|
|
62
64
|
[Urls_1.HeaderKeys.XVnfProtocolVersion]: Urls_1.HeaderValues.XVnfProtocolVersion,
|
|
63
65
|
},
|
|
64
66
|
});
|
|
67
|
+
if (verifiedProfileResponse.payload == null ||
|
|
68
|
+
typeof verifiedProfileResponse.payload !== 'object' ||
|
|
69
|
+
Array.isArray(verifiedProfileResponse.payload) ||
|
|
70
|
+
Object.keys(verifiedProfileResponse.payload).length === 0) {
|
|
71
|
+
throw new VCLError_1.default({
|
|
72
|
+
message: 'Malformed verified profile',
|
|
73
|
+
sourceErrorCode: ErrorTaxonomy_1.SourceMalformedVerifiedProfile,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
65
76
|
return new VCLVerifiedProfile_1.default(verifiedProfileResponse.payload);
|
|
66
77
|
});
|
|
67
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerifiedProfileRepositoryImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/repositories/VerifiedProfileRepositoryImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kGAA0E;
|
|
1
|
+
{"version":3,"file":"VerifiedProfileRepositoryImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/repositories/VerifiedProfileRepositoryImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kGAA0E;AAE1E,oFAA4D;AAG5D,6DAA2E;AAC3E,+CAAgE;AAChE,qEAAkE;AAElE,MAAqB,6BAA6B;IAC9C,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAEzD,kBAAkB,CACpB,yBAAuD;;YAEvD,MAAM,uBAAuB,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;gBAClE,MAAM,EAAE,uBAAU,CAAC,GAAG;gBACtB,QAAQ,EAAE,cAAI,CAAC,eAAe,CAAC,OAAO,CAClC,aAAM,CAAC,GAAG,EACV,yBAAyB,CAAC,GAAG,CAChC;gBACD,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE;oBACL,CAAC,iBAAU,CAAC,mBAAmB,CAAC,EAC5B,mBAAY,CAAC,mBAAmB;iBACvC;aACJ,CAAC,CAAC;YACH,IACI,uBAAuB,CAAC,OAAO,IAAI,IAAI;gBACvC,OAAO,uBAAuB,CAAC,OAAO,KAAK,QAAQ;gBACnD,KAAK,CAAC,OAAO,CAAC,uBAAuB,CAAC,OAAO,CAAC;gBAC9C,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAC3D,CAAC;gBACC,MAAM,IAAI,kBAAQ,CAAC;oBACf,OAAO,EAAE,4BAA4B;oBACrC,eAAe,EAAE,8CAA8B;iBAClD,CAAC,CAAC;YACP,CAAC;YACD,OAAO,IAAI,4BAAkB,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACnE,CAAC;KAAA;CACJ;AA/BD,gDA+BC"}
|
|
@@ -7,8 +7,6 @@ import VCLVerifiedProfile from '../../../api/entities/VCLVerifiedProfile';
|
|
|
7
7
|
import CredentialManifestByDeepLinkVerifier from '../../domain/verifiers/CredentialManifestByDeepLinkVerifier';
|
|
8
8
|
import VCLDidDocument from '../../../api/entities/VCLDidDocument';
|
|
9
9
|
import ResolveDidDocumentRepository from '../../domain/repositories/ResolveDidDocumentRepository';
|
|
10
|
-
import VCLDeepLink from '../../../api/entities/VCLDeepLink';
|
|
11
|
-
import { Nullish } from '../../../api/VCLTypes';
|
|
12
10
|
export default class CredentialManifestUseCaseImpl implements CredentialManifestUseCase {
|
|
13
11
|
private readonly credentialManifestRepository;
|
|
14
12
|
private readonly resolveDidDocumentRepository;
|
|
@@ -22,6 +20,5 @@ export default class CredentialManifestUseCaseImpl implements CredentialManifest
|
|
|
22
20
|
private resolvePublicJwk;
|
|
23
21
|
private validateDidDocumentVerificationMaterial;
|
|
24
22
|
verifyCredentialManifestJwt(credentialManifest: VCLCredentialManifest, didDocument: VCLDidDocument): Promise<VCLCredentialManifest>;
|
|
25
|
-
verifyCredentialManifestByDeepLink(credentialManifest: VCLCredentialManifest, didDocument: VCLDidDocument
|
|
26
|
-
onVerificationSuccess(isVerified: boolean, credentialManifest: VCLCredentialManifest): Promise<VCLCredentialManifest>;
|
|
23
|
+
verifyCredentialManifestByDeepLink(credentialManifest: VCLCredentialManifest, didDocument: VCLDidDocument): Promise<VCLCredentialManifest>;
|
|
27
24
|
}
|
|
@@ -14,7 +14,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const VCLCredentialManifest_1 = __importDefault(require("../../../api/entities/VCLCredentialManifest"));
|
|
16
16
|
const VCLError_1 = __importDefault(require("../../../api/entities/error/VCLError"));
|
|
17
|
-
const VCLJwt_1 = __importDefault(require("../../../api/entities/VCLJwt"));
|
|
18
17
|
const VCLLog_1 = __importDefault(require("../../utils/VCLLog"));
|
|
19
18
|
const VCLDidDocument_1 = __importDefault(require("../../../api/entities/VCLDidDocument"));
|
|
20
19
|
const ErrorTaxonomy_1 = require("../../utils/ErrorTaxonomy");
|
|
@@ -27,11 +26,21 @@ class CredentialManifestUseCaseImpl {
|
|
|
27
26
|
}
|
|
28
27
|
getCredentialManifest(credentialManifestDescriptor, verifiedProfile) {
|
|
29
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
var _a;
|
|
30
30
|
const jwtStr = yield this.credentialManifestRepository.getCredentialManifest(credentialManifestDescriptor);
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
let credentialManifest;
|
|
32
|
+
try {
|
|
33
|
+
credentialManifest = yield this.parseCredentialManifest(jwtStr, credentialManifestDescriptor, verifiedProfile);
|
|
34
|
+
if (!credentialManifest.iss) {
|
|
35
|
+
throw new VCLError_1.default({ message: 'Missing issuing_request' });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
throw (0, ErrorTaxonomy_1.toRequestValidationError)(VCLError_1.default.fromError(error), {
|
|
40
|
+
requestKind: ErrorTaxonomy_1.ErrorTaxonomy.RequestKindIssuing,
|
|
41
|
+
requestDid: (_a = credentialManifestDescriptor === null || credentialManifestDescriptor === void 0 ? void 0 : credentialManifestDescriptor.did) !== null && _a !== void 0 ? _a : null,
|
|
42
|
+
});
|
|
33
43
|
}
|
|
34
|
-
const credentialManifest = this.parseCredentialManifest(jwtStr, credentialManifestDescriptor, verifiedProfile);
|
|
35
44
|
const requestDid = credentialManifest.iss;
|
|
36
45
|
const didDocument = yield this.resolveDidDocument(credentialManifest);
|
|
37
46
|
try {
|
|
@@ -46,7 +55,12 @@ class CredentialManifestUseCaseImpl {
|
|
|
46
55
|
});
|
|
47
56
|
}
|
|
48
57
|
parseCredentialManifest(jwtStr, credentialManifestDescriptor, verifiedProfile) {
|
|
49
|
-
return
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
if (!jwtStr) {
|
|
60
|
+
throw new VCLError_1.default({ message: 'Missing issuing_request' });
|
|
61
|
+
}
|
|
62
|
+
return new VCLCredentialManifest_1.default(yield this.jwtServiceRepository.decode(jwtStr), credentialManifestDescriptor.vendorOriginContext, verifiedProfile, credentialManifestDescriptor.deepLink, credentialManifestDescriptor.didJwk, credentialManifestDescriptor.remoteCryptoServicesToken);
|
|
63
|
+
});
|
|
50
64
|
}
|
|
51
65
|
resolveDidDocument(credentialManifest) {
|
|
52
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -106,27 +120,17 @@ class CredentialManifestUseCaseImpl {
|
|
|
106
120
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
121
|
const publicJwk = this.resolvePublicJwk(credentialManifest, didDocument);
|
|
108
122
|
yield this.jwtServiceRepository.verifyJwt(credentialManifest.jwt, publicJwk, credentialManifest.remoteCryptoServicesToken);
|
|
109
|
-
return this.verifyCredentialManifestByDeepLink(credentialManifest, didDocument
|
|
123
|
+
return this.verifyCredentialManifestByDeepLink(credentialManifest, didDocument);
|
|
110
124
|
});
|
|
111
125
|
}
|
|
112
|
-
verifyCredentialManifestByDeepLink(credentialManifest, didDocument
|
|
126
|
+
verifyCredentialManifestByDeepLink(credentialManifest, didDocument) {
|
|
113
127
|
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
-
if (credentialManifest.deepLink
|
|
128
|
+
if (credentialManifest.deepLink == null) {
|
|
115
129
|
VCLLog_1.default.info('Deep link was not provided => nothing to verify');
|
|
116
130
|
return credentialManifest;
|
|
117
131
|
}
|
|
118
|
-
|
|
119
|
-
return
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
onVerificationSuccess(isVerified, credentialManifest) {
|
|
123
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
-
if (isVerified) {
|
|
125
|
-
return credentialManifest;
|
|
126
|
-
}
|
|
127
|
-
throw new VCLError_1.default({
|
|
128
|
-
message: `Failed to verify credentialManifest jwt:\n${credentialManifest.jwt}`,
|
|
129
|
-
});
|
|
132
|
+
this.credentialManifestByDeepLinkVerifier.verifyCredentialManifest(credentialManifest, credentialManifest.deepLink, didDocument);
|
|
133
|
+
return credentialManifest;
|
|
130
134
|
});
|
|
131
135
|
}
|
|
132
136
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialManifestUseCaseImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/usecases/CredentialManifestUseCaseImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wGAAgF;AAEhF,oFAA4D;
|
|
1
|
+
{"version":3,"file":"CredentialManifestUseCaseImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/usecases/CredentialManifestUseCaseImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wGAAgF;AAEhF,oFAA4D;AAO5D,gEAAwC;AACxC,0FAAkE;AAGlE,6DAImC;AAEnC,MAAqB,6BAA6B;IAC9C,YACqB,4BAA0D,EAC1D,4BAA0D,EAC1D,oBAA0C,EAC1C,oCAA0E;QAH1E,iCAA4B,GAA5B,4BAA4B,CAA8B;QAC1D,iCAA4B,GAA5B,4BAA4B,CAA8B;QAC1D,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,yCAAoC,GAApC,oCAAoC,CAAsC;IAC5F,CAAC;IAEE,qBAAqB,CACvB,4BAA6D,EAC7D,eAAmC;;;YAEnC,MAAM,MAAM,GACR,MAAM,IAAI,CAAC,4BAA4B,CAAC,qBAAqB,CACzD,4BAA4B,CAC/B,CAAC;YACN,IAAI,kBAAyC,CAAC;YAC9C,IAAI,CAAC;gBACD,kBAAkB,GAAG,MAAM,IAAI,CAAC,uBAAuB,CACnD,MAAM,EACN,4BAA4B,EAC5B,eAAe,CAClB,CAAC;gBACF,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC;oBAC1B,MAAM,IAAI,kBAAQ,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC,CAAC;gBAC/D,CAAC;YACL,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,MAAM,IAAA,wCAAwB,EAAC,kBAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;oBACtD,WAAW,EAAE,6BAAa,CAAC,kBAAkB;oBAC7C,UAAU,EAAE,MAAA,4BAA4B,aAA5B,4BAA4B,uBAA5B,4BAA4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BAAqB,CAAC,CAAC;QAChE,IACI,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC;YAClC,kBAAkB,CAAC,MAAM,KAAK,CAAC,EACjC,CAAC;YACC,MAAM,IAAA,oCAAoB,EACtB,IAAI,kBAAQ,CAAC;gBACT,OAAO,EAAE,sBAAsB;aAClC,CAAC,EACF;gBACI,WAAW,EAAE,6BAAa,CAAC,kBAAkB;gBAC7C,UAAU,EAAE,kBAAkB,CAAC,GAAG;aACrC,CACJ,CAAC;QACN,CAAC;IACL,CAAC;IAEK,2BAA2B,CAC7B,kBAAyC,EACzC,WAA2B;;YAE3B,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CACnC,kBAAkB,EAClB,WAAW,CACd,CAAC;YACF,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS,CACrC,kBAAkB,CAAC,GAAG,EACtB,SAAS,EACT,kBAAkB,CAAC,yBAAyB,CAC/C,CAAC;YACF,OAAO,IAAI,CAAC,kCAAkC,CAC1C,kBAAkB,EAClB,WAAW,CACd,CAAC;QACN,CAAC;KAAA;IAEK,kCAAkC,CACpC,kBAAyC,EACzC,WAA2B;;YAE3B,IAAI,kBAAkB,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;gBACtC,gBAAM,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;gBAC/D,OAAO,kBAAkB,CAAC;YAC9B,CAAC;YACD,IAAI,CAAC,oCAAoC,CAAC,wBAAwB,CAC9D,kBAAkB,EAClB,kBAAkB,CAAC,QAAQ,EAC3B,WAAW,CACd,CAAC;YACF,OAAO,kBAAkB,CAAC;QAC9B,CAAC;KAAA;CACJ;AAjLD,gDAiLC"}
|
|
@@ -18,5 +18,4 @@ export default class PresentationRequestUseCaseImpl implements PresentationReque
|
|
|
18
18
|
private validateDidDocumentVerificationMaterial;
|
|
19
19
|
private resolvePublicJwk;
|
|
20
20
|
verifyPresentationRequest(presentationRequest: VCLPresentationRequest, didDocument: VCLDidDocument): Promise<VCLPresentationRequest>;
|
|
21
|
-
onVerificationSuccess(isVerified: boolean, presentationRequest: VCLPresentationRequest): Promise<VCLPresentationRequest>;
|
|
22
21
|
}
|
|
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const VCLError_1 = __importDefault(require("../../../api/entities/error/VCLError"));
|
|
16
16
|
const VCLPresentationRequest_1 = __importDefault(require("../../../api/entities/VCLPresentationRequest"));
|
|
17
17
|
const VCLDidDocument_1 = __importDefault(require("../../../api/entities/VCLDidDocument"));
|
|
18
|
-
const VCLLog_1 = __importDefault(require("../../utils/VCLLog"));
|
|
19
18
|
const ErrorTaxonomy_1 = require("../../utils/ErrorTaxonomy");
|
|
20
19
|
class PresentationRequestUseCaseImpl {
|
|
21
20
|
constructor(presentationRequestRepository, resolveDidDocumentRepository, jwtServiceRepository, presentationRequestByDeepLinkVerifier) {
|
|
@@ -31,8 +30,18 @@ class PresentationRequestUseCaseImpl {
|
|
|
31
30
|
let requestDid = (_a = presentationRequestDescriptor.did) !== null && _a !== void 0 ? _a : null;
|
|
32
31
|
let presentationRequest;
|
|
33
32
|
try {
|
|
33
|
+
if (!encodedJwtStr) {
|
|
34
|
+
throw new VCLError_1.default({
|
|
35
|
+
message: 'Missing presentation_request',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
34
38
|
const jwt = yield this.jwtServiceRepository.decode(encodedJwtStr);
|
|
35
39
|
presentationRequest = new VCLPresentationRequest_1.default(jwt, verifiedProfile, presentationRequestDescriptor.deepLink, presentationRequestDescriptor.pushDelegate, presentationRequestDescriptor.didJwk, presentationRequestDescriptor.remoteCryptoServicesToken);
|
|
40
|
+
if (!presentationRequest.iss) {
|
|
41
|
+
throw new VCLError_1.default({
|
|
42
|
+
message: 'Missing presentation_request',
|
|
43
|
+
});
|
|
44
|
+
}
|
|
36
45
|
requestDid = presentationRequest.iss;
|
|
37
46
|
}
|
|
38
47
|
catch (error) {
|
|
@@ -103,19 +112,8 @@ class PresentationRequestUseCaseImpl {
|
|
|
103
112
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
113
|
const publicJwk = this.resolvePublicJwk(presentationRequest, didDocument);
|
|
105
114
|
yield this.jwtServiceRepository.verifyJwt(presentationRequest.jwt, publicJwk, presentationRequest.remoteCryptoServicesToken);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return this.onVerificationSuccess(isVerified, presentationRequest);
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
onVerificationSuccess(isVerified, presentationRequest) {
|
|
112
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
-
if (isVerified) {
|
|
114
|
-
return presentationRequest;
|
|
115
|
-
}
|
|
116
|
-
throw new VCLError_1.default({
|
|
117
|
-
message: `Failed to verify: ${presentationRequest.jwt.payload}`,
|
|
118
|
-
});
|
|
115
|
+
this.presentationRequestByDeepLinkVerifier.verifyPresentationRequest(presentationRequest, presentationRequest.deepLink, didDocument);
|
|
116
|
+
return presentationRequest;
|
|
119
117
|
});
|
|
120
118
|
}
|
|
121
119
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationRequestUseCaseImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/usecases/PresentationRequestUseCaseImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oFAA4D;AAE5D,0GAAkF;AAQlF,0FAAkE;AAClE,
|
|
1
|
+
{"version":3,"file":"PresentationRequestUseCaseImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/usecases/PresentationRequestUseCaseImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oFAA4D;AAE5D,0GAAkF;AAQlF,0FAAkE;AAClE,6DAImC;AAEnC,MAAqB,8BAA8B;IAC/C,YACY,6BAA4D,EAC5D,4BAA0D,EAC1D,oBAA0C,EAC1C,qCAA4E;QAH5E,kCAA6B,GAA7B,6BAA6B,CAA+B;QAC5D,iCAA4B,GAA5B,4BAA4B,CAA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AAU,EAAE,mBAAmB,CAAC,GAAG;aACtC,CACJ,CAAC;QACN,CAAC;IACL,CAAC;IAEO,gBAAgB,CACpB,mBAA2C,EAC3C,WAA2B;QAE3B,IAAI,CAAC;YACD,MAAM,EAAE,GAAG,EAAE,GAAG,mBAAmB,CAAC,GAAG,CAAC;YACxC,MAAM,SAAS,GAAG,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YAChD,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;gBACpB,MAAM,IAAI,kBAAQ,CAAC;oBACf,OAAO,EAAE,iCAAiC,GAAG,EAAE;iBAClD,CAAC,CAAC;YACP,CAAC;YACD,OAAO,SAAS,CAAC;QACrB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,IAAA,wCAAwB,EAAC,kBAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;gBACtD,WAAW,EAAE,6BAAa,CAAC,uBAAuB;gBAClD,UAAU,EAAE,mBAAmB,CAAC,GAAG;aACtC,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAEK,yBAAyB,CAC3B,mBAA2C,EAC3C,WAA2B;;YAE3B,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CACnC,mBAAmB,EACnB,WAAW,CACd,CAAC;YACF,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS,CACrC,mBAAmB,CAAC,GAAG,EACvB,SAAS,EACT,mBAAmB,CAAC,yBAAyB,CAChD,CAAC;YACF,IAAI,CAAC,qCAAqC,CAAC,yBAAyB,CAChE,mBAAmB,EACnB,mBAAmB,CAAC,QAAQ,EAC5B,WAAW,CACd,CAAC;YACF,OAAO,mBAAmB,CAAC;QAC/B,CAAC;KAAA;CACJ;AAlJD,iDAkJC"}
|
|
@@ -3,6 +3,5 @@ import VCLDeepLink from '../../../api/entities/VCLDeepLink';
|
|
|
3
3
|
import CredentialManifestByDeepLinkVerifier from '../../domain/verifiers/CredentialManifestByDeepLinkVerifier';
|
|
4
4
|
import VCLDidDocument from '../../../api/entities/VCLDidDocument';
|
|
5
5
|
export default class CredentialManifestByDeepLinkVerifierImpl implements CredentialManifestByDeepLinkVerifier {
|
|
6
|
-
verifyCredentialManifest(credentialManifest: VCLCredentialManifest, deepLink: VCLDeepLink, didDocument: VCLDidDocument):
|
|
7
|
-
private onError;
|
|
6
|
+
verifyCredentialManifest(credentialManifest: VCLCredentialManifest, deepLink: VCLDeepLink, didDocument: VCLDidDocument): void;
|
|
8
7
|
}
|
|
@@ -1,45 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
14
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const VCLLog_1 = __importDefault(require("../../utils/VCLLog"));
|
|
16
6
|
const VCLError_1 = __importDefault(require("../../../api/entities/error/VCLError"));
|
|
17
7
|
const VCLErrorCode_1 = __importDefault(require("../../../api/entities/error/VCLErrorCode"));
|
|
18
8
|
class CredentialManifestByDeepLinkVerifierImpl {
|
|
19
9
|
verifyCredentialManifest(credentialManifest, deepLink, didDocument) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
if ((didDocument.id === credentialManifest.issuerId &&
|
|
26
|
-
didDocument.id === deepLink.did) ||
|
|
27
|
-
(didDocument.alsoKnownAs.includes(credentialManifest.issuerId) &&
|
|
28
|
-
didDocument.alsoKnownAs.includes(deepLink.did))) {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
yield this.onError(`credential manifest: ${credentialManifest.jwt.encodedJwt} \ndidDocument: ${didDocument}`, VCLErrorCode_1.default.MismatchedRequestIssuerDid);
|
|
32
|
-
return false;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
onError(errorMessage_1) {
|
|
36
|
-
return __awaiter(this, arguments, void 0, function* (errorMessage, errorCode = VCLErrorCode_1.default.SdkError) {
|
|
37
|
-
VCLLog_1.default.error(errorMessage);
|
|
10
|
+
if (!((didDocument.id === credentialManifest.issuerId &&
|
|
11
|
+
didDocument.id === deepLink.did) ||
|
|
12
|
+
(didDocument.alsoKnownAs.includes(credentialManifest.issuerId) &&
|
|
13
|
+
didDocument.alsoKnownAs.includes(deepLink.did)))) {
|
|
38
14
|
throw new VCLError_1.default({
|
|
39
|
-
errorCode:
|
|
40
|
-
message:
|
|
15
|
+
errorCode: VCLErrorCode_1.default.MismatchedRequestIssuerDid.toString(),
|
|
16
|
+
message: `credential manifest: ${credentialManifest.jwt.encodedJwt} \ndidDocument: ${didDocument}`,
|
|
41
17
|
});
|
|
42
|
-
}
|
|
18
|
+
}
|
|
43
19
|
}
|
|
44
20
|
}
|
|
45
21
|
exports.default = CredentialManifestByDeepLinkVerifierImpl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialManifestByDeepLinkVerifierImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/verifiers/CredentialManifestByDeepLinkVerifierImpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CredentialManifestByDeepLinkVerifierImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/verifiers/CredentialManifestByDeepLinkVerifierImpl.ts"],"names":[],"mappings":";;;;;AAUA,oFAA4D;AAC5D,4FAAoE;AAEpE,MAAqB,wCAAwC;IACzD,wBAAwB,CACpB,kBAAyC,EACzC,QAAqB,EACrB,WAA2B;QAE3B,IACI,CAAC,CACG,CAAC,WAAW,CAAC,EAAE,KAAK,kBAAkB,CAAC,QAAQ;YAC3C,WAAW,CAAC,EAAE,KAAK,QAAQ,CAAC,GAAG,CAAC;YACpC,CAAC,WAAW,CAAC,WAAW,CAAC,QAAQ,CAC7B,kBAAkB,CAAC,QAAQ,CAC9B;gBACG,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAI,CAAC,CAAC,CACvD,EACH,CAAC;YACC,MAAM,IAAI,kBAAQ,CAAC;gBACf,SAAS,EAAE,sBAAY,CAAC,0BAA0B,CAAC,QAAQ,EAAE;gBAC7D,OAAO,EAAE,wBAAwB,kBAAkB,CAAC,GAAG,CAAC,UAAU,mBAAmB,WAAW,EAAE;aACrG,CAAC,CAAC;QACP,CAAC;IACL,CAAC;CACJ;AAtBD,2DAsBC"}
|
|
@@ -3,7 +3,6 @@ import VCLDeepLink from '../../../api/entities/VCLDeepLink';
|
|
|
3
3
|
import PresentationRequestByDeepLinkVerifier from '../../domain/verifiers/PresentationRequestByDeepLinkVerifier';
|
|
4
4
|
import VCLDidDocument from '../../../api/entities/VCLDidDocument';
|
|
5
5
|
export default class PresentationRequestByDeepLinkVerifierImpl implements PresentationRequestByDeepLinkVerifier {
|
|
6
|
-
verifyPresentationRequest(presentationRequest: VCLPresentationRequest, deepLink: VCLDeepLink, didDocument: VCLDidDocument):
|
|
6
|
+
verifyPresentationRequest(presentationRequest: VCLPresentationRequest, deepLink: VCLDeepLink, didDocument: VCLDidDocument): void;
|
|
7
7
|
private isDidBoundToDidDocument;
|
|
8
|
-
private onError;
|
|
9
8
|
}
|
|
@@ -1,48 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
14
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const VCLLog_1 = __importDefault(require("../../utils/VCLLog"));
|
|
16
6
|
const VCLErrorCode_1 = __importDefault(require("../../../api/entities/error/VCLErrorCode"));
|
|
17
7
|
const VCLError_1 = __importDefault(require("../../../api/entities/error/VCLError"));
|
|
18
8
|
class PresentationRequestByDeepLinkVerifierImpl {
|
|
19
9
|
verifyPresentationRequest(presentationRequest, deepLink, didDocument) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (this.isDidBoundToDidDocument(presentationRequest.iss, didDocument) &&
|
|
27
|
-
this.isDidBoundToDidDocument(deepLinkDid, didDocument)) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
yield this.onError(`mismatched presentation request: ${presentationRequest.jwt.encodedJwt} \ndidDocument: ${didDocument}`, VCLErrorCode_1.default.MismatchedPresentationRequestInspectorDid);
|
|
31
|
-
return false;
|
|
32
|
-
});
|
|
10
|
+
if (!(this.isDidBoundToDidDocument(presentationRequest.iss, didDocument) && this.isDidBoundToDidDocument(deepLink.did, didDocument))) {
|
|
11
|
+
throw new VCLError_1.default({
|
|
12
|
+
errorCode: VCLErrorCode_1.default.MismatchedPresentationRequestInspectorDid.toString(),
|
|
13
|
+
message: `mismatched presentation request: ${presentationRequest.jwt.encodedJwt} \ndidDocument: ${didDocument}`,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
33
16
|
}
|
|
34
17
|
isDidBoundToDidDocument(did, didDocument) {
|
|
35
18
|
return didDocument.id === did || didDocument.alsoKnownAs.includes(did);
|
|
36
19
|
}
|
|
37
|
-
onError(errorMessage_1) {
|
|
38
|
-
return __awaiter(this, arguments, void 0, function* (errorMessage, errorCode = VCLErrorCode_1.default.SdkError) {
|
|
39
|
-
VCLLog_1.default.error(errorMessage);
|
|
40
|
-
throw new VCLError_1.default({
|
|
41
|
-
errorCode: errorCode.toString(),
|
|
42
|
-
message: errorMessage,
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
20
|
}
|
|
47
21
|
exports.default = PresentationRequestByDeepLinkVerifierImpl;
|
|
48
22
|
//# sourceMappingURL=PresentationRequestByDeepLinkVerifierImpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationRequestByDeepLinkVerifierImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/verifiers/PresentationRequestByDeepLinkVerifierImpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PresentationRequestByDeepLinkVerifierImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/verifiers/PresentationRequestByDeepLinkVerifierImpl.ts"],"names":[],"mappings":";;;;;AASA,4FAAoE;AACpE,oFAA4D;AAG5D,MAAqB,yCAAyC;IAC1D,yBAAyB,CACrB,mBAA2C,EAC3C,QAAqB,EACrB,WAA2B;QAE3B,IACI,CAAC,CACG,IAAI,CAAC,uBAAuB,CACxB,mBAAmB,CAAC,GAAG,EACvB,WAAW,CACd,IAAI,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,GAAI,EAAE,WAAW,CAAC,CAChE,EACH,CAAC;YACC,MAAM,IAAI,kBAAQ,CAAC;gBACf,SAAS,EACL,sBAAY,CAAC,yCAAyC,CAAC,QAAQ,EAAE;gBACrE,OAAO,EAAE,oCAAoC,mBAAmB,CAAC,GAAG,CAAC,UAAU,mBAAmB,WAAW,EAAE;aAClH,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAEO,uBAAuB,CAAC,GAAW,EAAE,WAA2B;QACpE,OAAO,WAAW,CAAC,EAAE,KAAK,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC3E,CAAC;CACJ;AAzBD,4DAyBC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import VCLCredentialManifestDescriptor from '../../../api/entities/VCLCredentialManifestDescriptor';
|
|
2
|
+
import { Nullish } from '../../../api/VCLTypes';
|
|
2
3
|
export default interface CredentialManifestRepository {
|
|
3
|
-
getCredentialManifest(credentialManifestDescriptor: VCLCredentialManifestDescriptor): Promise<string
|
|
4
|
+
getCredentialManifest(credentialManifestDescriptor: VCLCredentialManifestDescriptor): Promise<Nullish<string>>;
|
|
4
5
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import VCLPresentationRequestDescriptor from '../../../api/entities/VCLPresentationRequestDescriptor';
|
|
2
|
+
import { Nullish } from '../../../api/VCLTypes';
|
|
2
3
|
export default interface PresentationRequestRepository {
|
|
3
|
-
getPresentationRequest(presentationRequestDescriptor: VCLPresentationRequestDescriptor): Promise<string
|
|
4
|
+
getPresentationRequest(presentationRequestDescriptor: VCLPresentationRequestDescriptor): Promise<Nullish<string>>;
|
|
4
5
|
}
|
|
@@ -2,5 +2,5 @@ import VCLCredentialManifest from '../../../api/entities/VCLCredentialManifest';
|
|
|
2
2
|
import VCLDeepLink from '../../../api/entities/VCLDeepLink';
|
|
3
3
|
import VCLDidDocument from '../../../api/entities/VCLDidDocument';
|
|
4
4
|
export default interface CredentialManifestByDeepLinkVerifier {
|
|
5
|
-
verifyCredentialManifest(credentialManifest: VCLCredentialManifest, deepLink: VCLDeepLink, didDocument: VCLDidDocument):
|
|
5
|
+
verifyCredentialManifest(credentialManifest: VCLCredentialManifest, deepLink: VCLDeepLink, didDocument: VCLDidDocument): void;
|
|
6
6
|
}
|
|
@@ -2,5 +2,5 @@ import VCLDeepLink from '../../../api/entities/VCLDeepLink';
|
|
|
2
2
|
import VCLPresentationRequest from '../../../api/entities/VCLPresentationRequest';
|
|
3
3
|
import VCLDidDocument from '../../../api/entities/VCLDidDocument';
|
|
4
4
|
export default interface PresentationRequestByDeepLinkVerifier {
|
|
5
|
-
verifyPresentationRequest(presentationRequest: VCLPresentationRequest, deepLink: VCLDeepLink, didDocument: VCLDidDocument):
|
|
5
|
+
verifyPresentationRequest(presentationRequest: VCLPresentationRequest, deepLink: VCLDeepLink, didDocument: VCLDidDocument): void;
|
|
6
6
|
}
|
|
@@ -10,6 +10,7 @@ export declare const ErrorTaxonomy: {
|
|
|
10
10
|
readonly RequestKindIssuing: "issuing_request";
|
|
11
11
|
readonly RequestKindPresentation: "presentation_request";
|
|
12
12
|
};
|
|
13
|
+
export declare const SourceMalformedVerifiedProfile = "malformed_verified_profile";
|
|
13
14
|
export type RequestKind = typeof ErrorTaxonomy.RequestKindIssuing | typeof ErrorTaxonomy.RequestKindPresentation;
|
|
14
15
|
type TaxonomyContext = {
|
|
15
16
|
requestDid?: string | null;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.copyError = exports.toTaxonomyError = exports.isTaxonomyError = exports.isConnectivityFailure = exports.toRequestValidationError = exports.toRequestAuthorizationError = exports.toRegistrationCheckError = exports.toDidResolutionError = exports.toClientRequestFetchError = exports.invalidLink = exports.ErrorTaxonomy = void 0;
|
|
6
|
+
exports.copyError = exports.toTaxonomyError = exports.isTaxonomyError = exports.isConnectivityFailure = exports.toRequestValidationError = exports.toRequestAuthorizationError = exports.toRegistrationCheckError = exports.toDidResolutionError = exports.toClientRequestFetchError = exports.invalidLink = exports.SourceMalformedVerifiedProfile = exports.ErrorTaxonomy = void 0;
|
|
7
7
|
const VCLError_1 = __importDefault(require("../../api/entities/error/VCLError"));
|
|
8
8
|
const VCLErrorCode_1 = __importDefault(require("../../api/entities/error/VCLErrorCode"));
|
|
9
9
|
const VCLStatusCode_1 = __importDefault(require("../../api/entities/error/VCLStatusCode"));
|
|
@@ -17,6 +17,7 @@ exports.ErrorTaxonomy = {
|
|
|
17
17
|
RequestKindIssuing: 'issuing_request',
|
|
18
18
|
RequestKindPresentation: 'presentation_request',
|
|
19
19
|
};
|
|
20
|
+
exports.SourceMalformedVerifiedProfile = 'malformed_verified_profile';
|
|
20
21
|
const taxonomyCodes = new Set([
|
|
21
22
|
VCLErrorCode_1.default.InvalidLink,
|
|
22
23
|
VCLErrorCode_1.default.ConnectivityFailure,
|
|
@@ -26,6 +27,7 @@ const taxonomyCodes = new Set([
|
|
|
26
27
|
VCLErrorCode_1.default.VerifierDidUnresolvable,
|
|
27
28
|
VCLErrorCode_1.default.IssuerNotRegistered,
|
|
28
29
|
VCLErrorCode_1.default.VerifierNotRegistered,
|
|
30
|
+
VCLErrorCode_1.default.RegistrationCheckInconclusive,
|
|
29
31
|
VCLErrorCode_1.default.IssuerRequestInvalid,
|
|
30
32
|
VCLErrorCode_1.default.VerifierRequestInvalid,
|
|
31
33
|
VCLErrorCode_1.default.IssuerRequestUnauthorized,
|
|
@@ -47,15 +49,22 @@ const toDidResolutionError = (error, context) => (0, exports.toTaxonomyError)(er
|
|
|
47
49
|
? VCLErrorCode_1.default.ConnectivityFailure
|
|
48
50
|
: didUnresolvableCode(context.requestKind), Object.assign({ validationPhase: exports.ErrorTaxonomy.PhaseDidResolution }, context));
|
|
49
51
|
exports.toDidResolutionError = toDidResolutionError;
|
|
50
|
-
const toRegistrationCheckError = (error, context) => (0, exports.toTaxonomyError)(error, (
|
|
51
|
-
? VCLErrorCode_1.default.ConnectivityFailure
|
|
52
|
-
: notRegisteredCode(context.requestKind), Object.assign({ validationPhase: exports.ErrorTaxonomy.PhaseRegistrationCheck }, context));
|
|
52
|
+
const toRegistrationCheckError = (error, context) => (0, exports.toTaxonomyError)(error, registrationCheckCode(error, context.requestKind), Object.assign({ validationPhase: exports.ErrorTaxonomy.PhaseRegistrationCheck }, context));
|
|
53
53
|
exports.toRegistrationCheckError = toRegistrationCheckError;
|
|
54
|
-
const toRequestAuthorizationError = (error, context) => (0, exports.toTaxonomyError)(error,
|
|
54
|
+
const toRequestAuthorizationError = (error, context) => (0, exports.toTaxonomyError)(error, context.requestKind === exports.ErrorTaxonomy.RequestKindPresentation
|
|
55
|
+
? VCLErrorCode_1.default.VerifierRequestUnauthorized
|
|
56
|
+
: VCLErrorCode_1.default.IssuerRequestUnauthorized, Object.assign({ validationPhase: exports.ErrorTaxonomy.PhaseRequestAuthorization }, context));
|
|
55
57
|
exports.toRequestAuthorizationError = toRequestAuthorizationError;
|
|
56
|
-
const toRequestValidationError = (error, context) =>
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
const toRequestValidationError = (error, context) => {
|
|
59
|
+
let errorCode = VCLErrorCode_1.default.IssuerRequestInvalid;
|
|
60
|
+
if ((0, exports.isConnectivityFailure)(error)) {
|
|
61
|
+
errorCode = VCLErrorCode_1.default.ConnectivityFailure;
|
|
62
|
+
}
|
|
63
|
+
else if (context.requestKind === exports.ErrorTaxonomy.RequestKindPresentation) {
|
|
64
|
+
errorCode = VCLErrorCode_1.default.VerifierRequestInvalid;
|
|
65
|
+
}
|
|
66
|
+
return (0, exports.toTaxonomyError)(error, errorCode, Object.assign({ validationPhase: exports.ErrorTaxonomy.PhaseRequestValidation }, context));
|
|
67
|
+
};
|
|
59
68
|
exports.toRequestValidationError = toRequestValidationError;
|
|
60
69
|
const isConnectivityFailure = (error) => error.errorCode === VCLErrorCode_1.default.ConnectivityFailure ||
|
|
61
70
|
error.statusCode === VCLStatusCode_1.default.NetworkError;
|
|
@@ -123,17 +132,25 @@ const clientRequestFetchCode = (error) => {
|
|
|
123
132
|
return VCLErrorCode_1.default.ClientRequestRejected;
|
|
124
133
|
};
|
|
125
134
|
const valueOr = (source, key, fallback) => Object.prototype.hasOwnProperty.call(source, key) ? source[key] : fallback;
|
|
126
|
-
const didUnresolvableCode = (requestKind) =>
|
|
135
|
+
const didUnresolvableCode = (requestKind) => requestKind === exports.ErrorTaxonomy.RequestKindPresentation
|
|
127
136
|
? VCLErrorCode_1.default.VerifierDidUnresolvable
|
|
128
137
|
: VCLErrorCode_1.default.IssuerDidUnresolvable;
|
|
129
|
-
const notRegisteredCode = (requestKind) =>
|
|
138
|
+
const notRegisteredCode = (requestKind) => requestKind === exports.ErrorTaxonomy.RequestKindPresentation
|
|
130
139
|
? VCLErrorCode_1.default.VerifierNotRegistered
|
|
131
140
|
: VCLErrorCode_1.default.IssuerNotRegistered;
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
const registrationCheckCode = (error, requestKind) => {
|
|
142
|
+
if (error.sourceErrorCode === exports.SourceMalformedVerifiedProfile) {
|
|
143
|
+
return VCLErrorCode_1.default.RegistrationCheckInconclusive;
|
|
144
|
+
}
|
|
145
|
+
if ((0, exports.isConnectivityFailure)(error)) {
|
|
146
|
+
return VCLErrorCode_1.default.ConnectivityFailure;
|
|
147
|
+
}
|
|
148
|
+
if (error.statusCode === 404) {
|
|
149
|
+
return notRegisteredCode(requestKind);
|
|
150
|
+
}
|
|
151
|
+
if (error.statusCode != null && error.statusCode >= 400) {
|
|
152
|
+
return VCLErrorCode_1.default.RegistrationCheckInconclusive;
|
|
153
|
+
}
|
|
154
|
+
return notRegisteredCode(requestKind);
|
|
155
|
+
};
|
|
139
156
|
//# sourceMappingURL=ErrorTaxonomy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorTaxonomy.js","sourceRoot":"","sources":["../../../src/impl/utils/ErrorTaxonomy.ts"],"names":[],"mappings":";;;;;;AAAA,iFAAyD;AACzD,yFAAiE;AACjE,2FAAmE;AAEtD,QAAA,aAAa,GAAG;IACzB,mBAAmB,EAAE,iBAAiB;IACtC,uBAAuB,EAAE,sBAAsB;IAC/C,kBAAkB,EAAE,gBAAgB;IACpC,sBAAsB,EAAE,oBAAoB;IAC5C,sBAAsB,EAAE,oBAAoB;IAC5C,yBAAyB,EAAE,uBAAuB;IAElD,kBAAkB,EAAE,iBAAiB;IACrC,uBAAuB,EAAE,sBAAsB;CACzC,CAAC;
|
|
1
|
+
{"version":3,"file":"ErrorTaxonomy.js","sourceRoot":"","sources":["../../../src/impl/utils/ErrorTaxonomy.ts"],"names":[],"mappings":";;;;;;AAAA,iFAAyD;AACzD,yFAAiE;AACjE,2FAAmE;AAEtD,QAAA,aAAa,GAAG;IACzB,mBAAmB,EAAE,iBAAiB;IACtC,uBAAuB,EAAE,sBAAsB;IAC/C,kBAAkB,EAAE,gBAAgB;IACpC,sBAAsB,EAAE,oBAAoB;IAC5C,sBAAsB,EAAE,oBAAoB;IAC5C,yBAAyB,EAAE,uBAAuB;IAElD,kBAAkB,EAAE,iBAAiB;IACrC,uBAAuB,EAAE,sBAAsB;CACzC,CAAC;AAEE,QAAA,8BAA8B,GAAG,4BAA4B,CAAC;AAwB3E,MAAM,aAAa,GAAG,IAAI,GAAG,CAAS;IAClC,sBAAY,CAAC,WAAW;IACxB,sBAAY,CAAC,mBAAmB;IAChC,sBAAY,CAAC,yBAAyB;IACtC,sBAAY,CAAC,qBAAqB;IAClC,sBAAY,CAAC,qBAAqB;IAClC,sBAAY,CAAC,uBAAuB;IACpC,sBAAY,CAAC,mBAAmB;IAChC,sBAAY,CAAC,qBAAqB;IAClC,sBAAY,CAAC,6BAA6B;IAC1C,sBAAY,CAAC,oBAAoB;IACjC,sBAAY,C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AC,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,sBAAY,CAAC,mBAAmB,CAAC;IAC5C,CAAC;IACD,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;QAC3B,OAAO,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IACD,IAAI,KAAK,CAAC,UAAU,IAAI,IAAI,IAAI,KAAK,CAAC,UAAU,IAAI,GAAG,EAAE,CAAC;QACtD,OAAO,sBAAY,CAAC,6BAA6B,CAAC;IACtD,CAAC;IACD,OAAO,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAC1C,CAAC,CAAC"}
|
|
@@ -61,7 +61,8 @@ class ErrorTaxonomyCompatibilityMapper {
|
|
|
61
61
|
if (!sourceErrorCode ||
|
|
62
62
|
sourceErrorCode === error.errorCode ||
|
|
63
63
|
sourceErrorCode ===
|
|
64
|
-
ProfileServiceTypeVerifier_1.ProfileServiceTypeVerifier.SourceWrongServiceType
|
|
64
|
+
ProfileServiceTypeVerifier_1.ProfileServiceTypeVerifier.SourceWrongServiceType ||
|
|
65
|
+
sourceErrorCode === ErrorTaxonomy_1.SourceMalformedVerifiedProfile) {
|
|
65
66
|
return this.legacyCopy(error, VCLErrorCode_1.default.SdkError);
|
|
66
67
|
}
|
|
67
68
|
return this.legacyCopy(error, sourceErrorCode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorTaxonomyCompatibilityMapper.js","sourceRoot":"","sources":["../../../src/impl/utils/ErrorTaxonomyCompatibilityMapper.ts"],"names":[],"mappings":";;;;;AACA,yFAAiE;AACjE,
|
|
1
|
+
{"version":3,"file":"ErrorTaxonomyCompatibilityMapper.js","sourceRoot":"","sources":["../../../src/impl/utils/ErrorTaxonomyCompatibilityMapper.ts"],"names":[],"mappings":";;;;;AACA,yFAAiE;AACjE,mDAMyB;AACzB,6EAA0E;AAC1E,4FAAoE;AAEpE,MAAqB,gCAAgC;IACjD,GAAG,CAAC,EACA,K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CAAC,SAAS,KAAK,sBAAY,CAAC,qBAAqB;IACtD,KAAK,CAAC,eAAe,KAAK,sBAAY,CAAC,QAAQ;IAC/C,KAAK,CAAC,OAAO,IAAI,IAAI;IACrB,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAEjC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAW,EAAE;IAC5C,IAAI,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,WAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verii/vnf-nodejs-wallet-sdk",
|
|
3
|
-
"version": "1.2.0-pre.
|
|
3
|
+
"version": "1.2.0-pre.1780194446",
|
|
4
4
|
"description": "VNF Wallet SDK Nodejs",
|
|
5
5
|
"repository": "https://github.com/LFDT-Verii/core",
|
|
6
6
|
"author": "Andres Olave",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"node": ">= 22.22.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@verii/http-client": "1.2.0-pre.
|
|
27
|
-
"@verii/vc-checks": "1.2.0-pre.
|
|
26
|
+
"@verii/http-client": "1.2.0-pre.1780194446",
|
|
27
|
+
"@verii/vc-checks": "1.2.0-pre.1780194446",
|
|
28
28
|
"canonicalize": "^2.1.0",
|
|
29
29
|
"jose": "^5.10.0",
|
|
30
30
|
"pino": "^10.3.1",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "24.12.3",
|
|
35
|
-
"@verii/test-regexes": "1.2.0-pre.
|
|
35
|
+
"@verii/test-regexes": "1.2.0-pre.1780194446",
|
|
36
36
|
"eslint": "9.39.4",
|
|
37
37
|
"eslint-config-prettier": "10.1.8",
|
|
38
38
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"lib"
|
|
55
55
|
]
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "0070c227d10f59d2cfa64076f8ce9be917c2fb1d"
|
|
58
58
|
}
|