vvauth 2.0.4 → 2.1.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.
- package/.github/workflows/publish-npm.yml +22 -0
- package/README.md +12 -1
- package/index.js +3 -2
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: publish-npm
|
|
2
|
+
on:
|
|
3
|
+
create:
|
|
4
|
+
tags:
|
|
5
|
+
- 'v*'
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
id-token: write
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish-npm:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version: '24.x'
|
|
19
|
+
registry-url: 'https://registry.npmjs.org'
|
|
20
|
+
- run: npm install
|
|
21
|
+
- run: npm run eslint
|
|
22
|
+
- run: npm publish
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ vauth configuration file is a simple yaml file with a specific macro expansion s
|
|
|
18
18
|
The configuration file should abide the following schema
|
|
19
19
|
|
|
20
20
|
### configuration macro expansion set
|
|
21
|
-
* $${profile.XXX} expand to vault entity metadata and user `.vauth_database` vars
|
|
21
|
+
* $${profile.XXX} expand to vault entity metadata and user `.vauth_database` vars
|
|
22
22
|
* $${env.XXX} expand to local environement vars
|
|
23
23
|
* $${secrets.XXX} expand to remote scrapped secrets (see the env.paths)
|
|
24
24
|
|
|
@@ -49,3 +49,14 @@ env:
|
|
|
49
49
|
# Credits
|
|
50
50
|
* [Francois Leurent](https://github.com/131)
|
|
51
51
|
|
|
52
|
+
|
|
53
|
+
# Machine-readable environment
|
|
54
|
+
|
|
55
|
+
`vauth env --ir://json` resolves the same environment as `vauth env --source`
|
|
56
|
+
and asks the `cnyks` runner to write one JSON object to stdout. Diagnostic
|
|
57
|
+
messages remain on stderr, so a caller can parse stdout directly.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
vauth env --ir://json
|
|
61
|
+
```
|
|
62
|
+
|
package/index.js
CHANGED
|
@@ -86,7 +86,7 @@ class vvauth {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
this.VAULT_ADDR = this.rc.vault_addr; //might be null
|
|
89
|
+
this.VAULT_ADDR = this.rc.vault_addr || process.env.VAULT_ADDR; //might be null
|
|
90
90
|
this.VAULT_TOKEN = process.env.VAULT_TOKEN;
|
|
91
91
|
|
|
92
92
|
if(this.VAULT_ADDR)
|
|
@@ -372,7 +372,8 @@ const shellEscape = (arg) => {
|
|
|
372
372
|
//ensure module is called directly, i.e. not required
|
|
373
373
|
if(module.parent === null) {
|
|
374
374
|
let cmd = args.shift();
|
|
375
|
-
|
|
375
|
+
const output = process.argv.includes('--ir://json') ? '--ir://json' : '--ir://raw';
|
|
376
|
+
require('cnyks/lib/bundle')(vvauth, null, cmd ? [`--ir://run=${cmd}`, output] : []);
|
|
376
377
|
}
|
|
377
378
|
|
|
378
379
|
module.exports = vvauth;
|