@wavo-cloud/aws-secrets-manager-helper 0.3.1 → 0.4.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.
@@ -1,81 +1,81 @@
1
- version: 2.1
2
- orbs:
3
- codecov: codecov/codecov@1.1.3
4
- jobs:
5
- test:
6
- docker:
7
- - image: circleci/node:12.13
1
+ # version: 2.1
2
+ # orbs:
3
+ # codecov: codecov/codecov@1.1.3
4
+ # jobs:
5
+ # test:
6
+ # docker:
7
+ # - image: circleci/node:12.13
8
8
 
9
- steps:
10
- - checkout
11
- - setup_remote_docker
9
+ # steps:
10
+ # - checkout
11
+ # - setup_remote_docker
12
12
 
13
- - run:
14
- name: Adding NPM credentials
15
- command: |
16
- if [ ! -z "${WAVO_CLOUD_READ_NPM_TOKEN}" ]; then
17
- echo "//registry.npmjs.org/:_authToken=$WAVO_CLOUD_READ_NPM_TOKEN" > ~/.npmrc
18
- else
19
- echo "Error: WAVO_CLOUD_READ_NPM_TOKEN not found."
20
- false
21
- fi
13
+ # - run:
14
+ # name: Adding NPM credentials
15
+ # command: |
16
+ # if [ ! -z "${WAVO_CLOUD_READ_NPM_TOKEN}" ]; then
17
+ # echo "//registry.npmjs.org/:_authToken=$WAVO_CLOUD_READ_NPM_TOKEN" > ~/.npmrc
18
+ # else
19
+ # echo "Error: WAVO_CLOUD_READ_NPM_TOKEN not found."
20
+ # false
21
+ # fi
22
22
 
23
- # Download and cache dependencies
24
- - restore_cache: &restore_cache
25
- keys:
26
- - v1-dependencies-{{ checksum "package.json" }}
27
- # fallback to using the latest cache if no exact match is found
28
- - v1-dependencies-
23
+ # # Download and cache dependencies
24
+ # - restore_cache: &restore_cache
25
+ # keys:
26
+ # - v1-dependencies-{{ checksum "package.json" }}
27
+ # # fallback to using the latest cache if no exact match is found
28
+ # - v1-dependencies-
29
29
 
30
- - run: yarn install
30
+ # - run: yarn install
31
31
 
32
- - save_cache:
33
- paths:
34
- - node_modules
35
- key: v1-dependencies-{{ checksum "package.json" }}
32
+ # - save_cache:
33
+ # paths:
34
+ # - node_modules
35
+ # key: v1-dependencies-{{ checksum "package.json" }}
36
36
 
37
- # run tests!
38
- - run:
39
- name: Run tests (if possible)
40
- command: |
41
- if ./node_modules/@wavo-cloud/generator-microservice/shared/util/test-checks.sh; then
42
- yarn ci-test
43
- fi
44
- - codecov/upload:
45
- file: '/home/circleci/project/coverage/coverage-final.json'
46
- token: 91eab9ce-01c7-4429-b973-470e75b73de7
37
+ # # run tests!
38
+ # - run:
39
+ # name: Run tests (if possible)
40
+ # command: |
41
+ # if ./node_modules/@wavo-cloud/generator-microservice/shared/util/test-checks.sh; then
42
+ # yarn ci-test
43
+ # fi
44
+ # - codecov/upload:
45
+ # file: '/home/circleci/project/coverage/coverage-final.json'
46
+ # token: 91eab9ce-01c7-4429-b973-470e75b73de7
47
47
 
48
- module-push:
49
- docker:
50
- - image: circleci/node:12.13
48
+ # module-push:
49
+ # docker:
50
+ # - image: circleci/node:12.13
51
51
 
52
- steps:
53
- - checkout
52
+ # steps:
53
+ # - checkout
54
54
 
55
- - restore_cache: *restore_cache
55
+ # - restore_cache: *restore_cache
56
56
 
57
- - run:
58
- name: Deploy (if possible)
59
- command: |
60
- if [ ! -z "${WAVO_CLOUD_WRITE_NPM_TOKEN}" ]; then
61
- echo "//registry.npmjs.org/:_authToken=$WAVO_CLOUD_WRITE_NPM_TOKEN" > .npmrc
62
- npm whoami
63
- npm publish
64
- else
65
- echo "WAVO_CLOUD_WRITE_NPM_TOKEN not found. Skipping generator module push."
66
- fi
57
+ # - run:
58
+ # name: Deploy (if possible)
59
+ # command: |
60
+ # if [ ! -z "${WAVO_CLOUD_WRITE_NPM_TOKEN}" ]; then
61
+ # echo "//registry.npmjs.org/:_authToken=$WAVO_CLOUD_WRITE_NPM_TOKEN" > .npmrc
62
+ # npm whoami
63
+ # npm publish
64
+ # else
65
+ # echo "WAVO_CLOUD_WRITE_NPM_TOKEN not found. Skipping generator module push."
66
+ # fi
67
67
 
68
- workflows:
69
- version: 2
70
- test-and-deploy:
71
- jobs:
72
- - test:
73
- context: org-global
74
- - module-push:
75
- context: org-global
76
- requires:
77
- - test
68
+ # workflows:
69
+ # version: 2
70
+ # test-and-deploy:
71
+ # jobs:
72
+ # - test:
73
+ # context: org-global
74
+ # - module-push:
75
+ # context: org-global
76
+ # requires:
77
+ # - test
78
78
 
79
- filters:
80
- branches:
81
- only: master
79
+ # filters:
80
+ # branches:
81
+ # only: master
@@ -0,0 +1,54 @@
1
+ name: Build and Push NPM Package to NPM Repository
2
+
3
+ on:
4
+ push:
5
+ branches: [ "master" ]
6
+
7
+ # Permission can be added at job level or workflow level
8
+ permissions:
9
+ id-token: write # This is required for requesting the JWT
10
+ contents: read # This is required for actions/checkout
11
+
12
+ jobs:
13
+ build_and_push_package:
14
+ name: Build and Push NPM Package to NPM Repository
15
+ runs-on: ubuntu-latest
16
+ defaults:
17
+ run:
18
+ shell: bash
19
+
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v4
23
+
24
+ - uses: actions/setup-node@v4
25
+ with:
26
+ node-version: 20
27
+
28
+ - name: Import Secrets from Hashicorp Vault
29
+ id: import-secrets
30
+ uses: hashicorp/vault-action@v3
31
+ with:
32
+ url: https://vault.cloud.wavo.me:8200
33
+ path: github_actions
34
+ method: approle
35
+ roleId: ${{ secrets.VAULT_ROLE_ID }}
36
+ secretId: ${{ secrets.VAULT_SECRET_ID }}
37
+ secrets: |
38
+ foundation/data/npm/circleci WAVO_CLOUD_WRITE_NPM_TOKEN | WAVO_CLOUD_WRITE_NPM_TOKEN ;
39
+
40
+ - name: Adding NPM credentials
41
+ env:
42
+ WAVO_CLOUD_WRITE_NPM_TOKEN: ${{ steps.import-secrets.outputs.WAVO_CLOUD_WRITE_NPM_TOKEN }}
43
+ run: |
44
+ if [ ! -z "${WAVO_CLOUD_WRITE_NPM_TOKEN}" ]; then
45
+ echo "//registry.npmjs.org/:_authToken=$WAVO_CLOUD_WRITE_NPM_TOKEN"> ~/.npmrc
46
+ else
47
+ echo "Error: WAVO_CLOUD_WRITE_NPM_TOKEN not found."
48
+ false
49
+ fi
50
+
51
+ - name: Publish NPM Package
52
+ run: |
53
+ npm whoami
54
+ npm publish
package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # Changelog
2
+
3
+ ## 0.4.0 - (2024-08-29)
4
+ ### Features
5
+ - Migrate CircleCI pipeline to Github Actions
6
+
7
+ 0.3.2
8
+ -----
9
+ - fixed getAllClientSecrets
10
+
1
11
  0.3.0
2
12
  -----
3
13
  - update aws-sdk
@@ -148,7 +148,7 @@ async function getAllClientSecrets(
148
148
  clientSecret.organization &&
149
149
  clientSecret.region &&
150
150
  !clientSecret.error &&
151
- (!activeOnly || clientSecret.isActiveOrganization)
151
+ (!activeOnly || clientSecret.isActiveOrganization === 'true')
152
152
  )
153
153
  return true
154
154
  return false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavo-cloud/aws-secrets-manager-helper",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Wavo Cloud Infallible AWS Secrets Manager Helper",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {