@toa.io/extensions.configuration 0.20.0-dev.3 → 0.20.0-dev.31
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 +6 -6
- package/readme.md +7 -5
- package/source/provider.js +1 -3
- package/source/provider.test.js +1 -1
- /package/types/{aspect.ts → aspect.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/extensions.configuration",
|
|
3
|
-
"version": "0.20.0-dev.
|
|
3
|
+
"version": "0.20.0-dev.31",
|
|
4
4
|
"description": "Toa Configuration",
|
|
5
5
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/toa-io/toa#readme",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@toa.io/core": "0.20.0-dev.
|
|
20
|
-
"@toa.io/generic": "0.20.0-dev.
|
|
21
|
-
"@toa.io/schema": "0.20.0-dev.
|
|
22
|
-
"@toa.io/yaml": "0.20.0-dev.
|
|
19
|
+
"@toa.io/core": "0.20.0-dev.31",
|
|
20
|
+
"@toa.io/generic": "0.20.0-dev.31",
|
|
21
|
+
"@toa.io/schema": "0.20.0-dev.31",
|
|
22
|
+
"@toa.io/yaml": "0.20.0-dev.31",
|
|
23
23
|
"clone-deep": "4.0.1"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "f9ad6bf2bab1298b96ca52557b7e36b6041cfc88"
|
|
26
26
|
}
|
package/readme.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Toa Configuration
|
|
1
|
+
# Toa Configuration
|
|
2
2
|
|
|
3
3
|
## TL;DR
|
|
4
4
|
|
|
@@ -38,14 +38,15 @@ configuration:
|
|
|
38
38
|
### Deploy secrets
|
|
39
39
|
|
|
40
40
|
```shell
|
|
41
|
-
$ toa conceal configuration BAZ_VALUE
|
|
41
|
+
$ toa conceal configuration BAZ_VALUE=$ecr3t
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
46
46
|
## Problem Definition
|
|
47
47
|
|
|
48
|
-
- Components must be reusable in different contexts and deployment environments that are in
|
|
48
|
+
- Components must be reusable in different contexts and deployment environments that are in
|
|
49
|
+
different configurations.
|
|
49
50
|
- Some algorithm parameters must be deployed secretly.
|
|
50
51
|
|
|
51
52
|
## Definitions
|
|
@@ -188,7 +189,7 @@ manually ([`toa conceal`](../../runtime/cli/readme.md#conceal)).
|
|
|
188
189
|
Deployed kubernetes secret's name is predefined as `configuration`.
|
|
189
190
|
|
|
190
191
|
```shell
|
|
191
|
-
$ toa conceal configuration STRIPE_API_KEY
|
|
192
|
+
$ toa conceal configuration STRIPE_API_KEY=xxxxxxxx
|
|
192
193
|
```
|
|
193
194
|
|
|
194
195
|
## Aspect
|
|
@@ -232,7 +233,8 @@ Configuration can be exported by [`toa env`](/runtime/cli/readme.md#env).
|
|
|
232
233
|
Context Configuration values may contain placeholders that reference environment variables.
|
|
233
234
|
Placeholders are replaced with values if the corresponding environment variables are set.
|
|
234
235
|
|
|
235
|
-
> Placeholders can only be used with local environment (exported by `toa env`), as these values are
|
|
236
|
+
> Placeholders can only be used with local environment (exported by `toa env`), as these values are
|
|
237
|
+
> not
|
|
236
238
|
> deployed.
|
|
237
239
|
|
|
238
240
|
```yaml
|
package/source/provider.js
CHANGED
|
@@ -109,9 +109,7 @@ class Provider extends Connector {
|
|
|
109
109
|
return secrets(object, (variable) => {
|
|
110
110
|
if (!(variable in process.env)) throw new Error(`Configuration secret value ${variable} is not set`)
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return decode(base64)
|
|
112
|
+
return process.env[variable]
|
|
115
113
|
})
|
|
116
114
|
}
|
|
117
115
|
}
|
package/source/provider.test.js
CHANGED
|
@@ -108,7 +108,7 @@ function setEnv (configuration, secrets) {
|
|
|
108
108
|
for (const [key, value] of Object.entries(secrets)) {
|
|
109
109
|
const variable = PREFIX + '_' + key
|
|
110
110
|
|
|
111
|
-
process.env[variable] =
|
|
111
|
+
process.env[variable] = value
|
|
112
112
|
usedVariables.push(variable)
|
|
113
113
|
}
|
|
114
114
|
}
|
|
File without changes
|