Skip to content

fix: fail safely in registry admin scripts - #1622

Merged
rdimitrov merged 2 commits into
mainfrom
codex/admin-script-failure-guards
Sep 5, 2026
Merged

fix: fail safely in registry admin scripts#1622
rdimitrov merged 2 commits into
mainfrom
codex/admin-script-failure-guards

Conversation

@rdimitrov

Copy link
Copy Markdown
Member

The takedown script previously treated any nonempty ALL_VERSIONS value, including false, as permission to delete every version. Require exactly true when the variable is set, and reject other values before sending a request.

Enable strict shell error handling in the auth helper so a failed identity-token command stops execution before exchanging an empty token.

Validation: bash -n and git diff --check passed. Mocked command checks confirmed that false, 1, and TRUE are rejected before network access, and that identity-token retrieval failure stops before the token exchange. The updated scripts also completed the authorized takedown associated with #1563; public API reads confirmed the deleted record and removal from default results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

With strict mode enabled, current JSON parsing can cause the auth script to exit on a non-JSON response before emitting the intended failure message/diagnostics.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Tightens safety checks in the registry admin bash scripts to prevent accidental broad takedowns and to stop authentication flows earlier when prerequisites fail, aligning with the operational need to perform reliable moderation/takedown actions (e.g., for #1563).

Changes:

  • Rejects any non-empty ALL_VERSIONS value other than the literal true before proceeding in the takedown script.
  • Enables strict bash error handling (set -euo pipefail) in the auth helper and fixes an output-line formatting issue.
File summaries
File Description
tools/admin/takedown.sh Adds explicit validation so ALL_VERSIONS must be exactly true when provided.
tools/admin/auth.sh Enables strict error handling and corrects the token export output formatting.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/admin/auth.sh
@rdimitrov
rdimitrov merged commit 739b70e into main Sep 5, 2026
8 checks passed
@rdimitrov
rdimitrov deleted the codex/admin-script-failure-guards branch September 5, 2026 22:13
Sign up for free to 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.

2 participants