Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@coast/dynamic-config

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coast/dynamic-config - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

18

DynamicConfig.js

@@ -17,2 +17,4 @@ "use strict";

this.configuration = {};
this.options.ssmMaxParams = this.options.ssmMaxParams !== undefined ? Math.min(this.options.ssmMaxParams, 10) : 10;
this.options.skipSsm = this.options.skipSsm !== undefined ? this.options.skipSsm : false;
}

@@ -35,3 +37,3 @@ /**

const missingEntries = this.getAllUnsetKeys(allKeys, entries);
if (missingEntries.length > 0) {
if (missingEntries.length > 0 && !this.options.skipSsm) {
await this.loadFromSsm(missingEntries, dotEnvParse, entries);

@@ -71,6 +73,12 @@ }

});
const response = await this.ssmClient.getParameters({ Names: pathPrefixedEntries }).promise();
response.Parameters?.forEach((parameter) => {
entries[parameter.Name] = parameter.Value;
});
const splitNames = [];
while (pathPrefixedEntries.length > 0) {
splitNames.push(pathPrefixedEntries.splice(0, this.options.ssmMaxParams));
}
for (const names of splitNames) {
const response = await this.ssmClient.getParameters({ Names: names, WithDecryption: true }).promise();
response.Parameters?.forEach((parameter) => {
entries[parameter.Name] = parameter.Value;
});
}
}

@@ -77,0 +85,0 @@ getAllUnsetKeys(allKeys, entries) {

@@ -8,2 +8,4 @@ /// <reference types="hapi__joi" />

* @property envFilePath: Path to a dotenv file. Ignored if file is not found
* @property skipSsm: if true we will not attemp to use ssm at all
* @property ssmMaxParams: testing only, default = 10
* @property ssmPaths: optional array of paths. Ex ['staging', 'core-api'] will lookup params at '/staging/core-api/.'

@@ -15,5 +17,7 @@ * @property allowUnknownVariables: Allow variables not specified in the schema.

schema: ObjectSchema;
skipSsm?: boolean;
ssmPaths?: string[];
ssmMaxParams?: number;
envFilePath?: string;
ssmPaths?: string[];
allowUnknownVariables?: boolean;
}
{
"name": "@coast/dynamic-config",
"version": "1.4.1",
"version": "1.4.2",
"main": "index.js",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc