Files
harmony/fleet/harmony-fleet-auth/Cargo.toml
Jean-Gabriel Gill-Couture 4194baacad refactor(fleet): extract NATS credential plumbing into harmony-fleet-auth
The agent's `credentials.rs` + `CredentialsSection` enum graduate
into a workspace crate (`fleet/harmony-fleet-auth/`) so the
operator can consume the same code path. Single struct, single
factory, single auth-callback wiring. The only thing that varies
between consumers is where the `[credentials]` TOML bytes come
from — the agent reads them from a config file on disk, the
operator (next commit) will read them from an env var.

Public surface of the new crate:
  CredentialsSection                    — the deserializable
  CredentialSource / NatsCredential     — the runtime objects
  MachineKeyFile / CachedToken          — helper types
  credential_source_from_config         — factory
  connect_options_with_credentials      — async-nats wiring

Agent consumes via `pub use harmony_fleet_auth::CredentialsSection`
in its own `config.rs` so existing call sites keep working.
Existing 5 tests in the new crate + 7 in the agent all green.

This commit is structurally a move; behavior unchanged. Operator
wiring, additional unit tests, and the JWT-mint refactor (split
build_assertion / build_scope / build_token_url for testability)
follow in the next commits.
2026-05-05 01:48:42 -04:00

26 lines
718 B
TOML

[package]
name = "harmony-fleet-auth"
edition = "2024"
version.workspace = true
readme.workspace = true
license.workspace = true
description = "Shared NATS credential plumbing for the fleet agent + operator (Zitadel JWT-bearer + dev-only username/password)"
[lib]
path = "src/lib.rs"
[dependencies]
async-nats = { workspace = true }
anyhow = { workspace = true }
chrono = { workspace = true }
jsonwebtoken = "9"
reqwest = { workspace = true }
serde = { workspace = true, features = ["derive"] }
tokio = { workspace = true, features = ["sync"] }
tracing = { workspace = true }
serde_json = { workspace = true }
[dev-dependencies]
toml = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt"] }