@verii/vnf-nodejs-wallet-sdk 1.2.0-pre.1779864931 → 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.
Files changed (38) hide show
  1. package/dist/api/entities/VCLJwt.js +2 -13
  2. package/dist/api/entities/VCLJwt.js.map +1 -1
  3. package/dist/api/entities/error/VCLErrorCode.d.ts +1 -0
  4. package/dist/api/entities/error/VCLErrorCode.js +1 -0
  5. package/dist/api/entities/error/VCLErrorCode.js.map +1 -1
  6. package/dist/impl/data/repositories/CredentialManifestRepositoryImpl.d.ts +2 -1
  7. package/dist/impl/data/repositories/CredentialManifestRepositoryImpl.js +3 -14
  8. package/dist/impl/data/repositories/CredentialManifestRepositoryImpl.js.map +1 -1
  9. package/dist/impl/data/repositories/PresentationRequestRepositoryImpl.d.ts +2 -1
  10. package/dist/impl/data/repositories/PresentationRequestRepositoryImpl.js +3 -14
  11. package/dist/impl/data/repositories/PresentationRequestRepositoryImpl.js.map +1 -1
  12. package/dist/impl/data/repositories/VerifiedProfileRepositoryImpl.js +11 -0
  13. package/dist/impl/data/repositories/VerifiedProfileRepositoryImpl.js.map +1 -1
  14. package/dist/impl/data/usecases/CredentialManifestUseCaseImpl.d.ts +1 -4
  15. package/dist/impl/data/usecases/CredentialManifestUseCaseImpl.js +24 -20
  16. package/dist/impl/data/usecases/CredentialManifestUseCaseImpl.js.map +1 -1
  17. package/dist/impl/data/usecases/PresentationRequestUseCaseImpl.d.ts +0 -1
  18. package/dist/impl/data/usecases/PresentationRequestUseCaseImpl.js +12 -14
  19. package/dist/impl/data/usecases/PresentationRequestUseCaseImpl.js.map +1 -1
  20. package/dist/impl/data/verifiers/CredentialManifestByDeepLinkVerifierImpl.d.ts +1 -2
  21. package/dist/impl/data/verifiers/CredentialManifestByDeepLinkVerifierImpl.js +7 -31
  22. package/dist/impl/data/verifiers/CredentialManifestByDeepLinkVerifierImpl.js.map +1 -1
  23. package/dist/impl/data/verifiers/PresentationRequestByDeepLinkVerifierImpl.d.ts +1 -2
  24. package/dist/impl/data/verifiers/PresentationRequestByDeepLinkVerifierImpl.js +6 -32
  25. package/dist/impl/data/verifiers/PresentationRequestByDeepLinkVerifierImpl.js.map +1 -1
  26. package/dist/impl/domain/repositories/CredentialManifestRepository.d.ts +2 -1
  27. package/dist/impl/domain/repositories/PresentationRequestRepository.d.ts +2 -1
  28. package/dist/impl/domain/verifiers/CredentialManifestByDeepLinkVerifier.d.ts +1 -1
  29. package/dist/impl/domain/verifiers/PresentationRequestByDeepLinkVerifier.d.ts +1 -1
  30. package/dist/impl/utils/ErrorTaxonomy.d.ts +1 -0
  31. package/dist/impl/utils/ErrorTaxonomy.js +34 -17
  32. package/dist/impl/utils/ErrorTaxonomy.js.map +1 -1
  33. package/dist/impl/utils/ErrorTaxonomyCompatibilityMapper.d.ts +1 -1
  34. package/dist/impl/utils/ErrorTaxonomyCompatibilityMapper.js +18 -30
  35. package/dist/impl/utils/ErrorTaxonomyCompatibilityMapper.js.map +1 -1
  36. package/dist/impl/utils/VelocityDeepLinkValidator.js +5 -3
  37. package/dist/impl/utils/VelocityDeepLinkValidator.js.map +1 -1
  38. 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
- let item = new VCLJwt(new SignedJWT('', '', ''));
20
- try {
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":";;;;;;AAEA,qEAA6C;AAE7C,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,IAAI,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QACjD,IAAI,CAAC;YACD,MAAM,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,IAAI,GAAG,IAAI,MAAM,CACb,IAAI,SAAS,CACT,MAAA,aAAa,CAAC,CAAC,CAAC,mCAAI,EAAE,EACtB,MAAA,aAAa,CAAC,CAAC,CAAC,mCAA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QACF,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;CACJ;AAtBD,8BAsBC;AAED,MAAM,UAAU;;AACI,iBAAM,GAAG,KAAK,CAAC;AAEf,iBAAM,GAAG,KAAK,CAAC;AAEf,iBAAM,GAAG,KAAK,CAAC;AAEf,iBAAM,GAAG,KAAK,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,YAmCJ;AAnCD,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,+DAA+C,CAAA;IAC/C,mEAAmD,CAAA;IACnD,yEAAyD,CAAA;IACzD,6EAA6D,CAAA;IAG7D,sCAAsB,CAAA;AAC1B,CAAC,EAnCI,YAAY,KAAZ,YAAY,QAmChB;AACD,kBAAe,YAAY,CAAC"}
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
  }
@@ -23,16 +23,12 @@ class CredentialManifestRepositoryImpl {
23
23
  }
24
24
  getCredentialManifest(credentialManifestDescriptor) {
25
25
  return __awaiter(this, void 0, void 0, function* () {
26
+ var _a;
26
27
  const { endpoint } = credentialManifestDescriptor;
27
- if (!endpoint) {
28
- throw new VCLError_1.default({
29
- message: 'credentialManifestDescriptor.endpoint = null',
30
- });
31
- }
32
28
  let credentialManifestResponse;
33
29
  try {
34
30
  credentialManifestResponse = yield this.networkService.sendRequest({
35
- endpoint,
31
+ endpoint: endpoint,
36
32
  method: HttpMethod_1.HttpMethod.GET,
37
33
  body: null,
38
34
  headers: {
@@ -46,14 +42,7 @@ class CredentialManifestRepositoryImpl {
46
42
  requestKind: ErrorTaxonomy_1.ErrorTaxonomy.RequestKindIssuing,
47
43
  });
48
44
  }
49
- const issuingRequest = credentialManifestResponse.payload[VCLCredentialManifest_1.default.KeyIssuingRequest];
50
- if (!issuingRequest) {
51
- throw (0, ErrorTaxonomy_1.toClientRequestFetchError)(new VCLError_1.default({ message: 'Missing issuing_request' }), {
52
- requestUri: endpoint,
53
- requestKind: ErrorTaxonomy_1.ErrorTaxonomy.RequestKindIssuing,
54
- });
55
- }
56
- return issuingRequest;
45
+ return (_a = credentialManifestResponse.payload) === null || _a === void 0 ? void 0 : _a[VCLCredentialManifest_1.default.KeyIssuingRequest];
57
46
  });
58
47
  }
59
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CredentialManifestRepositoryImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/repositories/CredentialManifestRepositoryImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wGAAgF;AAEhF,oFAA4D;AAG5D,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,CAAC,QAAQ,EAAE,CAAC;gBACZ,MAAM,IAAI,kBAAQ,CAAC;oBACf,OAAO,EAAE,8CAA8C;iBAC1D,CAAC,CAAC;YACP,CAAC;YAED,IAAI,0BAA0B,CAAC;YAC/B,IAAI,CAAC;gBACD,0BAA0B,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;oBAC/D,QAAQ;oBACR,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,MAAM,cAAc,GAChB,0BAA0B,CAAC,OAAO,CAC9B,+BAAqB,CAAC,iBAAiB,CAC1C,CAAC;YACN,IAAI,CAAC,cAAc,EAAE,CAAC;gBAClB,MAAM,IAAA,yCAAyB,EAC3B,IAAI,kBAAQ,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC,EACpD;oBACI,UAAU,EAAE,QAAQ;oBACpB,WAAW,EAAE,6BAAa,CAAC,kBAAkB;iBAChD,CACJ,CAAC;YACN,CAAC;YACD,OAAO,cAAc,CAAC;QAC1B,CAAC;KAAA;CACJ;AA7CD,mDA6CC"}
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
  }
@@ -23,16 +23,12 @@ class PresentationRequestRepositoryImpl {
23
23
  }
24
24
  getPresentationRequest(presentationRequestDescriptor) {
25
25
  return __awaiter(this, void 0, void 0, function* () {
26
+ var _a;
26
27
  const { endpoint } = presentationRequestDescriptor;
27
- if (!endpoint) {
28
- throw new VCLError_1.default({
29
- message: 'presentationRequestDescriptor.endpoint = null',
30
- });
31
- }
32
28
  let presentationRequestResponse;
33
29
  try {
34
30
  presentationRequestResponse = yield this.networkService.sendRequest({
35
- endpoint,
31
+ endpoint: endpoint,
36
32
  method: HttpMethod_1.HttpMethod.GET,
37
33
  headers: {
38
34
  [Urls_1.HeaderKeys.XVnfProtocolVersion]: Urls_1.HeaderValues.XVnfProtocolVersion,
@@ -45,14 +41,7 @@ class PresentationRequestRepositoryImpl {
45
41
  requestKind: ErrorTaxonomy_1.ErrorTaxonomy.RequestKindPresentation,
46
42
  });
47
43
  }
48
- const presentationRequest = presentationRequestResponse.payload[VCLPresentationRequest_1.default.KeyPresentationRequest];
49
- if (!presentationRequest) {
50
- throw (0, ErrorTaxonomy_1.toClientRequestFetchError)(new VCLError_1.default({ message: 'Missing presentation_request' }), {
51
- requestUri: endpoint,
52
- requestKind: ErrorTaxonomy_1.ErrorTaxonomy.RequestKindPresentation,
53
- });
54
- }
55
- return presentationRequest;
44
+ return (_a = presentationRequestResponse.payload) === null || _a === void 0 ? void 0 : _a[VCLPresentationRequest_1.default.KeyPresentationRequest];
56
45
  });
57
46
  }
58
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PresentationRequestRepositoryImpl.js","sourceRoot":"","sources":["../../../../src/impl/data/repositories/PresentationRequestRepositoryImpl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oFAA4D;AAC5D,0GAAkF;AAIlF,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,CAAC,QAAQ,EAAE,CAAC;gBACZ,MAAM,IAAI,kBAAQ,CAAC;oBACf,OAAO,EAAE,+CAA+C;iBAC3D,CAAC,CAAC;YACP,CAAC;YAED,IAAI,2BAA2B,CAAC;YAChC,IAAI,CAAC;gBACD,2BAA2B,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAC/D;oBACI,QAAQ;oBACR,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,MAAM,mBAAmB,GACrB,2BAA2B,CAAC,OAAO,CAC/B,gCAAsB,CAAC,sBAAsB,CAChD,CAAC;YACN,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBACvB,MAAM,IAAA,yCAAyB,EAC3B,IAAI,kBAAQ,CAAC,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC,EACzD;oBACI,UAAU,EAAE,QAAQ;oBACpB,WAAW,EAAE,6BAAa,CAAC,uBAAuB;iBACrD,CACJ,CAAC;YACN,CAAC;YACD,OAAO,mBAAmB,CAAC;QAC/B,CAAC;KAAA;CACJ;AA9CD,oDA8CC"}
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;AAI1E,+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,OAAO,IAAI,4BAAkB,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACnE,CAAC;KAAA;CACJ;AApBD,gDAoBC"}
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, deepLink?: Nullish<VCLDeepLink>): Promise<VCLCredentialManifest>;
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
- if (!jwtStr) {
32
- throw new VCLError_1.default({ message: 'Empty jwtStr' });
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 new VCLCredentialManifest_1.default(VCLJwt_1.default.fromEncodedJwt(jwtStr), credentialManifestDescriptor.vendorOriginContext, verifiedProfile, credentialManifestDescriptor.deepLink, credentialManifestDescriptor.didJwk, credentialManifestDescriptor.remoteCryptoServicesToken);
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, credentialManifest.deepLink);
123
+ return this.verifyCredentialManifestByDeepLink(credentialManifest, didDocument);
110
124
  });
111
125
  }
112
- verifyCredentialManifestByDeepLink(credentialManifest, didDocument, deepLink) {
126
+ verifyCredentialManifestByDeepLink(credentialManifest, didDocument) {
113
127
  return __awaiter(this, void 0, void 0, function* () {
114
- if (credentialManifest.deepLink === null) {
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
- const isVerified = yield this.credentialManifestByDeepLinkVerifier.verifyCredentialManifest(credentialManifest, deepLink, didDocument);
119
- return this.onVerificationSuccess(isVerified, credentialManifest);
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;AAE5D,0EAAkD;AAMlD,gEAAwC;AACxC,0FAAkE;AAIlE,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,CAAC,MAAM,EAAE,CAAC;gBACV,MAAM,IAAI,kBAAQ,CAAC,EAAE,O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AAC,GAAG,EAAE;aACjF,CAAC,CAAC;QACP,CAAC;KAAA;CACJ;AArLD,gDAqLC"}
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,4BAA4B,CAAE,GAAG,mCAAI,IAAI;iBACxD,CAAC,CAAC;YACP,C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,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
- const isVerified = yield this.presentationRequestByDeepLinkVerifier.verifyPresentationRequest(presentationRequest, presentationRequest.deepLink, didDocument);
107
- VCLLog_1.default.info(`Presentation request by deep link verification result: ${isVerified}`);
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,gEAAwC;AACxC,6DAImC;AAEnC,MAAqB,8BAA8B;IAC/C,YACY,6BAA4D,EAC5D,4BAA0D,EAC1D,oBAA0C,EAC1C,qCAA4E;QAH5E,kCAA6B,GAA7B,6BAA6B,CAA+B;QAC5D,iCAA4B,GAA5B,4BAA4B,CAA8B;QAC1D,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,0CAAqC,GAArC,qCAAqC,CAAuC;IACrF,CAAC;IAEE,sBAAsB,CACxB,6BAA+D,EAC/D,eAAmC;;;YAEnC,MAAM,aAAa,GACf,MAAM,IAAI,CAAC,6BAA6B,CAAC,sBAAsB,CAC3D,6BAA6B,CAChC,CAAC;YACN,IAAI,UAAU,GAAG,MAAA,6BAA6B,CAAC,GAAG,mCAAI,IAAI,CAAC;YAC3D,IAAI,mBAA2C,CAAC;YAChD,IAAI,CAAC;gBACD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;gBAClE,mBAAmB,GAAG,IAAI,gCAAsB,CAC5C,GAAG,EACH,eAAe,EACf,6BAA6B,CA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WAAW,CACd,CAAC;YACF,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS,CACrC,mBAAmB,CAAC,GAAG,EACvB,SAAS,EACT,mBAAmB,CAAC,yBAAyB,CAChD,CAAC;YACF,MAAM,UAAU,GACZ,MAAM,IAAI,CAAC,qCAAqC,CAAC,yBAAyB,CACtE,mBAAmB,EACnB,mBAAmB,CAAC,QAAQ,EAC5B,WAAW,CACd,CAAC;YACN,gBAAM,CAAC,IAAI,CACP,0DAA0D,UAAU,EAAE,CACzE,CAAC;YACF,OAAO,IAAI,CAAC,qBAAqB,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;QACvE,CAAC;KAAA;IAEK,qBAAqB,CACvB,UAAmB,EACnB,mBAA2C;;YAE3C,IAAI,UAAU,EAAE,CAAC;gBACb,OAAO,mBAAmB,CAAC;YAC/B,CAAC;YACD,MAAM,IAAI,kBAAQ,CAAC;gBACf,OAAO,EAAE,qBAAqB,mBAAmB,CAAC,GAAG,CAAC,OAAO,EAAE;aAClE,CAAC,CAAC;QACP,CAAC;KAAA;CACJ;AAxJD,iDAwJC"}
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,CAA8B;QAC1D,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,0CAAqC,GAArC,qCAAqC,CAAuC;IACrF,CAAC;IAEE,sBAAsB,CACxB,6BAA+D,EAC/D,eAAmC;;;YAEnC,MAAM,aAAa,GACf,MAAM,IAAI,CAAC,6BAA6B,CAAC,sBAA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xC,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): Promise<boolean>;
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
- return __awaiter(this, void 0, void 0, function* () {
21
- if (deepLink.did === null) {
22
- yield this.onError(`DID not found in deep link: ${deepLink.value}`);
23
- return false;
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: errorCode.toString(),
40
- message: errorMessage,
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":";;;;;;;;;;;;;;AASA,gEAAwC;AACxC,oFAA4D;AAC5D,4FAAoE;AAGpE,MAAqB,wCAAwC;IACnD,wBAAwB,CAC1B,kBAAyC,EACzC,QAAqB,EACrB,WAA2B;;YAE3B,IAAI,QAAQ,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC;gBACxB,MAAM,IAAI,CAAC,OAAO,CAAC,+BAA+B,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;gBACpE,OAAO,KAAK,CAAC;YACjB,CAAC;YACD,IACI,CAAC,WAAW,CAAC,EAAE,KAAK,kBAAkB,CAAC,QAAQ;gBAC3C,WAAW,CAAC,EAAE,KAAK,QAAQ,CAAC,GAAG,CAAC;gBACpC,CAAC,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,CAAC;oBAC1D,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAI,CAAC,CAAC,EACtD,CAAC;gBACC,OAAO,IAAI,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,CAAC,OAAO,CACd,wBAAwB,kBAAkB,CAAC,GAAG,CAAC,UAAU,mBAAmB,WAAW,EAAE,EACzF,sBAAY,CAAC,0BAA0B,CAC1C,CAAC;YACF,OAAO,KAAK,CAAC;QACjB,CAAC;KAAA;IAEa,OAAO;6DACjB,YAAoB,EACpB,YAA0B,sBAAY,CAAC,QAAQ;YAE/C,gBAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAC3B,MAAM,IAAI,kBAAQ,CAAC;gBACf,SAAS,EAAE,SAAS,CAAC,QAAQ,EAAE;gBAC/B,OAAO,EAAE,YAAY;aACxB,CAAC,CAAC;QACP,CAAC;KAAA;CACJ;AAnCD,2DAmCC"}
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): Promise<boolean>;
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
- return __awaiter(this, void 0, void 0, function* () {
21
- const deepLinkDid = deepLink.did;
22
- if (deepLinkDid == null) {
23
- yield this.onError(`DID not found in deep link: ${deepLink.value}`);
24
- return false;
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":";;;;;;;;;;;;;;AASA,gEAAwC;AACxC,4FAAoE;AACpE,oFAA4D;AAG5D,MAAqB,yCAAyC;IACpD,yBAAyB,CAC3B,mBAA2C,EAC3C,QAAqB,EACrB,WAA2B;;YAE3B,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC;YAEjC,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;gBACtB,MAAM,IAAI,CAAC,OAAO,CAAC,+BAA+B,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;gBACpE,OAAO,KAAK,CAAC;YACjB,CAAC;YACD,IACI,IAAI,CAAC,uBAAuB,CACxB,mBAAmB,CAAC,GAAG,EACvB,WAAW,CACd;gBACD,IAAI,CAAC,uBAAuB,CAAC,WAAW,EAAE,WAAW,CAAC,EACxD,CAAC;gBACC,OAAO,IAAI,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,CAAC,OAAO,CACd,oCAAoC,mBAAmB,CAAC,GAAG,CAAC,UAAU,mBAAmB,WAAW,EAAE,EACtG,sBAAY,CAAC,yCAAyC,CACzD,CAAC;YACF,OAAO,KAAK,CAAC;QACjB,CAAC;KAAA;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;IAEa,OAAO;6DACjB,YAAoB,EACpB,YAA0B,sBAAY,CAAC,QAAQ;YAE/C,gBAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAC3B,MAAM,IAAI,kBAAQ,CAAC;gBACf,SAAS,EAAE,SAAS,CAAC,QAAQ,EAAE;gBAC/B,OAAO,EAAE,YAAY;aACxB,CAAC,CAAC;QACP,CAAC;KAAA;CACJ;AA1CD,4DA0CC"}
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): Promise<boolean>;
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): Promise<boolean>;
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, (0, exports.isConnectivityFailure)(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, requestUnauthorizedCode(context.requestKind), Object.assign({ validationPhase: exports.ErrorTaxonomy.PhaseRequestAuthorization }, context));
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) => (0, exports.toTaxonomyError)(error, (0, exports.isConnectivityFailure)(error)
57
- ? VCLErrorCode_1.default.ConnectivityFailure
58
- : requestInvalidCode(context.requestKind), Object.assign({ validationPhase: exports.ErrorTaxonomy.PhaseRequestValidation }, context));
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) => isPresentationRequest(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) => isPresentationRequest(requestKind)
138
+ const notRegisteredCode = (requestKind) => requestKind === exports.ErrorTaxonomy.RequestKindPresentation
130
139
  ? VCLErrorCode_1.default.VerifierNotRegistered
131
140
  : VCLErrorCode_1.default.IssuerNotRegistered;
132
- const requestInvalidCode = (requestKind) => isPresentationRequest(requestKind)
133
- ? VCLErrorCode_1.default.VerifierRequestInvalid
134
- : VCLErrorCode_1.default.IssuerRequestInvalid;
135
- const requestUnauthorizedCode = (requestKind) => isPresentationRequest(requestKind)
136
- ? VCLErrorCode_1.default.VerifierRequestUnauthorized
137
- : VCLErrorCode_1.default.IssuerRequestUnauthorized;
138
- const isPresentationRequest = (requestKind) => requestKind === exports.ErrorTaxonomy.RequestKindPresentation;
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,gBAA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,6BAA6B,CAAC;IACtD,CAAC;IACD,IAAI,IAAA,6BAAqB,EAAC,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"}
@@ -6,8 +6,8 @@ export default class ErrorTaxonomyCompatibilityMapper {
6
6
  requestKind: RequestKind;
7
7
  }): VCLError;
8
8
  private mapInvalidLink;
9
+ private mapInvalidOrMissingDid;
9
10
  private mapInvalidRequestUri;
10
11
  private mapTaxonomyError;
11
- private mapNetworkStatus;
12
12
  private legacyCopy;
13
13
  }
@@ -3,7 +3,6 @@ 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
- const VCLError_1 = __importDefault(require("../../api/entities/error/VCLError"));
7
6
  const VCLErrorCode_1 = __importDefault(require("../../api/entities/error/VCLErrorCode"));
8
7
  const ErrorTaxonomy_1 = require("./ErrorTaxonomy");
9
8
  const ProfileServiceTypeVerifier_1 = require("./ProfileServiceTypeVerifier");
@@ -20,25 +19,30 @@ class ErrorTaxonomyCompatibilityMapper {
20
19
  default:
21
20
  return (0, ErrorTaxonomy_1.isTaxonomyError)(error)
22
21
  ? this.mapTaxonomyError(error)
23
- : this.mapNetworkStatus(error);
22
+ : error;
24
23
  }
25
24
  }
26
25
  mapInvalidLink(error, requestKind) {
27
26
  const endpointNullMessage = legacyEndpointNullMessage(requestKind);
28
27
  switch (error.sourceErrorCode) {
29
28
  case VelocityDeepLinkValidator_1.default.SourceInvalidOrMissingDid:
30
- return error.requestUri
31
- ? this.legacyCopy(error, mismatchErrorCode(requestKind))
32
- : this.legacyCopy(error, VCLErrorCode_1.default.SdkError, legacyMissingDidMessage);
29
+ return this.mapInvalidOrMissingDid(error, requestKind);
33
30
  case VelocityDeepLinkValidator_1.default.SourceInvalidOrMissingRequestUri:
34
31
  case VelocityDeepLinkValidator_1.default.SourceInvalidOrMissingRequestEndpoint:
35
32
  return this.mapInvalidRequestUri(error, endpointNullMessage);
36
33
  case VelocityDeepLinkValidator_1.default.SourceUnparseablePayload:
37
34
  return this.legacyCopy(error, VCLErrorCode_1.default.SdkError, legacyMissingDidMessage);
38
- default:
35
+ case VelocityDeepLinkValidator_1.default.SourceUnsupportedVelocityLink:
39
36
  return this.legacyCopy(error, VCLErrorCode_1.default.SdkError, endpointNullMessage);
37
+ default:
38
+ return this.legacyCopy(error, VCLErrorCode_1.default.SdkError);
40
39
  }
41
40
  }
41
+ mapInvalidOrMissingDid(error, requestKind) {
42
+ return error.requestUri
43
+ ? this.legacyCopy(error, mismatchErrorCode(requestKind))
44
+ : this.legacyCopy(error, VCLErrorCode_1.default.SdkError, legacyMissingDidMessage);
45
+ }
42
46
  mapInvalidRequestUri(error, endpointNullMessage) {
43
47
  var _a;
44
48
  if ((_a = error.requestUri) === null || _a === void 0 ? void 0 : _a.startsWith('ftp://')) {
@@ -50,24 +54,18 @@ class ErrorTaxonomyCompatibilityMapper {
50
54
  return this.legacyCopy(error, VCLErrorCode_1.default.SdkError, endpointNullMessage);
51
55
  }
52
56
  mapTaxonomyError(error) {
53
- const networkStatusError = this.mapNetworkStatus(error);
54
- const { sourceErrorCode } = networkStatusError;
55
- if (isLegacyPlainTextRequestRejection(networkStatusError)) {
56
- return this.legacyCopy(networkStatusError, VCLErrorCode_1.default.SdkError, `Request failed with status code ${networkStatusError.statusCode}`);
57
+ const { sourceErrorCode } = error;
58
+ if (isLegacyPlainTextRequestRejection(error)) {
59
+ return this.legacyCopy(error, VCLErrorCode_1.default.SdkError, `Request failed with status code ${error.statusCode}`);
57
60
  }
58
61
  if (!sourceErrorCode ||
59
- sourceErrorCode === networkStatusError.errorCode ||
62
+ sourceErrorCode === error.errorCode ||
60
63
  sourceErrorCode ===
61
- ProfileServiceTypeVerifier_1.ProfileServiceTypeVerifier.SourceWrongServiceType) {
62
- return this.legacyCopy(networkStatusError, VCLErrorCode_1.default.SdkError);
64
+ ProfileServiceTypeVerifier_1.ProfileServiceTypeVerifier.SourceWrongServiceType ||
65
+ sourceErrorCode === ErrorTaxonomy_1.SourceMalformedVerifiedProfile) {
66
+ return this.legacyCopy(error, VCLErrorCode_1.default.SdkError);
63
67
  }
64
- return this.legacyCopy(networkStatusError, sourceErrorCode);
65
- }
66
- mapNetworkStatus(error) {
67
- const payloadStatusCode = payloadStatus(error.payload);
68
- return payloadStatusCode == null
69
- ? error
70
- : (0, ErrorTaxonomy_1.copyError)(error, { statusCode: payloadStatusCode });
68
+ return this.legacyCopy(error, sourceErrorCode);
71
69
  }
72
70
  legacyCopy(error, errorCode, message = error.message, overrides = {}) {
73
71
  return (0, ErrorTaxonomy_1.copyError)(error, Object.assign(Object.assign({ errorCode, message: message === undefined ? error.message : message }, optionalStatusCode(overrides)), { sourceErrorCode: null, validationPhase: null, requestDid: null, requestUri: null, requestKind: null }));
@@ -77,16 +75,6 @@ exports.default = ErrorTaxonomyCompatibilityMapper;
77
75
  const mismatchErrorCode = (requestKind) => requestKind === ErrorTaxonomy_1.ErrorTaxonomy.RequestKindPresentation
78
76
  ? VCLErrorCode_1.default.MismatchedPresentationRequestInspectorDid
79
77
  : VCLErrorCode_1.default.MismatchedRequestIssuerDid;
80
- const payloadStatus = (payload) => {
81
- try {
82
- const parsed = payload ? JSON.parse(payload) : null;
83
- const value = parsed === null || parsed === void 0 ? void 0 : parsed[VCLError_1.default.KeyStatusCode];
84
- return typeof value === 'number' ? value : null;
85
- }
86
- catch (_a) {
87
- return null;
88
- }
89
- };
90
78
  const optionalStatusCode = (overrides) => Object.prototype.hasOwnProperty.call(overrides, 'statusCode')
91
79
  ? { statusCode: overrides.statusCode }
92
80
  : {};
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorTaxonomyCompatibilityMapper.js","sourceRoot":"","sources":["../../../src/impl/utils/ErrorTaxonomyCompatibilityMapper.ts"],"names":[],"mappings":";;;;;AAAA,iFAAyD;AACzD,yFAAiE;AACjE,mDAKyB;AACzB,6EAA0E;AAC1E,4FAAoE;AAEpE,MAAqB,gCAAgC;IACjD,GAAG,CAAC,EACA,KAAK,EACL,WAAW,GAId;QACG,QAAQ,KAAK,CAAC,SAAS,EAAE,CAAC;YACtB,KAAK,sBAAY,CAAC,WAAW;gBACzB,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YACnD,KAAK,sBAAY,CAAC,mBAAmB;gBACjC,OAAO,IAAI,CAAC,UAAU,CAClB,KAAK,EACL,sBAAY,CAAC,QAAQ,EACrB,SAAS,EACT;oBACI,UAAU,EAAE,IAAI;iBACnB,CACJ,CAAC;YACN;gBACI,OAAO,IAAA,+BAAe,EAAC,KAAK,CAAC;oBACzB,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;oBAC9B,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;IACL,CAAC;IAEO,cAAc,CAClB,KAAe,EACf,WAAwB;QAExB,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,WAAW,CAAC,CAAC;QACnE,QAAQ,KAAK,CAAC,eAAe,EAAE,CAAC;YAC5B,KAAK,mCAAyB,CAAC,yBAAyB;gBACpD,OAAO,KAAK,CAAC,UAAU;oBACnB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;oBACxD,CAAC,CAAC,IAAI,CAAC,U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,KAAK,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,WAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC,CAAC"}
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,KAAK,EACL,WAAW,GAId;QACG,QAAQ,KAAK,CAAC,SAAS,EAAE,CAAC;YACtB,KAAK,sBAAY,CAAC,WAAW;gBACzB,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YACnD,KAAK,sBAAY,CAAC,mBAAmB;gBACjC,OAAO,IAAI,CAAC,UAAU,CAClB,KAAK,EACL,sBAAY,CAAC,QAAQ,EACrB,SAAS,EACT;oBACI,UAAU,EAAE,IAAI;iBACnB,CACJ,CAAC;YACN;gBACI,OAAO,IAAA,+BAAe,EAAC,KAAK,CAAC;oBACzB,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;oBAC9B,CAAC,CAAC,KAAK,CAAC;QACpB,CAAC;IACL,CAAC;IAEO,cAAc,CAClB,KAAe,EACf,WAAwB;QAExB,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,WAAW,CAAC,CAAC;QACnE,QAAQ,KAAK,CAAC,eAAe,EAAE,CAAC;YAC5B,KAAK,mCAAyB,CAAC,yBAAyB;gBACpD,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YAC3D,KAAK,mCAAyB,CAAC,gCAAgC,CAAC;YAChE,KAAK,mCAAyB,CAAC,qCAAqC;gBAChE,OAAO,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;YAC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AC;IACzD,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,UAAU,EAAE;IACtC,CAAC,CAAC,EAAE,CAAC;AAEb,MAAM,uBAAuB,GAAG,oCAAoC,CAAC;AAErE,MAAM,yBAAyB,GAAG,CAAC,WAAwB,EAAE,EAAE,CAC3D,WAAW,KAAK,6BAAa,CAAC,uBAAuB;IACjD,CAAC,CAAC,+CAA+C;IACjD,CAAC,CAAC,8CAA8C,CAAC;AAEzD,MAAM,iCAAiC,GAAG,CAAC,KAAe,EAAE,EAAE,CAC1D,KAAK,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"}
@@ -5,7 +5,7 @@ const ErrorTaxonomy_1 = require("./ErrorTaxonomy");
5
5
  class VelocityDeepLinkValidator {
6
6
  validateDeepLink({ deepLink, expectedPath, requestKind, }) {
7
7
  const parsedUrl = parseUrl(deepLink.value);
8
- if (!parsedUrl) {
8
+ if (!hasParseableVelocityPayload(parsedUrl)) {
9
9
  return (0, ErrorTaxonomy_1.invalidLink)({
10
10
  message: 'Payload is not a parseable URL',
11
11
  sourceErrorCode: VelocityDeepLinkValidator.SourceUnparseablePayload,
@@ -13,8 +13,7 @@ class VelocityDeepLinkValidator {
13
13
  requestKind,
14
14
  });
15
15
  }
16
- if (!VelocityDeepLinkValidator.AllowedVelocitySchemes.has(parsedUrl.protocol) ||
17
- parsedUrl.hostname !== expectedPath) {
16
+ if (isUnsupportedVelocityLink(parsedUrl, expectedPath)) {
18
17
  return (0, ErrorTaxonomy_1.invalidLink)({
19
18
  message: `Unsupported Velocity link: ${deepLink.value}`,
20
19
  sourceErrorCode: VelocityDeepLinkValidator.SourceUnsupportedVelocityLink,
@@ -78,6 +77,9 @@ const hasValidDidParts = (did) => {
78
77
  const method = didParts.slice(0, methodEndIndex);
79
78
  return /^[a-z0-9]+$/.test(method);
80
79
  };
80
+ const hasParseableVelocityPayload = (parsedUrl) => parsedUrl != null && Boolean(parsedUrl.hostname);
81
+ const isUnsupportedVelocityLink = (parsedUrl, expectedPath) => !VelocityDeepLinkValidator.AllowedVelocitySchemes.has(parsedUrl.protocol) ||
82
+ parsedUrl.hostname !== expectedPath;
81
83
  const parseUrl = (value) => {
82
84
  try {
83
85
  return new URL(value);
@@ -1 +1 @@
1
- {"version":3,"file":"VelocityDeepLinkValidator.js","sourceRoot":"","sources":["../../../src/impl/utils/VelocityDeepLinkValidator.ts"],"names":[],"mappings":";;;AAEA,mDAA0E;AAE1E,MAAqB,yBAAyB;IAsB1C,gBAAgB,CAAC,EACb,QAAQ,EACR,YAAY,EACZ,WAAW,GAKd;QACG,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC3C,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,OAAO,IAAA,2BAAW,EAAC;gBACf,OAAO,EAAE,gCAAgC;gBACzC,eAAe,EACX,yBAAyB,CAAC,wBAAwB;gBACtD,UAAU,EAAE,QAAQ,CAAC,UAAU;gBAC/B,WAAW;aACd,CAAC,CAAC;QACP,CAAC;QACD,IACI,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,GAAG,CACjD,SAAS,CAAC,QAAQ,CACrB;YACD,SAAS,CAAC,QAAQ,KAAK,YAAY,EACrC,CAAC;YACC,OAAO,IAAA,2BAAW,EAAC;gBACf,OAAO,EAAE,8BAA8B,QAAQ,CAAC,KAAK,EAAE;gBACvD,eA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AAC,GAAW,EAAE,EAAE;IACrC,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,cAAc,IAAI,CAAC,IAAI,cAAc,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChE,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;IACjD,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,SAAqB,EAAoB,EAAE,CAC5E,SAAS,IAAI,IAAI,IAAI,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AAErD,MAAM,yBAAyB,GAAG,CAC9B,SAAc,EACd,YAAoB,EACb,EAAE,CACT,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC;IACzE,SAAS,CAAC,QAAQ,KAAK,YAAY,CAAC;AAExC,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE;IAC/B,IAAI,CAAC;QACD,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAAC,WAAM,CAAC;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC,CAAC;AAEa,0BAAkB,GAAK,6BAAa,oBAAC;AACrC,+BAAuB,GAAK,6BAAa,yBAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verii/vnf-nodejs-wallet-sdk",
3
- "version": "1.2.0-pre.1779864931",
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.1779864931",
27
- "@verii/vc-checks": "1.2.0-pre.1779864931",
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.1779864931",
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": "e809f8c754164a36ee6c7aad9e61ed34d5398b72"
57
+ "gitHead": "0070c227d10f59d2cfa64076f8ce9be917c2fb1d"
58
58
  }