Introducing a new way to review your PRs.

Read the announcement

jdx / fnox

encrypted/remote secret manager

View on GitHub

27 documents · Updated Nov 23, 2026

docs / push-target-integrations

Push target integrations

Push targets are write-only destinations for resolved fnox secrets. The fnox push command keeps fnox as the source of truth while copying selected values into CI systems, hosting platforms, infrastructure tools, and command-driven services.

This page extends the command interface overview. Use secret and config commands for secret setup and provider and diagnostic commands for value resolution and access checks.

Push model

The push model links a secret to one or more named targets. A target describes where the value goes and replaces the value stored there under the fnox key; it is not a provider and cannot be used to resolve a secret. The push list belongs to each secret and is separate from normal shell or command injection. crates/…/config.rs• L306-361

The command resolves values in the same way as fnox get. This includes the secret's selected JSON field or line when those options are set. Target names and target settings are checked before any value is resolved or written. src/…/push.rs• L46-69

This diagram shows how a configured secret becomes a write at one or more destinations.

flowchart LR
    C[Active profile] --> P[Push plan]
    S[Secret provider] --> R[Resolved value]
    P --> R
    R --> T1[CI target]
    R --> T2[Hosting target]
    R --> T3[Infrastructure target]
    R --> T4[Command or API target]

Target selection

Target selection combines the push list on each secret with optional command filters. With no filter, fnox push sends every secret that names a target. A key argument limits the plan to named secrets. The --target option limits it to named targets and can be repeated. When a target filter is present, target names outside that filter do not need to be available for the selected push. src/…/push.rs• L158-209

Profiles select the active secret and target definitions together. A profile can replace a target with the same name, so one secret mapping can send test values to one place and production values to another. docs/…/push.md• L67-89

Push workflow

The workflow builds and checks a complete plan before it contacts a provider or destination. This keeps unknown target names, invalid target settings, and unsupported secret names from causing a partial write caused by a configuration error. src/…/push.rs• L51-69

When the plan is ready, the command shows the secret-to-target mapping. Interactive use asks for confirmation. Non-interactive use must pass --force; --dry-run shows the same plan and performs no writes. src/…/push.rs• L71-99

After confirmation, fnox resolves the root secrets and their dependencies. It groups the resolved values by target and sends each target the values assigned to it. A failed write does not stop later writes; the command reports the successful count and exits with the failed mappings. src/…/push.rs• L101-155

The command supports these main controls:

ControlEffect
fnox pushPush all secrets with configured targets.
KEYPush only the named secret.
--target NAMEPush only mappings for the named target.
--dry-runValidate and display the plan without resolving or writing values.
--forceSkip the confirmation prompt.

Target adapters

Each target adapter turns one named target into a destination-specific write. The adapter may use an installed CLI or a direct API. All adapters replace the destination value with the current resolved value, but the destination may still allow people with suitable access to read it. crates/…/mod.rs• L26-44

CI destinations

CI adapters publish values for automated jobs. GitHub supports repository, environment, organization, Dependabot, and Codespaces secrets. GitLab supports project or group variables with environment scope and controls such as masking, protection, raw expansion, and file type. Forgejo and Gitea support repository or organization Actions secrets through their API. docs/…/github-actions.md• L5-13, docs/…/gitlab-ci.md• L5-13, docs/…/forgejo-actions.md• L5-13

GitHub and GitLab use their command-line tools and the login state of those tools. Forgejo and Gitea use an API token from FORGEJO_TOKEN or GITEA_TOKEN. These destinations do not return the stored secret through the push integration. crates/…/github_actions.rs• L13-18, crates/…/forgejo_actions.rs• L14-16

References: docs/…/github-actions.md• L5-13 docs/…/gitlab-ci.md• L5-13 docs/…/forgejo-actions.md• L5-13 crates/…/github_actions.rs• L13-18 crates/…/forgejo_actions.rs• L14-16

Hosting destinations

Hosting adapters publish runtime environment values or platform secrets. Vercel writes a variable once for each configured environment and can bind a preview value to a Git branch. Cloudflare Workers writes a Worker secret for a selected Worker environment. Fly.io writes an app secret and can stage it without redeploying Machines. docs/…/vercel.md• L5-13, docs/…/cloudflare-workers.md• L5-13, docs/…/fly.md• L5-13

These adapters use the platform CLI and its local login or project context. Vercel replaces an existing variable. Cloudflare replaces the secret and deploys a new Worker version. Fly can either apply the secret or stage it, based on the target setting. crates/…/vercel.rs• L59-99, crates/…/cloudflare_workers.rs• L41-56, crates/…/fly.rs• L74-95

References: docs/…/vercel.md• L5-13 docs/…/cloudflare-workers.md• L5-13 docs/…/fly.md• L5-13 crates/…/vercel.rs• L59-99 crates/…/cloudflare_workers.rs• L41-56 crates/…/fly.rs• L74-95

Infrastructure destinations

The HCP Terraform adapter writes a workspace variable as either a Terraform input variable or an environment variable. It finds the workspace and then updates an existing variable with the same key and category or creates one. The value is sensitive by default, and the target can also mark it as HCL. docs/…/hcp-terraform.md• L5-14, crates/…/hcp_terraform.rs• L167-265

The default destination is HCP Terraform at app.terraform.io; a custom Terraform Enterprise URL is also supported. API access uses the host-specific Terraform token convention, TFE_TOKEN, or the Terraform credentials file. crates/…/hcp_terraform.rs• L20-29, crates/…/hcp_terraform.rs• L88-99

References: docs/…/hcp-terraform.md• L5-14 crates/…/hcp_terraform.rs• L167-265 crates/…/hcp_terraform.rs• L20-29 crates/…/hcp_terraform.rs• L88-99

Command-driven destinations

Command-driven destinations pass the secret value to a platform CLI through standard input. This keeps the value out of the process argument list while the CLI handles the platform's authentication and write rules. crates/…/cli.rs• L17-82

The shared command path reports a missing CLI as a setup error and reports the CLI's standard error when a write fails. A target can make more than one CLI call for a single logical write, such as GitLab's set-then-update fallback or Vercel's one call per environment. crates/…/gitlab_ci.rs• L115-126, crates/…/vercel.rs• L85-99

References: crates/…/cli.rs• L17-82 crates/…/gitlab_ci.rs• L115-126 crates/…/vercel.rs• L85-99

Delivery boundaries

Push delivery is write-only from fnox's point of view. After a value is sent, fnox does not compare it with the destination or read it back. Change the provider value and run fnox push again to propagate a rotation. docs/…/push.md• L7-11

The value avoids the terminal, clipboard, chat, and command arguments during a normal push. This limits accidental exposure but does not limit access inside the destination. Anyone who can change code that runs with the value may still expose it. docs/…/push.md• L91-93

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the target type list, target catalog, and each target's configuration page aligned.
  • Preserve the contract that target validation completes before any secret resolution or write.
  • Update push-plan descriptions when a target's destination scope or replacement behavior changes.
  • Check CLI stdin handling when a command changes from create to update or adds a second write per secret.
  • Check profile overrides when changing the shape of a secret's push mapping or target settings.

Important failure modes

TriggerConsequenceGuard
A secret names an unknown targetThe command fails before it resolves or writes any value.Define the target under [targets.<name>] or fix the secret's push list.
A target has invalid or conflicting settingsThe full push plan stops before delivery.Use the target's allowed scope fields and preview with --dry-run.
A required CLI is missing or not logged inThe affected write fails with a setup or CLI error.Install the target CLI and verify its login in the push context.
One destination write failsLater mappings still run, but the command exits non-zero and lists failures.Review the reported target error and rerun after fixing access or config.
A destination exposes stored values to its maintainersThe pushed secret can be read or used by people with destination access.Use destination masking or sensitivity settings and limit write access.

Key files

FileWhy to read it
src/…/push.rsDefines target selection, validation, confirmation, resolution, batching, and failure reporting.
crates/…/config.rsDefines the secret-to-target push relationship and profile-loaded configuration.
crates/…/mod.rsDefines the common target contract and supported destination types.
crates/…/cli.rsDefines safe stdin delivery and common CLI error behavior.
docs/…/index.mdGives the destination-level comparison and target catalog.
docs/…/push.mdExplains the user-facing push model, profiles, and security boundary.