swarm-controller: move the secrets concern into its own module
Refs #6897
This commit is contained in:
parent
7c7c94d184
commit
6d0c0dc391
16 changed files with 35 additions and 25 deletions
|
|
@ -29,16 +29,11 @@ mod agent_commands;
|
|||
mod agent_config_repo;
|
||||
mod agent_control;
|
||||
mod agent_custom;
|
||||
mod agent_cutoff;
|
||||
mod agent_entity;
|
||||
mod agent_icon;
|
||||
mod agent_identity;
|
||||
mod agent_input;
|
||||
mod agent_limits;
|
||||
mod agent_login;
|
||||
mod agent_permissions;
|
||||
mod agent_renewal;
|
||||
mod agent_role_ttl;
|
||||
mod agent_ssh;
|
||||
mod agent_state_stream;
|
||||
mod agent_status;
|
||||
|
|
@ -46,19 +41,12 @@ mod agent_todos;
|
|||
mod agents_md;
|
||||
mod agents_md_initial;
|
||||
mod archetypes;
|
||||
mod archive_access;
|
||||
mod attic_copy;
|
||||
mod auth;
|
||||
mod backend_egress;
|
||||
mod backend_env;
|
||||
mod backend_secrets;
|
||||
mod bash_task;
|
||||
mod builder;
|
||||
mod cache_miss;
|
||||
mod claude_login;
|
||||
mod config_drift;
|
||||
mod egress_allow;
|
||||
mod egress_deny;
|
||||
mod git_forge;
|
||||
mod inference;
|
||||
mod jobq;
|
||||
|
|
@ -69,12 +57,11 @@ mod meta_flake;
|
|||
mod observability;
|
||||
mod observability_grant;
|
||||
mod pause_hold;
|
||||
mod proxy_credential;
|
||||
mod queue_identity;
|
||||
mod read_policy;
|
||||
mod review;
|
||||
mod routes;
|
||||
mod schedules;
|
||||
mod secrets;
|
||||
mod ssh_connections;
|
||||
mod startup;
|
||||
mod status;
|
||||
|
|
@ -86,7 +73,7 @@ mod term_stream;
|
|||
mod test_nats;
|
||||
mod wanted;
|
||||
|
||||
// The accounts, forge, observability and review modules keep their crate-root paths (`crate::matrix_account::…`).
|
||||
// The accounts, forge, secrets, observability and review modules keep their crate-root paths (`crate::matrix_account::…`).
|
||||
use accounts::{
|
||||
forge_account, github_account, gitlab_account, link_egress, linked_accounts, matrix_account,
|
||||
};
|
||||
|
|
@ -97,6 +84,11 @@ use jobq::{Late, WorkerDeps, spawn_jobq_worker};
|
|||
use observability::{alerts, held_deploys, otel_http_client, vcs_metrics};
|
||||
use review::{notify_flows, notify_router_api, request_reviewer, review_classifier};
|
||||
use routes::AppState;
|
||||
use secrets::{
|
||||
agent_cutoff, agent_entity, agent_identity, agent_renewal, agent_role_ttl, archive_access,
|
||||
backend_egress, backend_env, backend_secrets, claude_login, egress_allow, egress_deny,
|
||||
proxy_credential, read_policy,
|
||||
};
|
||||
use startup::{
|
||||
agent_icon_reader, agent_status_reader, agents_md_reader, build_app,
|
||||
configured_matrix_homeserver, connect_status_reader, load_hives, load_links, load_swarm_name,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize};
|
|||
use swarm_secret_client::backend_env::{self, BackendEnv};
|
||||
use utoipa::ToSchema;
|
||||
|
||||
use super::linked_accounts::AccountStore;
|
||||
use crate::linked_accounts::AccountStore;
|
||||
use crate::routes::agents::swarm_hive;
|
||||
use crate::routes::{AppState, error_problem};
|
||||
|
||||
|
|
@ -194,8 +194,8 @@ pub(crate) mod tests {
|
|||
use serde_json::json;
|
||||
use swarm_secret_client::backend_env::BackendEnv;
|
||||
|
||||
use super::super::linked_accounts::{AccountStore, Accounts, tests::FakeStore};
|
||||
use super::{MAX_BYTES, PutBackendEnvRequest, validated};
|
||||
use crate::linked_accounts::{AccountStore, Accounts, tests::FakeStore};
|
||||
|
||||
const SECRET: &str = "sk-live-0123";
|
||||
|
||||
|
|
@ -226,7 +226,7 @@ pub(crate) mod tests {
|
|||
forge: std::sync::Arc::default(),
|
||||
create_gate: std::sync::Arc::default(),
|
||||
accounts: Accounts::Fake(Arc::clone(store)),
|
||||
try_outs: super::super::review_classifier::TryOuts::default(),
|
||||
try_outs: crate::review_classifier::TryOuts::default(),
|
||||
reviews: std::sync::Arc::default(),
|
||||
runs: crate::review_classifier::runs::Runs::Live(None),
|
||||
builds: crate::builder::runs::Builds::Live(None),
|
||||
|
|
@ -17,8 +17,8 @@ use serde::{Deserialize, Serialize};
|
|||
use swarm_secret_client::backend_secrets::{self, BackendSecrets};
|
||||
use utoipa::ToSchema;
|
||||
|
||||
use super::linked_accounts::AccountStore;
|
||||
use crate::backend_env::validated;
|
||||
use crate::linked_accounts::AccountStore;
|
||||
use crate::routes::agents::swarm_hive;
|
||||
use crate::routes::{AppState, error_problem};
|
||||
|
||||
|
|
@ -132,8 +132,8 @@ mod tests {
|
|||
use swarm_secret_client::backend_secrets::BackendSecrets;
|
||||
|
||||
use super::super::backend_env::tests::state;
|
||||
use super::super::linked_accounts::{AccountStore, tests::FakeStore};
|
||||
use super::PutBackendSecretsRequest;
|
||||
use crate::linked_accounts::{AccountStore, tests::FakeStore};
|
||||
|
||||
const SECRET: &str = "sk-ant-live-0123";
|
||||
|
||||
18
swarm-controller/src/secrets/mod.rs
Normal file
18
swarm-controller/src/secrets/mod.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
//! The secrets concern: agent identities and their renewal and cutoff, the
|
||||
//! credentials the controller hands out (archive, proxy, backend) and the
|
||||
//! egress and read policies written to the store.
|
||||
|
||||
pub(crate) mod agent_cutoff;
|
||||
pub(crate) mod agent_entity;
|
||||
pub(crate) mod agent_identity;
|
||||
pub(crate) mod agent_renewal;
|
||||
pub(crate) mod agent_role_ttl;
|
||||
pub(crate) mod archive_access;
|
||||
pub(crate) mod backend_egress;
|
||||
pub(crate) mod backend_env;
|
||||
pub(crate) mod backend_secrets;
|
||||
pub(crate) mod claude_login;
|
||||
pub(crate) mod egress_allow;
|
||||
pub(crate) mod egress_deny;
|
||||
pub(crate) mod proxy_credential;
|
||||
pub(crate) mod read_policy;
|
||||
Loading…
Reference in a new issue