Repository navigation
CLAUDE.md: retain the PyPI break-glass token; bar agents from deleting credentials - #76
Merged
Merged
Conversation
…g credentials The PyPI hygiene note told the reader to delete the project-scoped token once OIDC Trusted Publishing was confirmed on a release. That contradicted the failure playbook two paragraphs above it, which names the token-driven Flow B as the recovery path when publish-pypi fails on an OIDC / trusted-publisher error -- so obeying the hygiene rule removed the fallback exactly when a broken release would need it, and forced a pypi.org round-trip at the worst possible moment. It was also a silent failure. ~/.zshrc builds TWINE_PASSWORD with $(cat ... 2>/dev/null), so deleting the file yields an empty password and a confusing PyPI auth error rather than an obvious missing-file one. Three changes: - Reverse the hygiene note: retain the token, refresh it on expiry, revoke only on leak or replacement. Warn that ~/.zshrc names the file literally (not by glob), so a rename must edit the .zshrc path in the same commit. - Document that the break-glass credential comes from the system environment (TWINE_USERNAME / TWINE_PASSWORD, pre-exported), so twine needs no flags and nobody hunts for a token file. - Add a hard rule under Security & Configuration Tips against deleting, revoking, or rotating any credential, or proposing it as cleanup, plus secret-handling rules: never print a value, assert on presence rather than content, and treat filenames/env-var names as non-secret. Also dedupe the two near-identical "avoid persistent privileged processes" bullets in that section. Docs only -- no code, CLI, or test change. Lands under [Unreleased]. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Docs only — no code, CLI, or test change. Lands under
CHANGELOG.md[Unreleased]; per When to cut a release this is repo-internal churn and ships with the next user-visible release, not as a release of its own.Why
The PyPI hygiene note said to delete the project-scoped token once OIDC Trusted Publishing was confirmed on a release. Two problems:
publish-pypifails on an OIDC / trusted-publisher error. Obeying the hygiene rule removed the fallback exactly when a broken release would need it.~/.zshrcbuildsTWINE_PASSWORDwith$(cat … 2>/dev/null), so deleting the file yields an empty password — a confusing PyPI auth error rather than an obvious missing-file one.This is not hypothetical: immediately after the v1.9.11 release published cleanly over OIDC, an agent (me) read that note as an action item and proposed deleting the live break-glass token. The maintainer declined. The note is the root cause, so it is retired.
Changes
~/.zshrcnamespypi-org-api-token-binlecodeliterally, not by glob, so adding a dated-exp-<month>-<year>suffix requires editing the.zshrcpath in the same commit or the export breaks silently.TWINE_USERNAME/TWINE_PASSWORDare pre-exported, sotwine uploadneeds no flags and nobody hunts for a token file. Presence is checked withenv | grep -c TWINE_PASSWORD, never by printing the value.Validation
Diff leak-checked for token material (
pypi-Ag…/AgEIcHlwaS5vcmc): 0 matches. The doc references the credential's filename and env-var names only — never a value.🤖 Generated with Claude Code