ci(secrets->kms): codex-channel-molecule fetches secrets from Infisical (migrate off Gitea Actions secrets) #15
Reference in New Issue
Block a user
Delete Branch "ci/secrets-to-infisical-codex-channel-molecule"
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?
What
Migrate
codex-channel-moleculeoff the repo-level Gitea Actions secretPYPI_TOKENto the Infisical KMS-fetch pattern (proven #971 / #3274). This is a publish/CI-only repo with no prod-deploy — low risk.Migrated secret
PYPI_TOKEN— consumed by.gitea/workflows/publish.yml(thepublishjob,secrets.PYPI_TOKEN). Now fetched at runtime from Infisical prod path/ci/pypi.Not migrated (correctly skipped)
ci.ymlconsumes no secrets.INFISICAL_CI_CLIENT_ID/INFISICAL_CI_CLIENT_SECRET/INFISICAL_CI_PROJECT_ID— bootstrap machine-identity secrets (used by the fetch step itself), skipped per policy.GITEA_TOKEN/GITHUB_TOKEN— auto-injected, skipped.How (same job as the consumer)
A new "Fetch PYPI_TOKEN from Infisical KMS" step is added to the
publishjob, before thePublish to PyPIstep:POST /api/v1/auth/universal-auth/login) using theINFISICAL_CI_*bootstrap secrets;read_secret()→GET /api/v3/secrets/raw/PYPI_TOKEN?...&environment=prod&secretPath=%2Fci%2Fpypiwith a null-safe JSON extractor;::add-mask::the value, then exportPYPI_TOKENto$GITHUB_ENV.The
Publish to PyPIstep now readsPYPI_TOKENfrom the env —secrets.PYPI_TOKENis no longer referenced anywhere.Trusted-ref safety: this workflow only triggers on
push: tags(vX.Y.Z), which fork PRs cannot reach, so consuming theINFISICAL_CI_*identity here carries no untrusted-fork exposure.Validate-before-delete
The Gitea Actions secret
PYPI_TOKENis retained for now. It will be deleted only after this PR merges and a real publish run proves the Infisical fetch succeeds (green run). No Gitea secret is removed in this PR.🤖 Generated with Claude Code
APPROVED #15 @ac73c6bf24bae0b20f13d92a6d29d3eeef153c8a. Reviewed Wave A KMS migration: workflow is tag-push only (no pull_request/pull_request_target/fork exposure), PYPI_TOKEN extractor is string-only/null-safe (json null/missing/non-string -> empty), [ -z ] fails closed, ::add-mask:: occurs before $GITHUB_ENV export, Gitea PYPI_TOKEN is retained for validate-before-delete, and diff is scoped to publish.yml. YAML parses. Note: I saw no status contexts on this PR head in the statuses API, so merge should still wait for the expected BP/CI signal if branch protection requires one.
APPROVED — reviewed head
ac73c6bf24.Scope: Wave A Gitea→Infisical migration for PYPI_TOKEN in
.gitea/workflows/publish.yml.5-axis summary: correctness/security/robustness/perf/readability all clean for this low-risk publish-only path. The workflow is tag-push only, with no pull_request or pull_request_target trigger, so I do not see an untrusted fork path to the INFISICAL_CI identity. The accessToken and PYPI_TOKEN extractors use the null-safe/type-safe idiom (
isinstance(v, str) else ""), followed by[ -z ]fail-closed guards.::add-mask::is emitted before exporting to$GITHUB_ENV, logging is length-only, and the PR does not delete the existing Gitea PYPI_TOKEN secret. Full-paginated BP-required statuses are green (CI / test (3.11)andCI / test (3.12)). No unrelated edits found.