fix(server): exempt authorized setup claims from attempt limits - #80
Merged
Merged
Conversation
|
Warning Review limit reached
On-demand reviews are free for the next 16 days. After that, they cost $0.25 per reviewed file. Or wait 35 minutes for your next included review. View limit detailsLimit details: You’ve used all 3 included reviews currently available. Your 44 included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (3)
Comment |
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.
Anonymous requests to POST /auth/setup consumed the same attempt budget as setup-code authorization. This could block an already-authorized operator from claiming the deployment; even a successful setup-code request using the final allowance prevented the next step.
Require a valid signed setup session before reading the claim body, and exempt the authorized claim from the anonymous attempt counter. Missing, tampered, and expired setup sessions return 401 without consuming that counter. Claim still revalidates authorization before its atomic credential write; operator login and setup-code authorization retain their existing limits.
Add four regression cases covering valid, missing, tampered, and expired setup sessions after the authorization budget is exhausted, including repeated anonymous claim attempts before authorization. Document the claim behavior.
Validation:
bun run formatandbun run checkpassed.bun run testpassed: 1,092 tests.bun run buildpassed with existing chunk-size and mixed-import warnings.This addresses the setup-claim availability issue in #74. The login-to-setup reproduction in that issue is prevented by existing configuration-state checks, and multi-replica deployment remains outside the supported single-container topology.
Fixes #74.