Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RequestAuthenticationOptions.isPublicnow has three access modes:isPublic: trueisPublic: "optionalUser"Endpoints: 7 stay
true(/configuration,/psas,/quotes/isSubmissionEnabled,/users/:uidOrName/profile,/users/forgotPasswordEmail,/public/speedHistogram,/public/typingStats— none read the token). 4 getoptionalUserbecause they use the authenticated uid for optional user-specific data:GET /users/checkName/:name(own-name exclusion) andGET /leaderboards+/daily+/xp/weekly(friendsOnlyfilter) — these keep the previous behaviour, no regression.Changed behaviour
Only the 7
isPublic: trueendpoints change behaviour (they previously verified a token when one was sent). The 4optionalUserendpoints, theisPublicOnDevendpoints and webhooks behave exactly as before.Authentication — on these 7 endpoints a sent Bearer/ApeKey header is now ignored instead of verified: a broken/expired/revoked token can no longer fail the request (no more 401/404/503 from Firebase on public data).
User-based rate limiting — limiters key by uid when authenticated, else by IP. Since the user is no longer decoded, logged-in requests now count against the per-IP bucket:
GET /psasGET /quotes/isSubmissionEnabledGET /users/:uidOrName/profilePOST /users/forgotPasswordEmailGET /public/speedHistogramGET /public/typingStatsGET /configurationRelated minor changes on these 7: ApeKey requests now hit the normal limiter (per-IP, 429 on exceed) instead of the ApeKey limiter (
defaultApeRateLimit, 30/min, 479 on exceed); theauthprometheus metrics recordNonefor logged-in users; invalid tokens no longer record auth failures.OpenAPI docs
OpenAPI cannot express optional authentication (a listed scheme is required,
security: []means none).optionalUserendpoints therefore keepsecurity: []plus:x-optional-auth: [{ BearerAuth: [...] }, ...]vendor extension listing the schemes accepted when providedPublic docs (
gen-docs, filtered onx-public: yes): verified to contain all 7isPublic: trueand all 4optionalUserendpoints;isPublic: trueendpoints and permission-gated endpoints are unchanged.Evidence
isPublic: trueendpoints)auth.spec.tscovers both cases per mode (token → verified / no token → allowed / invalid token → 401 / apeKey). Controller specs coverfriendsOnlyandcheckNamefor authenticated and unauthenticated requestsMerge Danger
Door: two-way — reverting restores the previous boolean flag; no data, migration, or API-shape changes
Blast radius: the 7
isPublic: trueendpoints — biggest practical impact isuserForgotPasswordEmail(1/min) now bucketed per-IP, so users sharing an IP (NAT/office) share that budget.optionalUserendpoints unchanged.