@lowdefy/node-utils 5.5.0 → 5.6.0
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.
|
@@ -12,11 +12,18 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/
|
|
15
|
+
*/ import { isReserved, setKey } from '@lowdefy/helpers';
|
|
16
|
+
function getSecretsFromEnv() {
|
|
16
17
|
const secrets = {};
|
|
17
18
|
Object.keys(process.env).forEach((key)=>{
|
|
18
19
|
if (key.startsWith('LOWDEFY_SECRET_')) {
|
|
19
|
-
|
|
20
|
+
const name = key.replace('LOWDEFY_SECRET_', '');
|
|
21
|
+
// Fail at boot rather than at first _secret read: the reserved name is
|
|
22
|
+
// unreadable through get/getKey, so the secret would never resolve.
|
|
23
|
+
if (isReserved(name)) {
|
|
24
|
+
throw new Error(`Environment variable "${key}" names a reserved secret "${name}". Rename the secret.`);
|
|
25
|
+
}
|
|
26
|
+
setKey(secrets, name, process.env[key]);
|
|
20
27
|
}
|
|
21
28
|
});
|
|
22
29
|
Object.freeze(secrets);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/node-utils",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"dist/*"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@lowdefy/errors": "5.
|
|
38
|
-
"@lowdefy/helpers": "5.
|
|
37
|
+
"@lowdefy/errors": "5.6.0",
|
|
38
|
+
"@lowdefy/helpers": "5.6.0",
|
|
39
39
|
"fs-extra": "11.1.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|