feat(inventory): B2: serve an environment's inventory from canopy - #523
feat(inventory): B2: serve an environment's inventory from canopy#523dannash100 wants to merge 24 commits into
Conversation
|
|
||
| ## Secrets | ||
|
|
||
| An inventory carries no secret. |
There was a problem hiding this comment.
well, that's a problem, because there's secrets in the variables. so can't use that design
There was a problem hiding this comment.
Oh true that my bad
…/inventory-refusal-maintenance # Conflicts: # .workhorse/specs/private-server/inventory.md # crates/private-server/src/fns/inventory.rs # private-web/openapi.json # private-web/src/api-types.ts
| /// | ||
| /// Requires admin access, the inventory carrying the secret variables' values. | ||
| #[utoipa::path( | ||
| post, |
There was a problem hiding this comment.
Probably a good candidate for the QUERY method, over POST?
There was a problem hiding this comment.
Apparently unsupported currently because
utoipa/utoipa-gen 5.5.0 and axum 0.8.9 are both the current max on crates.io.
And dont have that support 🙏
| pub rank: Option<ServerRank>, | ||
| /// Identifier of the server, for a server-scoped variable. | ||
| #[serde(default)] | ||
| pub server_id: Option<Uuid>, |
There was a problem hiding this comment.
Probably needs to become machine_id
There was a problem hiding this comment.
Also this entire type should probably be something like
enum ScopeArgs {
Environment { server_group_id: Uuid, rank: ServerRank },
Machine { machine_id: Uuid },
}with the current structure, both of these invalid states are representable:
ScopeArgs {
server_group_id: None,
rank: None,
server_id: None,
}
ScopeArgs {
server_group_id: Some(...),
rank: Some(...),
server_id: Some(...)
}and need careful handling; with the enum, they're not representable so bugs can't happen
| let mut conn = state.db.get().await?; | ||
| reject_tag_of_that_name(&mut conn, scope, &args.name).await?; | ||
|
|
||
| let kube = secret_store(&state)?; |
There was a problem hiding this comment.
secret_store() is the shared BackupSecrets Kube backend, but the recovery-vault writer does not back up that backend generically: it snapshots only each ServerGroupBackupConfig.repo_password_ref. The new inventory-vars-* Secrets are therefore absent from state.age. A cluster/namespace loss loses these variables permanently, despite their being configuration-critical secrets. Extend the recovery snapshot (and restore design) to include declared inventory-secret keysets, or use a store whose contents are already covered by escrow.
…aintenance feat(inventory): C2: refuse an inventory for work under way or an unplanned upgrade
Ansible reads each environment's servers and variables from a file nothing keeps in step with canopy, with salts and enrolment tokens in the clear.
POST /api/inventory/for_group: a group's live servers at one rank, with kind, address and vars.true/falseand JSON arrays decode.Spec:
.workhorse/specs/private-server/inventory.md. Lands after #524.QA
Inventory from canopy