Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/swarm-nats-auth/Cargo.toml
atlas e7dbb94f28 swarm-agent-verify: lift the agent-token store check out of swarm-nats-auth
`CredentialSource`, `Store` and `verify` move from swarm-nats-auth's
`agent_token` module into a small library crate, so a second verifier
can make the same check: the secret in a `swarm-agent.<agent>.<secret>`
token equals the one stored at `swarm/agents/<agent>/queue`, read under
the verifier's own certificate.

`verify` now takes its timeout as an argument; swarm-nats-auth passes
`INTROSPECTION_TIMEOUT` as before. No behaviour change. The store-denial
tests moved with the code; swarm-nats-auth keeps the ones that go
through its policy and its bound.

Part of #4459.
2026-10-13 08:38:05 +02:00

58 lines
2.4 KiB
TOML

[package]
name = "swarm-nats-auth"
version.workspace = true
readme = "README.md"
edition.workspace = true
[[bin]]
name = "swarm-nats-auth"
path = "src/main.rs"
[dependencies]
anyhow.workspace = true
async-nats.workspace = true
clap.workspace = true
# base64url for decoding the inbound request JWT.
data-encoding.workspace = true
# StreamExt::next on the subscription: async-nats returns a Stream.
futures-util.workspace = true
# `xkeys` for the callout xkey: opening sealed requests and sealing replies.
nkeys = { workspace = true, features = ["xkeys"] }
reqwest.workspace = true
serde.workspace = true
serde_json.workspace = true
# The jti digest: base32hex(sha256(claims)) over every JWT this crate signs.
sha2.workspace = true
# For `status::BUCKET` and `notices::STREAM` - the subjects a hive may
# publish to are derived from these names, and every end that touches them
# must agree on the same one. Deliberately WITHOUT the `kv` feature: this
# crate derives subject strings, it never opens the bucket. `notices`
# is name-only too (no `jetstream`/`kv` surface), same reason.
swarm-queue-client = { workspace = true, features = ["notices"] }
# The store reads: the callout keys, its own OIDC secret, and the agent
# credentials `swarm-agent-verify` checks a presented token against.
swarm-secret-client.workspace = true
swarm-agent-verify.workspace = true
tokio.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
[dev-dependencies]
# A loopback stand-in `IdP` for `oidc_secret`'s test of a non-2xx
# introspection starting the re-read.
axum.workspace = true
# A TEST ORACLE, not part of the production path. Neither JWT this crate emits
# is expressible through it - `Claims` has no `aud`, which the response wrapper
# needs (the server id) and the user token needs (the account name), and
# `Token::new_user` always sets `issuer_account`, which a non-operator server
# rejects outright. So both are hand-built, and this crate is what the encoder
# is checked *against*: `respond::tests::hand_built_matches_the_reference`
# builds a user token both ways and requires byte equality, on the one shape
# nats-jwt does model.
nats-jwt.workspace = true
# `test-util` for `#[tokio::test(start_paused = true)]`: `oidc_secret`'s tests
# run a re-read slower than the introspection budget on paused time.
tokio = { workspace = true, features = ["test-util"] }
[lints]
workspace = true