@velocitycareerlabs/tests-helpers 1.24.0-testnet-build.1a8cdfca7 → 1.25.0-dev-build.167f15677

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/.env.test CHANGED
@@ -21,7 +21,7 @@ BEARER_TOKEN=fake-bearer-token
21
21
  YOTI_CLIENT_SDK_ID=024e10dd-fc2a-4352-b13e-ad5e3853d14a
22
22
  YOTI_SECRET="-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQEAtwYz3SyHXPF390qoVrWY5WaxgJ8+EVKVqhXtKnEGgDKe7zg3\n75gucwYZ0OR2CPI+DqsCzxTZ49HzDmCS1U+YpMLUfHFYozj1q90YJMdTHYbqhel7\nt0cEDetp1zgANilz5vxGY6PTSRYzmejxG5RBR0mv6bVZk04l1AWBi4AMLZ5FByU9\noJnZZLyAicIWThIpo/dNP+8XD56JeskOLeqorV/8u+ozqH4+ywIvigEYsRihxIV/\nVVkf7gf/aOmnJ2vWS1mrUevrZux/J7O6M7WT9iZNW0p+OCmx+rmZDIoP4UREqpwL\ng2Bt0QxOkso4VP5sHMi/x7w0y2JBJQxlelivpwIDAQABAoIBABkOVFNXIUDsHcxR\nADK+savWHz7Ijiq475xVXB6PUqCCTZfaTm4Sm2lL0IT0geQ/pZdEeiH3bMzvlSLG\nvdNODkugEI7oxYWy6o8YuZFvaEWGjty+Vh2FL1zoeZjpJb5EdoWMy+YgK3C6BV5w\nsXFhHn6v69FG7nhoHm2kQ1Pht8kWwbMswYHmrKIBuQjGxla5HTjPRQHvBbtvVkEf\nKJ9Z6YhtW7pBMwjIIVyzUJ6lRm+9N6lRgg8+U40vphlfAFYBW+x3tv/WzsQv53F0\ne8sOQVwILJqSZ6r02jriOSwK5tp4Ce3hnjPDAhBaAw7GrHDbgxrYpWK2lZIx68i3\nbxW+tWECgYEA/xN8/fPDGyVxhKu12asmE6F6qNxe72GRU4r9lOMQTaebCcMTCb+3\nWUkKn9N7qzj7zpLn8CHK41TARKxmAiFniw53nlYkHj4QoMSADloZK7nvhWP1+Mul\ncpZ0JYDGuHp/sq8hRdSs4tI3vDj+b44KzBTdQn7VleIJwL/xes+mxcsCgYEAt6/o\nB49jKxxNEMvn98WFI8PQXSK8Gw4e95tpCqBEIak9PaA/N1IIAVUX7/wzyq/Rvh76\nezTqCK6lVroWB0NfM+cQvwsjCImRPIIiSZhEvcUD+U6rimgqKbbGwyViPvAZ7iWb\nhqRH3RNCCr0KztbufX7aeht6EoF/0icnP6mAohUCgYBpw4TiL77IdMAbCK/Ab2y8\nWwpnFejvTP9bKph2safC6yon5BDyy+GUTerv1lrC5j/SqasuMHTVygBm+Sza2Ur7\np6YFqyYSvB1c691FFiq1rMUaBBarcJVLbAMAweKj/3cPefpL4CFHc27UxrUJQFZN\nxKDxv3GEUlNE7tGL4Kn//QKBgA44rkw3i8QAsu7D+reyMTatqGotkEa/9yHQhHdw\nJRY+FiG5UGumDDyeK/ZGnnPo3OJNX7M+S4hUjTSDv8TcMHjCQQepgxLcI8R9hs4P\n3fKbWE1rC9jxa6JDJmxhbpPU3w0TGFF6Up4JKanPLREKjvhkY+HkUrUwFYddxKon\nI3BpAoGAN6VWcwMXAUcYvSJ9lt+Q/ore+rmuMyuiiW5TtgUkR7Vbmf2lmfN+xF5h\nYO8QoT2EguY3w15IlBB948vvU18GcAI50rsO5q0eBQ/vAuNm1GXdyOMZxfdPnnUd\nypq/4ikZrah2zKsB6XKitGBe/6XnuT1GHWhyx5x5SxolO9yoFao=\n-----END RSA PRIVATE KEY-----"
23
23
  YOTI_IDV_API_URL=https://api.yoti.com/sandbox/idverify/v1
24
- ID_VERIFICATION_TENANT_DID=did:velocity:test-id-verification-tenant-did
24
+ ID_VERIFICATION_TENANT_ID=did:velocity:test-id-verification-tenant-did
25
25
  OFFER_TYPE=PREPREPARED_ONLY
26
26
  DEEP_LINK_PROTOCOL=velocity-test://
27
27
  LIB_URL=http://lib.localhost.test
package/index.js CHANGED
@@ -26,7 +26,6 @@ module.exports = {
26
26
  ...require('./src/mongoify'),
27
27
  ...require('./src/generate-key-pair-in-hex-and-jwk'),
28
28
  ...require('./src/jwk-matchers'),
29
- ...require('./src/generate-ion-operations'),
30
29
  ...require('./src/generate-organization-key-matcher'),
31
30
  ...require('./src/test-oauth-user'),
32
31
  ...require('./src/s3-utils'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velocitycareerlabs/tests-helpers",
3
- "version": "1.24.0-testnet-build.1a8cdfca7",
3
+ "version": "1.25.0-dev-build.167f15677",
4
4
  "description": "Generic helpers for tests",
5
5
  "repository": "https://github.com/velocitycareerlabs/packages",
6
6
  "main": "index.js",
@@ -16,29 +16,29 @@
16
16
  "license": "Apache-2.0",
17
17
  "dependencies": {
18
18
  "@spencejs/spence-mongo-repos": "^0.10.2",
19
- "@velocitycareerlabs/common-functions": "1.24.0-testnet-build.1a8cdfca7",
20
- "@velocitycareerlabs/crypto": "1.24.0-testnet-build.1a8cdfca7",
21
- "@velocitycareerlabs/jwt": "1.24.0-testnet-build.1a8cdfca7",
22
- "@velocitycareerlabs/test-regexes": "1.24.0-testnet-build.1a8cdfca7",
19
+ "@velocitycareerlabs/common-functions": "1.25.0-dev-build.167f15677",
20
+ "@velocitycareerlabs/crypto": "1.25.0-dev-build.167f15677",
21
+ "@velocitycareerlabs/jwt": "1.25.0-dev-build.167f15677",
22
+ "@velocitycareerlabs/test-regexes": "1.25.0-dev-build.167f15677",
23
23
  "dotenv": "^16.0.0",
24
24
  "env-var": "^7.0.0",
25
- "lodash": "~4.17.21",
26
- "mongodb": "~6.10.0",
25
+ "lodash": "^4.17.21",
26
+ "mongodb": "~6.13.0",
27
27
  "nanoid": "~3.3.1"
28
28
  },
29
29
  "devDependencies": {
30
- "eslint": "7.32.0",
30
+ "eslint": "8.57.1",
31
31
  "eslint-config-airbnb-base": "14.2.1",
32
32
  "eslint-config-prettier": "8.10.0",
33
33
  "eslint-plugin-autofix": "1.1.0",
34
- "eslint-plugin-better-mutation": "1.5.0",
35
- "eslint-plugin-import": "2.29.1",
36
- "eslint-plugin-prefer-arrow-functions": "3.3.2",
34
+ "eslint-plugin-better-mutation": "1.6.0",
35
+ "eslint-plugin-import": "2.31.0",
36
+ "eslint-plugin-prefer-arrow-functions": "3.6.2",
37
37
  "eslint-plugin-prettier": "4.2.1",
38
38
  "eslint-watch": "7.0.0",
39
39
  "jest": "29.7.0",
40
- "nanoid": "3.3.7",
40
+ "nanoid": "3.3.8",
41
41
  "prettier": "2.8.8"
42
42
  },
43
- "gitHead": "6c41252e54380fc0a7f03c3d8ce04fa6dc5df05d"
43
+ "gitHead": "754a29289bc403cef7c2da89181046a891256278"
44
44
  }
@@ -16,7 +16,7 @@
16
16
  const { nanoid } = require('nanoid');
17
17
 
18
18
  const VNF_GROUP_ID_CLAIM = 'http://velocitynetwork.foundation/groupId';
19
- const DEFAULT_GROUP_ID = 'did:ion:1234';
19
+ const DEFAULT_GROUP_ID = 'did:test:1234';
20
20
 
21
21
  const testRegistrarSuperUser = {
22
22
  sub: `auth0|${nanoid()}`,
@@ -1,120 +0,0 @@
1
- /**
2
- * Copyright 2023 Velocity Team
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- const { last, map, reduce } = require('lodash/fp');
18
- const { privateJwkMatcher, publicJwkMatcher } = require('./jwk-matchers');
19
-
20
- const generateDidKeyMatcher = (kid) => ({
21
- id: last(kid.split('#')),
22
- type: 'EcdsaSecp256k1VerificationKey2019',
23
- publicKeyJwk: publicJwkMatcher,
24
- purposes: ['assertionMethod'],
25
- });
26
-
27
- const createInitOp = (services, keys) => ({
28
- operation: 'create',
29
- content: {
30
- publicKeys: map(generateDidKeyMatcher, keys),
31
- services: map(formatService, services),
32
- },
33
- recovery: {
34
- publicJwk: publicJwkMatcher,
35
- privateJwk: privateJwkMatcher,
36
- },
37
- update: {
38
- publicJwk: publicJwkMatcher,
39
- privateJwk: privateJwkMatcher,
40
- },
41
- });
42
-
43
- const addServiceOp = (service, previous, options) => {
44
- const content = {};
45
- if (!options.remove) {
46
- content.addServices = [formatService(service)];
47
- }
48
- if (options.replace || options.remove) {
49
- content.removeServices = [service.id.slice(1)];
50
- }
51
-
52
- return {
53
- operation: 'update',
54
- content,
55
- previous,
56
- update: {
57
- publicJwk: publicJwkMatcher,
58
- privateJwk: privateJwkMatcher,
59
- },
60
- };
61
- };
62
-
63
- const addPublicKeyOp = (publicKey, previous, options) => {
64
- const content = {};
65
- if (!options.remove) {
66
- content.addPublicKeys = [generateDidKeyMatcher(publicKey.id)];
67
- }
68
- if (options.replace || options.remove) {
69
- content.removePublicKeys = [publicKey.id.slice(1)];
70
- }
71
-
72
- return {
73
- operation: 'update',
74
- content,
75
- previous,
76
- update: {
77
- publicJwk: publicJwkMatcher,
78
- privateJwk: privateJwkMatcher,
79
- },
80
- };
81
- };
82
-
83
- const formatService = (service) => ({
84
- id: service.id.slice(1),
85
- serviceEndpoint: service.serviceEndpoint,
86
- type: service.type,
87
- });
88
-
89
- // Should really also include initialKeys. See thread at:
90
- // https://github.com/velocitycareerlabs/monorepo/pull/1271#discussion_r714185994
91
- const generateIonOperations = (
92
- initialServices = [],
93
- additionalServices = [],
94
- kids = ['vc-signing-key-1', 'eth-account-key-1', 'exchange-key-1'],
95
- options = {}
96
- ) => {
97
- const op0 = createInitOp(initialServices, kids.slice(0, 2));
98
- const initialOps = reduce(
99
- (acc, kid) => {
100
- acc.push(addPublicKeyOp({ id: kid }, last(acc), {}));
101
- return acc;
102
- },
103
- [op0],
104
- kids.slice(2)
105
- );
106
- return reduce(
107
- (acc, service) => {
108
- acc.push(addServiceOp(service, last(acc), options));
109
- return acc;
110
- },
111
- initialOps,
112
- additionalServices
113
- );
114
- };
115
-
116
- module.exports = {
117
- generateIonOperations,
118
- generateDidKeyMatcher,
119
- addPublicKeyOp,
120
- };