ac-awssecrets 2.0.0 → 2.0.2

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/index.js +6 -11
  3. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ <a name="2.0.2"></a>
2
+
3
+ ## [2.0.2](https://github.com/admiralcloud/ac-awssecrets/compare/v2.0.1..v2.0.2) (2023-05-14 14:26:17)
4
+
5
+
6
+ ### Bug Fix
7
+
8
+ * **App:** Improved speed using only 2 credential providers | MP | [26c4c6ac703b9125fb72fcc14d4495f1bc4ac378](https://github.com/admiralcloud/ac-awssecrets/commit/26c4c6ac703b9125fb72fcc14d4495f1bc4ac378)
9
+ Use only 2 credential providers as defined in ac-aws-customcredentialprovider. This way starting apps is much faster
10
+ Related issues: [/issues#undefined](https://github.com//issues/undefined)
11
+ <a name="2.0.1"></a>
12
+
13
+ ## [2.0.1](https://github.com/admiralcloud/ac-awssecrets/compare/v2.0.0..v2.0.1) (2023-05-12 16:00:19)
14
+
15
+
16
+ ### Bug Fix
17
+
18
+ * **App:** Use AWS_PROFILE instead of profile | MP | [5b0c1ce8413d22a88de870ff46c080019c2d795e](https://github.com/admiralcloud/ac-awssecrets/commit/5b0c1ce8413d22a88de870ff46c080019c2d795e)
19
+ Use AWS_PROFILE and the built-in session management from AWS SDK
20
+ Related issues: [/issues#undefined](https://github.com//issues/undefined)
1
21
  <a name="2.0.0"></a>
2
22
 
3
23
  # [2.0.0](https://github.com/admiralcloud/ac-awssecrets/compare/v1.1.6..v2.0.0) (2023-02-26 11:45:48)
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
- const { SecretsManagerClient, GetSecretValueCommand } = require("@aws-sdk/client-secrets-manager");
2
- const { fromIni } = require("@aws-sdk/credential-providers")
1
+ const { SecretsManagerClient, GetSecretValueCommand } = require('@aws-sdk/client-secrets-manager')
2
+ const customCredentialProvider = require('ac-aws-customcredentialprovider')
3
3
 
4
- const testConfig = require('./test/config')
4
+ const testConfig = require('./test/config');
5
5
 
6
6
  /**
7
7
  * Replaces configuration variables with secrets
@@ -32,17 +32,12 @@ const awsSecrets = () => {
32
32
 
33
33
 
34
34
  const functionName = 'ac-awsSecrets'.padEnd(15)
35
- const loadSecrets = async({ secrets = [], multisecrets = [], config = {}, profile = process.env['profile'], testMode = 0, debug = false } = {}) => {
35
+ const loadSecrets = async({ secrets = [], multisecrets = [], config = {}, testMode = 0, debug = false } = {}) => {
36
36
  const environment = config?.environment || 'development'
37
37
 
38
38
  const awsConfig = {
39
- region: 'eu-central-1'
40
- }
41
- // credentials are determined from Lambda role.
42
- // But you can also use a set profile
43
- if (profile) {
44
- console.error('%s | Using AWS profile | %s', functionName, profile)
45
- awsConfig.credentials = fromIni({ profile })
39
+ region: 'eu-central-1',
40
+ credentials: customCredentialProvider({ localDevelopment: config.localDevelopment, debug: true })
46
41
  }
47
42
  const client = new SecretsManagerClient(awsConfig)
48
43
 
package/package.json CHANGED
@@ -3,13 +3,13 @@
3
3
  "author": "Mark Poepping (https://www.admiralcloud.com)",
4
4
  "license": "MIT",
5
5
  "repository": "admiralcloud/ac-awssecrets",
6
- "version": "2.0.0",
6
+ "version": "2.0.2",
7
7
  "dependencies": {
8
- "@aws-sdk/client-secrets-manager": "^3.279.0",
9
- "@aws-sdk/credential-providers": "^3.279.0"
8
+ "@aws-sdk/client-secrets-manager": "^3.332.0",
9
+ "ac-aws-customcredentialprovider": "^0.1.0"
10
10
  },
11
11
  "devDependencies": {
12
- "ac-semantic-release": "^0.3.5",
12
+ "ac-semantic-release": "^0.4.1",
13
13
  "chai": "^4.3.7",
14
14
  "eslint": "8.x",
15
15
  "mocha": "^10.2.0",