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.
23 lines
719 B
TOML
23 lines
719 B
TOML
[package]
|
|
name = "harmony-fleet-agent"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
rust-version = "1.85"
|
|
|
|
[dependencies]
|
|
harmony-fleet-auth = { path = "../harmony-fleet-auth" }
|
|
harmony-reconciler-contracts = { path = "../../harmony-reconciler-contracts" }
|
|
harmony = { path = "../../harmony", default-features = false, features = ["podman"] }
|
|
async-nats = { workspace = true }
|
|
async-trait = { workspace = true }
|
|
chrono = { workspace = true }
|
|
futures-util = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
tokio = { workspace = true }
|
|
tracing = { workspace = true }
|
|
tracing-subscriber = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
clap = { workspace = true }
|
|
toml = { workspace = true }
|