Skip to content

Show the issuer's reason when it refuses a box's secret - #95

Open
czpython wants to merge 1 commit into
mainfrom
paulo/missing-secret-reason
Open

czpython wants to merge 1 commit into
mainfrom
paulo/missing-secret-reason

Conversation

@czpython

@czpython czpython commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

What changed

When the issuer refuses a secret until a person acts, for example because the GitHub App is not on the repo, a box's request through the proxy failed with a bare 503. The exchange logged the issuer's reason and answered /authorize with an empty 503. The proxy then answered 503 exchange unavailable with no content type, so git printed only the status.

  • The exchange keeps the issuer's reason through the retry wait, and /authorize answers 422 with it while nothing valid is held. Any other issuer failure still answers 503.
  • The proxy refuses the request with 403 and the reason as text/plain. git prints such a body as remote: lines, so a failed clone names the fix.
  • Nothing is missing in that case: the issuer refuses the secret until a person acts. MissingSecretError is now IssuerRefusedError, and POST /hosts answers ISSUER_REFUSED instead of SECRET_MISSING.
  • test_app.py and test_secrets.py import the module they test instead of four or more names from it.

When the issuer refuses a secret until a person acts, the exchange keeps
its reason through the retry wait, and /authorize answers 422 with it
instead of an empty 503. The proxy refuses the box's request with 403 and
the reason as text/plain, which git prints as remote: lines, so a failed
clone names the fix, for example that the GitHub App is not on the repo.
Any other issuer failure still answers 503.

Nothing is missing in that case, so MissingSecretError is now
IssuerRefusedError, and POST /hosts answers ISSUER_REFUSED instead of
SECRET_MISSING.
@czpython czpython changed the title Show the issuer's reason when a box's secret is missing Show the issuer's reason when it refuses a box's secret Nov 14, 2026
@czpython
czpython force-pushed the paulo/missing-secret-reason branch from 620bf9f to af9f247 Compare November 14, 2026 17:26
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.

1 participant