fix: fail safely in registry admin scripts (#1622)
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.
This commit is contained in:
parent
dd4b2939e3
commit
739b70e8bc
1 changed files with 14 additions and 4 deletions
|
|
@ -34,6 +34,10 @@ fi
|
|||
|
||||
# Require an explicit choice, so that a forgotten VERSION cannot silently take
|
||||
# down every version of a server.
|
||||
if [ -n "$ALL_VERSIONS" ] && [ "$ALL_VERSIONS" != "true" ]; then
|
||||
echo "Error: ALL_VERSIONS must be exactly true when set." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "$VERSION" ] && [ -n "$ALL_VERSIONS" ]; then
|
||||
echo "Error: set either VERSION or ALL_VERSIONS, not both." >&2
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue