You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A file secret provider for secrets that host tooling already decrypts
#35285
On machines managed by NixOS, Home Manager, systemd credentials or similar tools, secrets are already decrypted into files that only the user can read, for example /run/user/1000/agenix/gemini-api-key. T3 can only reference secrets through 1Password today, so there's no declarative way to point a provider key (say, Antigravity's Gemini API key) at one of those files. The alternatives are pasting the key into Settings by hand on every machine, or writing T3's internal secret store, which isn't a supported format.
Proposal
A file secret provider, configured in settings.json only, with no new UI:
It fits the existing SecretResolver and driver contract, which already resolve SettingsSecretValue references for provider settings, so nothing changes outside a new packages/secret-provider-file and its registration.
Rules for a read:
A reference is a bare file name (^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$), so no /, no traversal, no dotfiles. The root must be absolute and may itself be a symlink, since agenix links its directory to the current generation.
The file is opened with O_NOFOLLOW | O_NONBLOCK, so a symlink or FIFO can't redirect or block the read. Every check runs on that one descriptor: it must be a regular file owned by the server's user with no group or other bits, and the read is capped at 16 KiB. One trailing newline is stripped.
Anything else reads as unresolved and logs one warning with the reference and an errno, never the path contents or value.
On Windows the permission check can't be enforced, so the provider fails closed there.
The Secrets settings page already classifies kinds other than 1Password as unsupported, so a file provider needs no web changes.
I have a working implementation on top of main (14 driver/definition tests, check:changed passes) that we run on our own fork: caniko/t3code@feat/secret-provider-file. Happy to open a PR if you'd like it upstream.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
On machines managed by NixOS, Home Manager, systemd credentials or similar tools, secrets are already decrypted into files that only the user can read, for example
/run/user/1000/agenix/gemini-api-key. T3 can only reference secrets through 1Password today, so there's no declarative way to point a provider key (say, Antigravity's Gemini API key) at one of those files. The alternatives are pasting the key into Settings by hand on every machine, or writing T3's internal secret store, which isn't a supported format.Proposal
A
filesecret provider, configured insettings.jsononly, with no new UI:{ "secretProviders": { "host-secrets": { "kind": "file", "label": "Host secrets", "config": { "root": "/run/user/1000/agenix" } } }, "providerInstances": { "antigravity": { "driver": "antigravity", "config": { "authMethod": "gemini-api-key", "apiKey": { "provider": "host-secrets", "reference": "gemini-api-key" } } } } }It fits the existing
SecretResolverand driver contract, which already resolveSettingsSecretValuereferences for provider settings, so nothing changes outside a newpackages/secret-provider-fileand its registration.Rules for a read:
^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$), so no/, no traversal, no dotfiles. The root must be absolute and may itself be a symlink, since agenix links its directory to the current generation.O_NOFOLLOW | O_NONBLOCK, so a symlink or FIFO can't redirect or block the read. Every check runs on that one descriptor: it must be a regular file owned by the server's user with no group or other bits, and the read is capped at 16 KiB. One trailing newline is stripped.The Secrets settings page already classifies kinds other than 1Password as unsupported, so a
fileprovider needs no web changes.I have a working implementation on top of
main(14 driver/definition tests,check:changedpasses) that we run on our own fork: caniko/t3code@feat/secret-provider-file. Happy to open a PR if you'd like it upstream.All reactions