feat(remote): create or rotate an environment's engine key - #137
Merged
Conversation
outofcoffee
force-pushed
the
feat/remote-external-api-key
branch
2 times, most recently
from
September 2, 2026 00:29
bbbd569 to
eeb4632
Compare
outfit remote deploy --api-key-env VAR resolves the variable and sends its value to the deploy, which creates the environment's key secret or rotates it; the reply carries the action (created/rotated), never the value. A deploy with no flag leaves the stored key alone. fleet.yaml gains apiKeyEnv, the default variable holding a kind: remote node's engine key (a node's own engineTokenEnv still wins), so a launch resolves the key or fails before the agent starts.
outofcoffee
force-pushed
the
feat/remote-external-api-key
branch
from
September 2, 2026 01:51
eeb4632 to
300c6f8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set an environment's engine key from the CLI, and resolve it for fleet routing.
Summary
outfit remote deploy --api-key-env VARresolves the variable (process environment, then the.envbeside the Outfit) and sends its value to the deploy, which creates the environment's key secret or rotates it. The reply carries only the action (created/rotated), never the value; a deploy with no flag leaves the stored key alone — generated only if absent, never regenerated.fleet.yamlgainsapiKeyEnv, the fleet-wide default variable holding akind: remotenode's engine key (a node's ownengineTokenEnvstill wins). A launch that cannot resolve it fails before the agent starts, rather than pointing it at a gate it cannot pass.Implementation details
allowedCidr/reseedalready set: it rides in the SigV4 body beside them withomitempty, so a control plane that predates it sees exactly the body it always saw.ensureEnvApiKeyis create-or-set —CreateSecretwhen the secret is absent,PutSecretValuewhen it exists (which invalidates the old key) — and distinguishes the two in its reply, since a first keyed deploy creates rather than rotates..envfills a gap — the same precedence outfit uses everywhere.