vvauth 2.5.0 → 2.6.1

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,8 +1,5 @@
1
1
  name: publish-npm
2
- on:
3
- create:
4
- tags:
5
- - 'v*'
2
+ on: create
6
3
 
7
4
  permissions:
8
5
  id-token: write
@@ -10,6 +7,7 @@ permissions:
10
7
 
11
8
  jobs:
12
9
  publish-npm:
10
+ if: github.event.ref_type == 'tag' && startsWith(github.event.ref, 'v')
13
11
  runs-on: ubuntu-latest
14
12
  steps:
15
13
  - uses: actions/checkout@v4
@@ -25,6 +25,8 @@ jobs:
25
25
  os: [ubuntu-latest, windows-latest]
26
26
  runs-on: ${{ matrix.os }}
27
27
  steps:
28
+ # Windows runners ship Git with core.autocrlf=true, which would turn LF sources into CRLF
29
+ - run: git config --global core.autocrlf false
28
30
  - uses: actions/checkout@v4
29
31
  - uses: actions/setup-go@v5
30
32
  with:
@@ -36,3 +38,16 @@ jobs:
36
38
  if: runner.os == 'Linux'
37
39
  - run: go build ./cmd/vauth
38
40
  if: runner.os == 'Windows'
41
+
42
+ runtime-node16:
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+ - uses: actions/setup-node@v4
47
+ with:
48
+ node-version: '16.x'
49
+ - run: npm install --omit=dev --ignore-scripts --no-audit
50
+ - run: |
51
+ node --check index.js
52
+ node --check cmd/vauth.js
53
+ node cmd/vauth.js version
@@ -0,0 +1,133 @@
1
+ # API, CLI and verification
2
+
3
+ Node and Go implement the same authentication/profile/environment behavior.
4
+ Constructors, errors and return types stay native to each language. Their CLI
5
+ contracts differ except for the shared calls below.
6
+
7
+ ## Shared calls
8
+
9
+ ```bash
10
+ vauth env --ir://json
11
+ venv
12
+ venv --renew
13
+ venv --gitlab
14
+ ```
15
+
16
+ `env --ir://json` writes one JSON object to stdout, with diagnostics on stderr.
17
+ JSON key order and final whitespace are not significant. `venv` sources
18
+ `vauth env --source "$@"`; renewal forces authentication. GitLab initialization
19
+ publishes only four `CI_PROJECT_*` exports, without login, cache or file writes.
20
+
21
+ ## Node CLI — cnyks
22
+
23
+ ```text
24
+ vauth <command> [--parameter=value] [--ir://json | --ir://raw]
25
+ ```
26
+
27
+ The first positional selects the command; remaining method arguments are named
28
+ flags, not positional remapping. Aliases expose `env`, `login`, `show`, `set`,
29
+ `unset`, `dotenv`, `install`, `version` and `gitlab`. `Connect` remains a hidden
30
+ SDK operation; cnyks retains its namespaced `vauth:Connect` entry, not a
31
+ short `Connect`/`connect` alias. cnyks also reflects other public
32
+ methods; its interactive rendering is not the Go CLI contract.
33
+
34
+ | Command | Parameters | Effect |
35
+ | --- | --- | --- |
36
+ | `env` | `--source`, `--renew`, `--gitlab` | Resolve environment, export it, or initialize GitLab variables |
37
+ | `login` | `--source`, `--renew` | Authentication only; optionally export only VAULT_TOKEN |
38
+ | `show` | — | Merged profile/private database |
39
+ | `set` | `--k=KEY --v=VALUE` | Store an upper-cased private key |
40
+ | `unset` | `--k=KEY` | Remove a private key |
41
+ | `dotenv` | — | Resolved K=v output |
42
+ | `install` | — | Install the venv shell function |
43
+ | `version` | — | Package version |
44
+ | `gitlab` | — | Only CI_PROJECT_* exports |
45
+
46
+ The executable is `cmd/vauth.js`; `index.js` only exports the SDK. Use
47
+ `--ir://json` for machine-readable return values. `env` selects raw cnyks output
48
+ when JSON was not requested, so sourcing does not show the runner menu.
49
+
50
+ ## Go CLI — native
51
+
52
+ ```text
53
+ vauth <command> [positionals...] [--flag=value] [--ir://json]
54
+ ```
55
+
56
+ Commands are `env`, `login`, `show`, `set`, `unset`, `dotenv`, `install`, `version`
57
+ and `gitlab`. `set KEY VALUE` / `unset KEY` also accept `--k` / `--v`. Boolean
58
+ flags accept true, false, 0 and empty forms. `env` supports source, renew and
59
+ gitlab flags; `login` supports source and renew. Hidden `connect` remains
60
+ available for token-only callers. No command runner is part of this API.
61
+
62
+ Objects are JSON, strings are raw without JSON mode, and version is one line.
63
+ Exit is zero on success and one on failure; errors go to stderr.
64
+
65
+ ## SDK
66
+
67
+ ```js
68
+ const Vauth = require('vvauth');
69
+ const client = new Vauth();
70
+ const token = await client.Connect(renew);
71
+ const env = await client.Env(source, renew, gitlab);
72
+ await client.Login(source, renew);
73
+ const profile = await client.Show();
74
+ await client.Set(key, value);
75
+ await client.Unset(key);
76
+ await client.Gitlab();
77
+ ```
78
+
79
+ ```go
80
+ client, err := vvauth.New()
81
+ token, err := client.Connect(renew)
82
+ env, err := client.Env(renew)
83
+ err = client.Login(source, renew)
84
+ profile, err := client.Show()
85
+ err = client.Set(key, value)
86
+ err = client.Unset(key)
87
+ err = client.Gitlab()
88
+ ```
89
+
90
+ `Connect`, `LookupSelf`, `Request`, immutable `RC` and address/token readers
91
+ belong to vauth-login. vvauth owns `Config`/`config`, profiles, KV operations,
92
+ macro expansion, shell publication and GitLab initialization. Constructors
93
+ check required CI variables when `env.gitlab` is true; explicit initialization
94
+ bypasses that prerequisite. There is no Git inference at construction.
95
+
96
+ RC is the complete raw configuration; environment sections are copied before
97
+ macro expansion. Go snapshot maps do not retain YAML key order. Both support
98
+ SSH-agent-backed local secret decryption, inherited tokens and forced renewal.
99
+ `env.map` names must be valid environment names. Values become strings; null
100
+ becomes empty, and objects/arrays are rejected, including macro results. Raw RC
101
+ values retain their JSON types. Missing Git identity fields export empty values.
102
+
103
+ Go macro expansion and value walking come from `github.com/131/nyks/v6`.
104
+ Configuration operates on JSON-compatible values rather than round-tripping
105
+ RC through a YAML tree. Walking preserves keys and the raw RC snapshot;
106
+ `env.map` validation and scalar-to-string conversion remain in vvauth.
107
+
108
+ ## Configuration trust boundary
109
+
110
+ The selected configuration controls exported variable names/values and which
111
+ local armored files are decrypted. Name validation enforces shell syntax,
112
+ not a variable allowlist. Review and trust a project configuration before
113
+ sourcing it with `venv`; this tool is not a sandbox for hostile configurations.
114
+ The Vault-origin guard checks authentication destinations, not every effect
115
+ of the environment exported into the calling shell.
116
+
117
+ ## Verification
118
+
119
+ ```bash
120
+ npm install
121
+ npm run eslint
122
+ npm test
123
+ go vet ./...
124
+ go test -race ./...
125
+ GOOS=windows GOARCH=amd64 go build ./cmd/vauth
126
+ ```
127
+
128
+ Tests use disposable SSH keys/agents, temporary configuration and loopback
129
+ Vault fixtures; they do not require real credentials. Differential checks cover
130
+ profile/KV operations, renewal, trust refusal, local secrets, configuration,
131
+ JSON environment output and the shared armor/cache. Linux/Windows builds and
132
+ Node 16 parsing/loading are checked separately. Release CI publishes npm,
133
+ Go tags and signed Windows/Linux binaries; verify asset checksums independently.
package/README.md CHANGED
@@ -1,94 +1,100 @@
1
- Vault Creds manager
1
+ # vvauth
2
2
 
3
- This projects helps you log yourself in a HCL vault and retrieve VAULT_TOKEN through different auth methods
4
- * jwt login
5
- * ssh (with agent) login
3
+ Resolve a shell environment from your Vault identity, private settings and
4
+ secrets. [vauth-login](https://github.com/131/vauth-login) owns authentication,
5
+ HTTP and token caching; [ssh-agent-crypt](https://github.com/131/ssh-agent-crypt)
6
+ protects local secrets. Node and Go are canonical implementations.
6
7
 
8
+ ## Install
7
9
 
8
- # Vauth configuration
9
- ## Vauth configuration file location
10
- vauth configuration file lies on a `.vauthrc` file (this name can be controlled by the VAUTHRC env var).
11
- vauth will try to find
12
- * if specified, the VAUTHRC file
13
- * fallback to a .vauthrc file in the current directory
14
- * fallback to a .vauthrc file in the current user home directory
10
+ ```bash
11
+ npm install -g vvauth
12
+ go install github.com/131/vvauth/v2/cmd/vauth@latest
13
+ ```
15
14
 
16
- ## Vauth configuration format
17
- vauth configuration file is a simple yaml file with a specific macro expansion syntax for dynamic parts.
18
- The configuration file should abide the following schema
15
+ Native Linux and signed Windows binaries, with checksums, are available from
16
+ [GitHub Releases](https://github.com/131/vvauth/releases).
19
17
 
20
- ### configuration macro expansion set
21
- * $${profile.XXX} expand to vault entity metadata and user `.vauth_database` vars
22
- * $${env.XXX} expand to local environement vars
23
- * $${secrets.XXX} expand to remote scrapped secrets (see the env.paths)
18
+ ## Load the environment
24
19
 
20
+ ```bash
21
+ vauth install
22
+ source ~/.bashrc
23
+ venv
24
+ venv --renew
25
25
  ```
26
- # vauth URL
27
- vault_addr: https://vauth.myserver.org
28
26
 
29
- # for vauth-auth-plugin-ssh, configure the binding role here
27
+ `venv` sources the exports produced by `vauth env --source`. `--renew` forces
28
+ fresh authentication. For a machine-readable result:
29
+
30
+ ```bash
31
+ vauth env --ir://json
32
+ ```
33
+
34
+ Both implementations write one JSON object to stdout; diagnostics remain on
35
+ stderr. Node uses cnyks for its CLI; Go has a native command interface.
36
+ [API_and_tests.md](API_and_tests.md) defines both contracts.
37
+
38
+ ## Configuration
39
+
40
+ The first existing configuration is selected: `VAUTHRC`, `./.vauthrc`, then
41
+ `~/.vauthrc`. It is YAML; `VAULT_ADDR` supplies the address fallback.
42
+
43
+ ```yaml
44
+ vault_addr: https://vault.example.test
30
45
  ssh_auth:
31
46
  role: $${env.VAUTH_USER_LOGIN}
32
47
  env:
33
48
  map:
34
49
  TF_HTTP_USERNAME: $${profile.VAUTH_USER_LOGIN}
35
50
  TF_HTTP_PASSWORD: $${profile.GITLAB_API_TOKEN}
36
- AWS_ACCESS_KEY_ID: $${secrets.AWS_ACCESS_KEY_ID}
37
51
  AWS_SECRET_ACCESS_KEY: $${secrets.AWS_SECRET_ACCESS_KEY}
38
-
39
- # remote secrets mecanism
40
- # set the secrets mount point - default to secrets
41
- [path: secrets]
42
- # list extra secrets to be reached and populated into the $${secrets.XXX} macro
52
+ path: secrets
43
53
  paths:
44
- - /some/pa4-backend.creds
45
-
54
+ - /some/backend.creds
46
55
  ```
47
56
 
57
+ Macros read local `env`, Vault `profile` (entity metadata and the user's
58
+ `.vauth_database`), or collected `secrets`. `env.git` supplies Git author and
59
+ committer fields. A `ssh-agent-crypt` section can supply local encrypted secrets
60
+ without contacting Vault when no SSH/JWT authentication is configured.
48
61
 
49
- # Installation
62
+ With `env.gitlab: true`, project variables must already exist in the shell.
63
+ Initialize them explicitly from `origin`:
50
64
 
51
65
  ```bash
52
- npm install -g vvauth # node
53
- go install github.com/131/vvauth/v2/cmd/vauth@latest # go
66
+ venv --gitlab
54
67
  ```
55
68
 
56
- Both ship the same `vauth` command, flags and `.vauthrc`, and share the token
57
- cache. The Go binary has no runtime dependency; signed `vauth-windows-amd64.exe`
58
- and `vauth-linux-amd64` builds are attached to each
59
- [release](https://github.com/131/vvauth/releases). `vauth version` prints the
60
- build version.
61
-
62
- On Windows, the SSH agent is `SSH_AUTH_SOCK` when set, else Pageant (≥ 0.75,
63
- named pipe autodiscovery), else the OpenSSH agent pipe.
64
-
65
-
66
- # Credits
67
- * [Francois Leurent](https://github.com/131)
68
-
69
+ This exports only `CI_PROJECT_PATH`, `CI_PROJECT_NAME`, `CI_PROJECT_NAMESPACE`
70
+ and `CI_PROJECT_PATH_SLUG`. It does not authenticate or modify configuration.
69
71
 
70
- # Machine-readable environment
71
-
72
- `vauth env --ir://json` resolves the same environment as `vauth env --source`
73
- and asks the `cnyks` runner to write one JSON object to stdout. Diagnostic
74
- messages remain on stderr, so a caller can parse stdout directly.
75
-
76
- ```bash
77
- vauth env --ir://json
78
- ```
72
+ ## Tokens and trust
79
73
 
74
+ An inherited `VAULT_TOKEN` is reused offline. Otherwise, vauth-login handles
75
+ login and the SSH-agent-encrypted cache in `~/.vauth/tokens`. `token_cache: false`
76
+ disables disk caching. SSH uses `SSH_AUTH_SOCK`, or native Windows Pageant/OpenSSH
77
+ pipe discovery. Review a project-selected Vault before vouching for it in the
78
+ home configuration or environment.
80
79
 
81
- # Token cache
80
+ Review and trust the project configuration before sourcing it. It controls
81
+ the exported environment and local file decryption; the Vault-address check
82
+ is not a sandbox for hostile configuration files.
82
83
 
83
- Tokens are cached in `~/.vauth/tokens/<session>.creds`, isolated by Vault and
84
- authentication. Tokens are reused, renewed within their lease’s final third, or
85
- replaced when expired. Existing `VAULT_TOKEN` takes precedence over cached tokens.
84
+ Tokens and resolved secrets are credentials: do not log them or store plaintext
85
+ exports. Neither implementation prompts to trust an unknown project Vault.
86
86
 
87
- Each session file is armored using `ssh-agent-crypt` and your SSH agent’s first
88
- key. Without an SSH agent, disk caching is disabled.
87
+ ## Security assessments
89
88
 
90
- Set `token_cache: false` in `.vauthrc` to disable disk cache reads and writes.
89
+ [Claude](SECURITY_AUDIT_claude-opus-5-5.md) and
90
+ [Sol](SECURITY_AUDIT_gpt-6.1-sol.md) reports identify their exact source commit,
91
+ checks and limitations. They are independent source reviews, not certification.
92
+ [Coordination and open risks](SECURITY_AUDIT_COORDINATION.md) distinguish
93
+ reviewer limitations from host validation; [provenance](SECURITY_AUDIT_PROVENANCE.json)
94
+ records the exact source, models and prompt/report hashes.
91
95
 
92
- ## Force reauthentication
96
+ ## Credits
93
97
 
94
- `venv --renew` forces authentication, generates and caches a new token.
98
+ - [Francois Leurent](https://github.com/131)
99
+ - OpenAI Codex and Anthropic Claude, in collaboration
100
+ - Code signing, courtesy of Essilor International
@@ -0,0 +1,36 @@
1
+ # Security assessment coordination
2
+
3
+ Two independent source-only reviews assess f368802700f03c8b632bbacefbfc71dbfaae04f4.
4
+ Reports are preserved verbatim; neither findings nor scores were calibrated.
5
+ Execution headers verify Claude Opus 5.5 and GPT 6.1-sol. Exact successful
6
+ inputs are maintained in the operator's SA prompt files; hashes/commands are
7
+ in SECURITY_AUDIT_PROVENANCE.json. Excluded-report/README input boundaries
8
+ were checked against the logged commands; Git hashes/filename inventory are metadata.
9
+
10
+ | Review | Coolness | Robustness | Safety |
11
+ | --- | --- | --- | --- |
12
+ | Claude Opus 5.5 | 15/20 | 13/20 | 13/20 |
13
+ | GPT 6.1-sol | 17/20 | 13/20 | 12/20 |
14
+
15
+ ## Release disposition and open boundaries
16
+
17
+ The npm job is explicitly gated on a created v* tag. Functional code and
18
+ workflow assessed here precede release-version metadata only.
19
+ Host validation independently passes 74 Node24 tests, ESLint, Go vet/race,
20
+ Node16 parsing/loading and native Windows cross-builds. Reviewers' read-only
21
+ sandboxes blocked runtime checks; that is a limitation, not evidence that
22
+ those product tests fail. Signing/checksums are checked on the actual release
23
+ artifacts, not inferred from workflow configuration.
24
+
25
+ Project configuration has broad authority over the environment and local
26
+ armored files. The high-severity untrusted-configuration finding remains an
27
+ open boundary: documentation requires reviewing/trusting configurations but
28
+ is not a technical trust gate or sandbox. Host synthetic probes confirm the
29
+ export/decrypt capability without executing exported commands or using a real
30
+ cache. No project-approval system or arbitrary variable denylist was introduced.
31
+
32
+ Other reported boundaries remain: shell-wrapper failure propagation, dotenv
33
+ encoding, concurrent KV writes, response/resource limits, mutable publication
34
+ inputs, and the declared interpolation semantics. Exact nyks behavior and
35
+ native recursion are retained; these reviews do not certify exhaustive parity
36
+ or vulnerability-database clearance. No claim is made that every finding is fixed.
@@ -0,0 +1,35 @@
1
+ {
2
+ "sourceCommit": "f368802700f03c8b632bbacefbfc71dbfaae04f4",
3
+ "date": "2026-10-25",
4
+ "method": "Fresh independent source-only codex exec sessions; no previous reports or coordinator history as inputs",
5
+ "reviews": [
6
+ {
7
+ "profile": "claude",
8
+ "actualModel": "claude-opus-5-5",
9
+ "exit": 0,
10
+ "command": "codex -p claude exec --ephemeral --sandbox read-only -c 'web_search=\"disabled\"' --output-last-message /mnt/d/tmp/tasks/FLEURENT-09/audits/f368802/claude-report.md - < /mnt/d/tmp/tasks/FLEURENT-09/audits/f368802/claude-input.txt",
11
+ "hashes": {
12
+ "input.txt": "f30a9fe080b37646dfd1c0fc18318fa6a30e1db24847b10c1240292fe63a7c1c",
13
+ "report.md": "526c89b5874b420a1229c9414e461028b2012dd5cdcc7ab7f62635841a71aade",
14
+ "exec.log": "e8187235115d563e7e9017155b34dd310970f90b746075e7242f3138440368b6"
15
+ },
16
+ "output": "SECURITY_AUDIT_claude-opus-5-5.md",
17
+ "inputExclusionsChecked": true,
18
+ "modelCheckedAgainstExecutionHeader": true
19
+ },
20
+ {
21
+ "profile": "codex",
22
+ "actualModel": "gpt-6.1-sol_codeassist",
23
+ "exit": 0,
24
+ "command": "codex exec --ephemeral --sandbox read-only -c 'web_search=\"disabled\"' --output-last-message /mnt/d/tmp/tasks/FLEURENT-09/audits/f368802/codex-report.md - < /mnt/d/tmp/tasks/FLEURENT-09/audits/f368802/codex-input.txt",
25
+ "hashes": {
26
+ "input.txt": "7617ec6debad726eed09829efbbd63a180660af91fc1f393927460193094179a",
27
+ "report.md": "60c4fc1f72df58c96ece263d1dc4d64dec619301116e7bdf459bd02f83165400",
28
+ "exec.log": "10b1ae8df60c50acf8a4cd66ce73aaa813aac583eb48304d40144186afc2becc"
29
+ },
30
+ "output": "SECURITY_AUDIT_gpt-6.1-sol.md",
31
+ "inputExclusionsChecked": true,
32
+ "modelCheckedAgainstExecutionHeader": true
33
+ }
34
+ ]
35
+ }