@velocitycareerlabs/server-careerwallet 1.25.0-dev-build.1a8c96ac7 → 1.25.0-dev-build.1eded1dfe
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/.localdev.env
CHANGED
|
@@ -5,10 +5,6 @@ EXT_PORT=3010
|
|
|
5
5
|
MONGO_URI=mongodb://velocity-mongo:27017/careerwallet
|
|
6
6
|
LOG_SEVERITY=debug
|
|
7
7
|
MONGO_SECRET=1D72960202372A2E8B36202756C0B1E5066BAF468DFDB366DF71FA7FE607402A
|
|
8
|
-
ROOT_DID=did:velocity:0xc30b69405238038080c641cc20a63715ca97d706
|
|
9
|
-
ROOT_KID=did:velocity:0xc30b69405238038080c641cc20a63715ca97d706#key-1
|
|
10
|
-
ROOT_PRIVATE_KEY=e090d2f5ba3f22f818190f6f0380e68a1608f307461a8db6066e3d64b57c9f0c
|
|
11
|
-
ROOT_PUBLIC_KEY=04861db69920a978ab13eef674030f182ce85336c8af01a7bdc4dbd64e5d60fbdae0bfad6b8e8ed63849a25cb59e88c25918d18bb05014ae1380b5aa902836268c
|
|
12
8
|
ADMIN_USER_NAME=velocity.admin@example.com
|
|
13
9
|
SECRET=B230BB25DFA82D5470884918143893E50242FB96C4C53119244DBE21CF987B70
|
|
14
10
|
VERIFICATION_SENDER_EMAIL=sender@example.com
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velocitycareerlabs/server-careerwallet",
|
|
3
|
-
"version": "1.25.0-dev-build.
|
|
3
|
+
"version": "1.25.0-dev-build.1eded1dfe",
|
|
4
4
|
"description": "Career Wallet application",
|
|
5
5
|
"repository": "https://github.com/velocitycareerlabs/packages",
|
|
6
6
|
"engines": {
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"@velocitycareerlabs/did-doc": "1.25.0-dev-build.1c4326b30",
|
|
45
45
|
"@velocitycareerlabs/fastify-plugins": "1.25.0-dev-build.1c4326b30",
|
|
46
46
|
"@velocitycareerlabs/jwt": "1.25.0-dev-build.1c4326b30",
|
|
47
|
-
"@velocitycareerlabs/migrations": "1.25.0-dev-build.
|
|
47
|
+
"@velocitycareerlabs/migrations": "1.25.0-dev-build.1eded1dfe",
|
|
48
48
|
"@velocitycareerlabs/organizations-registry": "1.25.0-dev-build.1c4326b30",
|
|
49
49
|
"@velocitycareerlabs/request": "1.25.0-dev-build.1c4326b30",
|
|
50
50
|
"@velocitycareerlabs/server-provider": "1.25.0-dev-build.1c4326b30",
|
|
51
51
|
"@velocitycareerlabs/spencer-mongo-extensions": "1.25.0-dev-build.1c4326b30",
|
|
52
52
|
"@velocitycareerlabs/verifiable-credentials": "1.25.0-dev-build.1c4326b30",
|
|
53
|
-
"@velocitycareerlabs/yoti-integration-plugin": "1.25.0-dev-build.
|
|
53
|
+
"@velocitycareerlabs/yoti-integration-plugin": "1.25.0-dev-build.1eded1dfe",
|
|
54
54
|
"aws-sdk": "2.1692.0",
|
|
55
55
|
"canonicalize": "^2.0.0",
|
|
56
56
|
"date-fns": "^3.0.0",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"nodemon": "3.1.10",
|
|
89
89
|
"prettier": "2.8.8"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "195ec958027d2ec01c5f1ad8dd47a92fe7f5775a"
|
|
92
92
|
}
|
package/src/config/config.js
CHANGED
|
@@ -112,7 +112,10 @@ const holderAppServerConfig = {
|
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
const verifierConfig = {
|
|
115
|
-
|
|
115
|
+
contactIssuerOrganizationDid: env
|
|
116
|
+
.get('CONTACT_ISSUER_ORGANIZATION_DID')
|
|
117
|
+
.required(!isTest)
|
|
118
|
+
.asString(),
|
|
116
119
|
agentUrl: env.get('AGENT_URL').required().asString(),
|
|
117
120
|
attemptsThreshold: env.get('ATTEMPTS_THRESHOLD').default(3).asIntPositive(),
|
|
118
121
|
smsAppVerificationHash: env
|
|
@@ -202,7 +202,7 @@ const verificationController = async (fastify) => {
|
|
|
202
202
|
{
|
|
203
203
|
id: verificationCode,
|
|
204
204
|
type: ['VerificationIdentifier'],
|
|
205
|
-
issuer: fastify.config.
|
|
205
|
+
issuer: fastify.config.contactIssuerOrganizationDid,
|
|
206
206
|
credentialSubject: {
|
|
207
207
|
id: offer.offerId,
|
|
208
208
|
},
|
package/test/helpers/.env.test
CHANGED
|
@@ -36,4 +36,5 @@ OAUTH_VERIFICATION_DISABLED_ENDPOINTS="GET:/api/v0.6/devices/:deviceId,GET:/api/
|
|
|
36
36
|
OAUTH0_DOMAIN=https://localhost/
|
|
37
37
|
AUTH0_CAREER_WALLET_AUDIENCE=foo
|
|
38
38
|
OAUTH0_WEBAPP_CLIENT_ID=foo
|
|
39
|
-
CAREERWALLET_SUPPORT_EMAIL=vcl.devnet@gmail.com
|
|
39
|
+
CAREERWALLET_SUPPORT_EMAIL=vcl.devnet@gmail.com
|
|
40
|
+
CONTACT_ISSUER_ORGANIZATION_DID=did:test:foo-contact-issuer
|
|
@@ -11,6 +11,7 @@ const {
|
|
|
11
11
|
hashAndEncodeHex,
|
|
12
12
|
} = require('@velocitycareerlabs/crypto');
|
|
13
13
|
const { hexFromJwk } = require('@velocitycareerlabs/jwt');
|
|
14
|
+
const { ISO_DATETIME_FORMAT } = require('@velocitycareerlabs/test-regexes');
|
|
14
15
|
const buildFastify = require('./helpers/careerwallet-build-fastify');
|
|
15
16
|
const initVerificationFactory = require('./factories/verification-factory');
|
|
16
17
|
const initVerificationOfferFactory = require('./factories/verification-offer-factory');
|
|
@@ -614,7 +615,7 @@ describe('Email & Phone Verification', () => {
|
|
|
614
615
|
expect(response.statusCode).toEqual(404);
|
|
615
616
|
});
|
|
616
617
|
|
|
617
|
-
it('Should return 404 when
|
|
618
|
+
it('Should return 404 when verification code isnt the latest', async () => {
|
|
618
619
|
const verification1 = await persistVerification();
|
|
619
620
|
await wait(10);
|
|
620
621
|
await persistVerification();
|
|
@@ -654,9 +655,17 @@ describe('Email & Phone Verification', () => {
|
|
|
654
655
|
});
|
|
655
656
|
|
|
656
657
|
expect(response.statusCode).toEqual(200);
|
|
657
|
-
expect(verifiedCredential
|
|
658
|
-
|
|
659
|
-
|
|
658
|
+
expect(verifiedCredential).toEqual({
|
|
659
|
+
id: expect.any(String),
|
|
660
|
+
issuanceDate: expect.stringMatching(ISO_DATETIME_FORMAT),
|
|
661
|
+
issuer: {
|
|
662
|
+
id: 'did:test:foo-contact-issuer',
|
|
663
|
+
},
|
|
664
|
+
credentialSubject: {
|
|
665
|
+
id: offer.offerId,
|
|
666
|
+
},
|
|
667
|
+
type: ['VerificationIdentifier'],
|
|
668
|
+
});
|
|
660
669
|
});
|
|
661
670
|
});
|
|
662
671
|
describe('Complete verification VCL Verification Version 2', () => {
|
package/test/helpers/yoti.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
SandboxDocScanClientBuilder,
|
|
3
|
-
SandboxBreakdownBuilder,
|
|
4
|
-
SandboxRecommendationBuilder,
|
|
5
|
-
SandboxDocumentAuthenticityCheckBuilder,
|
|
6
|
-
SandboxCheckReportsBuilder,
|
|
7
|
-
SandboxResponseConfigBuilder,
|
|
8
|
-
SandboxDocumentTextDataCheckBuilder,
|
|
9
|
-
SandboxTaskResultsBuilder,
|
|
10
|
-
SandboxDocumentFaceMatchCheckBuilder,
|
|
11
|
-
SandboxDocumentTextDataExtractionTaskBuilder,
|
|
12
|
-
} = require('@getyoti/sdk-sandbox');
|
|
13
|
-
|
|
14
|
-
const { yotiClientSdkId, yotiSecret } = require('../../src/config/config');
|
|
15
|
-
|
|
16
|
-
const configureSessionResponse = async (sessionId) => {
|
|
17
|
-
const sandboxClient = new SandboxDocScanClientBuilder()
|
|
18
|
-
.withClientSdkId(yotiClientSdkId)
|
|
19
|
-
.withPemString(yotiSecret.toString())
|
|
20
|
-
.build();
|
|
21
|
-
const documentAuthenticityCheckConfig =
|
|
22
|
-
new SandboxDocumentAuthenticityCheckBuilder()
|
|
23
|
-
.withRecommendation(
|
|
24
|
-
new SandboxRecommendationBuilder().withValue('APPROVE').build()
|
|
25
|
-
)
|
|
26
|
-
.withBreakdown(
|
|
27
|
-
new SandboxBreakdownBuilder()
|
|
28
|
-
.withSubCheck('document_in_date')
|
|
29
|
-
.withResult('PASS')
|
|
30
|
-
.build()
|
|
31
|
-
)
|
|
32
|
-
.build();
|
|
33
|
-
|
|
34
|
-
const textDataCheckConfig = new SandboxDocumentTextDataCheckBuilder()
|
|
35
|
-
.withRecommendation(
|
|
36
|
-
new SandboxRecommendationBuilder().withValue('APPROVE').build()
|
|
37
|
-
)
|
|
38
|
-
.withBreakdown(
|
|
39
|
-
new SandboxBreakdownBuilder()
|
|
40
|
-
.withSubCheck('text_data_readable')
|
|
41
|
-
.withResult('PASS')
|
|
42
|
-
.build()
|
|
43
|
-
)
|
|
44
|
-
.withDocumentFields({
|
|
45
|
-
full_name: 'John Doe',
|
|
46
|
-
nationality: 'GBR',
|
|
47
|
-
date_of_birth: '1986-06-01',
|
|
48
|
-
document_number: '123456789',
|
|
49
|
-
})
|
|
50
|
-
.build();
|
|
51
|
-
|
|
52
|
-
const faceMatchCheckConfig = new SandboxDocumentFaceMatchCheckBuilder()
|
|
53
|
-
.withRecommendation(
|
|
54
|
-
new SandboxRecommendationBuilder().withValue('APPROVE').build()
|
|
55
|
-
)
|
|
56
|
-
.withBreakdown(
|
|
57
|
-
new SandboxBreakdownBuilder()
|
|
58
|
-
.withSubCheck('ai_face_match')
|
|
59
|
-
.withResult('PASS')
|
|
60
|
-
.withDetail('confidence_score', '0.81')
|
|
61
|
-
.build()
|
|
62
|
-
)
|
|
63
|
-
.build();
|
|
64
|
-
|
|
65
|
-
const textExtractionConfig =
|
|
66
|
-
new SandboxDocumentTextDataExtractionTaskBuilder()
|
|
67
|
-
.withDocumentFields({
|
|
68
|
-
full_name: 'John Doe',
|
|
69
|
-
nationality: 'GBR',
|
|
70
|
-
date_of_birth: '1986-06-01',
|
|
71
|
-
document_number: '123456789',
|
|
72
|
-
})
|
|
73
|
-
.build();
|
|
74
|
-
|
|
75
|
-
const checkReportsConfig = new SandboxCheckReportsBuilder()
|
|
76
|
-
.withAsyncReportDelay(5)
|
|
77
|
-
.withDocumentAuthenticityCheck(documentAuthenticityCheckConfig)
|
|
78
|
-
.withDocumentTextDataCheck(textDataCheckConfig)
|
|
79
|
-
.withDocumentFaceMatchCheck(faceMatchCheckConfig)
|
|
80
|
-
.build();
|
|
81
|
-
|
|
82
|
-
const taskResultsConfig = new SandboxTaskResultsBuilder()
|
|
83
|
-
.withDocumentTextDataExtractionTask(textExtractionConfig)
|
|
84
|
-
.build();
|
|
85
|
-
|
|
86
|
-
const responseConfig = new SandboxResponseConfigBuilder()
|
|
87
|
-
.withCheckReports(checkReportsConfig)
|
|
88
|
-
.withTaskResults(taskResultsConfig)
|
|
89
|
-
.build();
|
|
90
|
-
|
|
91
|
-
await sandboxClient.configureSessionResponse(sessionId, responseConfig);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
module.exports = {
|
|
95
|
-
configureSessionResponse,
|
|
96
|
-
};
|