@toa.io/extensions.origins 0.20.0-dev.16 → 0.20.0-dev.18
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/extensions.origins",
|
|
3
|
-
"version": "0.20.0-dev.
|
|
3
|
+
"version": "0.20.0-dev.18",
|
|
4
4
|
"description": "Toa Origins",
|
|
5
5
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/toa-io/toa#readme",
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@toa.io/core": "0.20.0-dev.
|
|
23
|
-
"@toa.io/generic": "0.20.0-dev.
|
|
24
|
-
"@toa.io/schemas": "0.20.0-dev.
|
|
25
|
-
"@toa.io/yaml": "0.20.0-dev.
|
|
22
|
+
"@toa.io/core": "0.20.0-dev.18",
|
|
23
|
+
"@toa.io/generic": "0.20.0-dev.18",
|
|
24
|
+
"@toa.io/schemas": "0.20.0-dev.18",
|
|
25
|
+
"@toa.io/yaml": "0.20.0-dev.18",
|
|
26
26
|
"comq": "0.8.0",
|
|
27
27
|
"node-fetch": "2.6.7"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node-fetch": "2.6.2"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "24c2fccf1af324fc4b0e32d5e3e012786618f5bb"
|
|
33
33
|
}
|
package/source/.credentials.js
CHANGED
|
@@ -62,16 +62,6 @@ describe('validation', () => {
|
|
|
62
62
|
|
|
63
63
|
expect(() => deployment(components, annotations)).toThrow('must be object')
|
|
64
64
|
})
|
|
65
|
-
|
|
66
|
-
it('should throw if annotation is URI is not valid', async () => {
|
|
67
|
-
const annotations = {
|
|
68
|
-
[component.locator.id]: {
|
|
69
|
-
[origin]: 'hello!'
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
expect(() => deployment(components, annotations)).toThrow('must match format')
|
|
74
|
-
})
|
|
75
65
|
})
|
|
76
66
|
|
|
77
67
|
it('should create variables', () => {
|
package/source/factory.js
CHANGED
package/source/manifest.test.js
CHANGED
|
@@ -32,12 +32,6 @@ it('should pass if valid', async () => {
|
|
|
32
32
|
expect(() => manifest(input)).not.toThrow()
|
|
33
33
|
})
|
|
34
34
|
|
|
35
|
-
it('should fail if not uri', async () => {
|
|
36
|
-
const input = { [generate()]: generate() }
|
|
37
|
-
|
|
38
|
-
expect(() => manifest(input)).toThrow('must match format')
|
|
39
|
-
})
|
|
40
|
-
|
|
41
35
|
it('should throw if protocol is not supported', async () => {
|
|
42
36
|
const input = { foo: 'wat://' + generate() }
|
|
43
37
|
|
|
@@ -15,9 +15,13 @@ function deployment (instances) {
|
|
|
15
15
|
const secrets = []
|
|
16
16
|
|
|
17
17
|
for (const [origin, reference] of Object.entries(manifest)) {
|
|
18
|
-
|
|
18
|
+
let protocol
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
const match = reference.match(RX)
|
|
21
|
+
|
|
22
|
+
if (match !== null) protocol = match.groups.protocol
|
|
23
|
+
|
|
24
|
+
if (protocols.includes(protocol)) {
|
|
21
25
|
const originSecrets = createSecrets(locator, origin)
|
|
22
26
|
|
|
23
27
|
secrets.push(...originSecrets)
|
|
@@ -60,4 +64,6 @@ function createSecret (locator, origin, property) {
|
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
66
|
|
|
67
|
+
const RX = /^(?<protocol>\w{1,12}:)/
|
|
68
|
+
|
|
63
69
|
exports.deployment = deployment
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/^\./: <boolean>
|
|
2
|
-
/^[a-zA-Z0-9]{1,32}$/:
|
|
2
|
+
/^[a-zA-Z0-9]{1,32}$/: string
|