Return proper 4xx API responses on auth issues #285
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.60) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.60 · 216 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.322
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.060
Real PR Conversation Timeline
1 comments
"Review active on #285"
general
weight: 0.35
inFocus7
<!--
Thanks for opening a PR! Please delete any sections that don't apply.
-->
Description
<!--
A concise explanation of the change. You may include:
Fixes #123-->
Originally I had preemptively decided on returning 404s instead of actual auth errors to prevent resource leakage. I'm walking back on this decision for a few reasons now:
1. This is very confusing UX when someone can view a resource, and when they try to modify it, they get 404s.
- Similar to this, if I can view a resource now and in the future can't (due to authz), it would be confusing to see a 404 as I would believe the resource no longer exists, instead of the real issue: lack of permissions.
Actually, that's just one reason, but still important.
While the leakage prevention makes sense in public registries where any non-authenticated user can peruse, we currently do not have authn implemented that would warrant this precaution.
If we ever truly need or want resource leak protection, we can later expand on this (e.g. adding an AppOption to prevent resource existence leakage and checking it to decide on the API's return). In the meantime, we should keep this simple and straightforward.
Change Type
Changelog
<!--
Provide the exact line to appear in release notes for the chosen changelog type.
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
-->
``
release-note
``Return proper API responses due to auth issues (4XX).
Additional Notes
<!--
Any extra context or edge cases for reviewers.
-->