omnigraph/crates/omnigraph-cli/tests
aaltshuler a819ab500e feat(cli): keyed credentials — servers:, the token chain, login/logout (RFC-007 PR 2)
The operator config gains servers: (name -> url; never a token). A remote
command whose URL prefix-matches an operator server resolves its bearer
token through the keyed chain first — OMNIGRAPH_TOKEN_<NAME> env, then the
[<name>] section of ~/.omnigraph/credentials (created 0600 via temp+rename,
#139 finding 7; group/world-readable files refused loudly) — falling
through to the legacy chain unchanged. URL keying makes §D5 rule 3
structural: a token is only ever sent to the server it is keyed to.
Longest-prefix matching with a path-boundary check (http://h:8080 never
matches http://h:8080-evil). Inserting the keyed hop above the legacy chain
is safe by construction — no existing setup can have servers: defined.

omnigraph login <name> stores/rotates one section (token from --token or
one stdin line — the pipe flow keeps secrets out of shell history);
omnigraph logout removes it, idempotently; logging in before declaring the
server warns instead of failing (the gh model).

Coverage: URL-match/no-substring-trap, credentials round-trip preserving
sibling sections, 0600 write + over-permissive refusal, env-name mapping;
the legacy resolve test is now hermetic against a real ~/.omnigraph and
asserts byte-identical legacy behavior with no servers defined; one
spawned-binary e2e walks the whole lifecycle against an authed server:
refusal -> wrong-token login (stdin) -> rotate (--token) -> authorized read
-> env-beats-file -> non-matching-URL negative -> logout revokes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 21:24:51 +03:00
..
support feat(cli): keyed credentials — servers:, the token chain, login/logout (RFC-007 PR 2) 2026-06-11 21:24:51 +03:00
cli_cluster.rs feat(cli): the operator config surface — identity and output defaults (RFC-007 PR 1) 2026-06-11 20:29:02 +03:00
cli_cluster_e2e.rs refactor(cli): split the test monolith into command-area suites 2026-06-11 15:16:51 +03:00
cli_data.rs feat(cli): the operator config surface — identity and output defaults (RFC-007 PR 1) 2026-06-11 20:29:02 +03:00
cli_queries.rs refactor(cli): split the test monolith into command-area suites 2026-06-11 15:16:51 +03:00
cli_schema_config.rs refactor(cli): split the test monolith into command-area suites 2026-06-11 15:16:51 +03:00
system_local.rs feat(cli): keyed credentials — servers:, the token chain, login/logout (RFC-007 PR 2) 2026-06-11 21:24:51 +03:00
system_remote.rs feat(cli)!: unified load command; deprecate ingest as an alias 2026-06-11 04:18:00 +03:00