Skip to content

feat: add sops+age encrypted environment store (dev/prod) - #240

Merged
ORESoftware merged 1 commit into
mainfrom
feat/sops-env-store
Aug 8, 2026
Merged

feat: add sops+age encrypted environment store (dev/prod)#240
ORESoftware merged 1 commit into
mainfrom
feat/sops-env-store

Conversation

@ORESoftware

Copy link
Copy Markdown
Contributor

Adds the per-repo sops+age encrypted environment store following the org convention from zed-pkg/zed-infra#10: .sops.yaml creation rules, a justfile that delegates to ores-sops plus an audit recipe, an annotated env/template.env.example schema, .gitignore env block, and sops-encrypted env/enc/{dev,prod}.env.enc.

Scope: this store holds developer/test credentials only (a dev registry token, a test Supabase project, a throwaway test account) so local cargo run / e2e sessions do not pass secrets through shell history. End users of the CLI keep supplying their own environment; nothing here changes runtime behavior.

Env schema (stored variables)

VariableClassRead bydev valueprod value
ZED_PKG_REGISTRYnon-secret defaultglobal --registry (src/cli.rs); default https://registry.zpkg.nethttp://127.0.0.1:48090https://registry.zpkg.net
ZED_PKG_AUTH_URLnon-secret defaultglobal --auth-url (src/cli.rs); defaults to <registry>/shared-authhttp://127.0.0.1:48090/shared-authhttps://registry.zpkg.net/shared-auth
ZED_PKG_SUPABASE_URLidentifierglobal --supabase-url (src/cli.rs), required with the key by src/auth.rshttp://127.0.0.1:54321 (local Supabase)PLACEHOLDER
ZED_PKG_SUPABASE_KEYsecret slot (publishable/anon key, never service-role)global --supabase-key (src/cli.rs, hide_env_values)PLACEHOLDERPLACEHOLDER
ZED_PKG_TOKENsecretglobal --token (src/cli.rs, hide_env_values); token precedence in src/config.rsPLACEHOLDERPLACEHOLDER
ZED_PKG_AUTH_EMAILidentifier (test account)zed auth login/signup (src/cli.rs)PLACEHOLDERPLACEHOLDER
ZED_PKG_AUTH_PASSWORDsecret (test account)read_password() in src/auth.rsPLACEHOLDERPLACEHOLDER

Not stored (documented in the template): native-host publish tokens (ZED_NPM_TOKEN, ZED_CARGO_TOKEN, … from src/native_host_client.rs credential_env_vars) and the non-secret behavior toggles (ZED_PKG_HOME, ZED_PKG_FROZEN, ZED_PKG_CONTEXT_*, ZED_DEV_*, ZED_PKG_TEST_*).

Placeholders by policy

Every secret value in the committed ciphertext is a PLACEHOLDER-… string, per the credential-handling policy tracked in DEN-2836: real values must never transit chat, shell commands, or plaintext files — they are entered directly with just edit <name> (sops in-place edit, no plaintext on disk). sops dotenv mode encrypts values only, so variable names in env/enc/*.env.enc stay reviewable in diffs.

Deviations from the template

  • No flake.nix added: this repo already ships a consumer-pinned Nix flake at nix/flake.nix (the reproducible package bridge), so the template's devShell flake was omitted rather than introducing a second flake identity at the repo root. ores-sops comes from the zed-infra devShell or PATH.
  • The zed-infra-specific cf-verify Cloudflare recipe was dropped; there is no Cloudflare material in this repo's env surface.

Verified locally: sops -d round-trip on both files (names only), ENC[AES256_GCM present, just audit passes.

🤖 Generated with Claude Code

Per-repo env secret store following the zed-pkg org convention
(zed-infra PR #10): .sops.yaml creation rules (age recipient
op_alex_macbook), justfile delegating to ores-sops plus a plaintext
audit recipe, an annotated env/template.env.example schema, and
sops-encrypted env/enc/{dev,prod}.env.enc.
Scope: developer/test credentials only (dev registry token, test
Supabase project, throwaway test account) — end users of the CLI keep
supplying their own environment. All secret values are PLACEHOLDER
strings by policy (DEN-2836): real values enter only via 'just edit'.
The template's devShell flake.nix is intentionally omitted: this repo
already ships a consumer-pinned Nix flake at nix/flake.nix and it is
left untouched; ores-sops comes from the zed-infra devShell or PATH.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ORESoftware
ORESoftware marked this pull request as draft August 8, 2026 15:19
@ORESoftwareChatGPT Codex Connector

Copy link
Copy Markdown
ContributorAuthor

Converted to draft as a merge-order guard.

This branch is based on pre-#228/#239main and GitHub currently reports it non-mergeable. Before promotion it needs a clean current-main replay, exact ciphertext/recipient audit, confirmation that only placeholders decrypt, and exact-head repository/security checks. No real credential should be introduced or transported through the PR.

@ORESoftware
ORESoftware marked this pull request as ready for review August 8, 2026 15:29
@ORESoftware
ORESoftware merged commit 4d59852 into mainAug 8, 2026
23 checks passed
@ORESoftware
ORESoftware deleted the feat/sops-env-store branch August 8, 2026 15:33
@linear-code

Copy link
Copy Markdown

DEN-2969

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@ORESoftware