Credential value templates: one declared shape for every credential's non-secret half and verification #23
Labels
No labels
blocked
bug
decision
duplicate
enhancement
handoff
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/secrets#23
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replace the three hand-named credential formats and the verify-probe enum with one declared shape: a credential's non-secret text is a template around one
{secret}placeholder, and a target's verification is one command string, so every consumer stops carrying a copy of the vocabulary and adding a new kind of credential is a registry edit, not a code change in three repos.Primary goals:
value.templateis the non-secret text with exactly one{secret}; a credential with novalueis the secret verbatim.credential-store-urlandrclone-remote-stanzabecome templates;rawandraw-forgejo-tokenbecome the absent case. The rclone password still passes throughrclone obscure, named asvalue.encode = "rclone-obscure", the only remaining list, because an encoder is code.verify, one command printed verbatim, prefixed withssh <system>when the target is not the host. The four probe types become four example lines in the docs.lib.credentialEncodingsand acredential-registrycheck that validates every group: template shape, encoder membership, verify strings, and no legacy field on a credential that carries the new one.allod secret declare,allod secret rotate, and archetypes read the flake's exports and carry no enum.allod secret migrate <name>does that lift exactly once per existing container credential and rewrites its registry entry.formatplusverify.typeobjects) or a new one, never both on one credential.rotate-tokenkeeps rotating legacy entries until allod/nexus#52 retires it;allod secret rotaterefuses a legacy container entry by namingmigrate.Current state and specifics
Three consumers enumerate the vocabulary today and must agree by hand:
scripts/rotate-tokenin nexus (validate_group_metadata, theprepare_itemand encryption switches,print_group_verification), the deployment's private secrets flake check, and the Go port on allod/tools#207 (validCredentialFormat,validRegistryVerifyType,printVerification). allod/nexus#54 was the cost of one new credential kind: one word in each of three places. The last comment on allod/tools#197 proposed an optional format and a per-target verify line; this issue takes that to its end, since the two containers differ only in the text around the secret.Registry credential, new shape:
A plain value omits
value. An rclone stanza is{ "template": "[shared]\ntype = ...\nhost = ...\nuser = ...\npass = {secret}\nexplicit_tls = true\n", "encode": "rclone-obscure" }.local_auth_refreshstays structured; its source check becomes "the source template is a git credential URL" instead of "format is credential-store-url". Group fields (service,account,ui_token_name,registry_alias,rotation_strategy) are unchanged; the registry's name is allod/secrets#22 and is not changed here.Ordering: the secrets template's check and exports first; then the tools commands and the archetypes check, which read the exports; then the private registry migrates under a handoff issue; then legacy acceptance is removed from the check and
rotate-tokenretires under allod/nexus#52.Scope
In: the
credential-registrycheck andlib.credentialEncodingsin the public secrets template, with its example group migrated;allod secret declare,rotate, and the new host-onlymigratein allod/tools on the new shape, superseding allod/tools#206 and #207; the archetypes local-auth-refresh check accepting a template source. Out, tracked elsewhere: the private registry migration and private validator (handoff issue filed when this lands); retiringrotate-token(allod/nexus#52); renaming the registry (allod/secrets#22); removing legacy acceptance from the check once no registry carriesformat(follow-up issue filed at handoff).Refs allod/tools#197, allod/tools#196, allod/nexus#54.
The common credential shape stands; the private-side reconciliation needs a narrower cutover order, not another registry field.
local_auth_refreshstays legacy until allod/nexus#52 gives refresh-local-auth a new-shape implementation or retires that dependency. The migration command must refuse that credential while the legacy refresh path still requiresformatand structured verify metadata.allod secret createmust rendervalue.templatearound the candidate secret just likerotate; otherwise a newly declared templated credential would encrypt the bare secret.The private handoff will also require the deployment flake to re-export
lib.credentialEncodingsand its validator to accept legacy-or-new entries before any credential migration runs. These are sequencing constraints only; the JSON credential contract in this issue is unchanged.