#!/usr/bin/env bash # batch09-token.sh — the /auth/token surface that unit tests cannot reach. # # handler_test.go covers the request shapes in-process. What it cannot show is # which form a real client actually picks, and whether the deliberate # non-RFC 401 keeps those clients moving instead of looping. # # Covers: # b25aee3 — serve the OAuth2 POST form; refresh_token refused 401, not 400 # 08121f3 — indexed device auth is O(1) (the legacy scan is checked separately, # see LEGACY BACKFILL below — it is destructive and opt-in) # # Findings this script encodes, so a re-run re-checks them: # * Docker (29.7.2) and skopeo (1.22.2) use the GET form even when they hold a # credential. containerd (2.3.3) is the only client here that POSTs, which # is the client b25aee3 was written for — it ate a 405 before this commit. # * There is no anonymous branch in the handler at batch 09. Anonymous GET is # a 401 here; the anonymous path arrives with val/10-anonpull. # # Read-only app passwords (9d4ad84) are NOT covered: the reference PDS has no # such thing, so the 403 InsufficientScope path is unreproducible here. See # pkg/auth/servicetoken.go for what is and is not known about it. # # Usage: ./test/e2e/batch09-token.sh # ATCR_E2E_DESTRUCTIVE=1 ./test/e2e/batch09-token.sh # + legacy scan set -uo pipefail APPVIEW=${ATCR_APPVIEW_URL:-http://127.0.0.1:5000} # never localhost: that 307s A="$APPVIEW/auth/token" SERVICE=${ATCR_E2E_SERVICE:-127.0.0.1} HANDLE=${ATCR_E2E_HANDLE:-evan.jarrett.net} REPO=${ATCR_E2E_REPO:-$HANDLE/valtest} pass=0; fail=0 check() { # check