Skip to content

Commit

Permalink
Return a list of errors from auth failures
Browse files Browse the repository at this point in the history
In `generate_challenge`, change the body of the error to be a list of
errors rather than a single error, following the error model used and
declared elsewhere in Gafaelfawr.
  • Loading branch information
rra committed Jan 22, 2025
1 parent 6f5eea9 commit 20729d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gafaelfawr/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def generate_challenge(
error_description=str(exc),
scope=" ".join(sorted(scopes)) if scopes else None,
)
detail = {"msg": str(exc), "type": exc.error}
detail = [{"msg": str(exc), "type": exc.error}]
headers = {
"Cache-Control": "no-cache, no-store",
"WWW-Authenticate": challenge.to_header(),
Expand Down

0 comments on commit 20729d0

Please sign in to comment.