Repository navigation
Tech-debt batch 2: revoke sessions on disable/role change, enforce quota on plain uploads (#581 #586) - #604
Merged
Merged
Conversation
…anges a user's roles Closes #581 Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Branding maps a full quota to 413; disabling an account also revokes its refresh tokens. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
session_version is incremented atomically in SQL on every revocation path. Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Deploying simple-module-python with
|
| Latest commit: |
0824031
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ddd69b86.simple-module-python.pages.dev |
| Branch Preview URL: | https://fix-debt-batch-2.simple-module-python.pages.dev |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
UserService.disable(),enable()andset_roles()now bumpUser.session_versionatomically in SQL (bump_session_version, shared with the self-service sign-out paths) and publish the revocation on commit, so other workers forget the cached counter. Existing cookie sessions and bearer access tokens are refused on their next request. Disabling also revokes the account's refresh tokens. Behaviour change: a role change signs that user out of their existing sessions; a remembered sign-in re-authenticates with the new roles. Role→permission mappings were already resolved live, so editing a role's permissions needs no revocation.quota_bytesis enforced for plain uploads as well as resumable ones, through a sharedStorageQuota(stored bytes plus active reservations, serialised per tenant with a Postgres advisory lock). An over-quota upload answers 413 and its object is removed. Branding maps the same refusal to 413 instead of a 500. Behaviour change for installs that setquota_byteswhile it was only reported.Verification
/admin/usersand/file-storage/on port8212; no unexpected console errorsmake lint,make test-py(5641 passed),make test-js(748 passed), full e2e suite (49 passed); revocation and quota Postgres tests run against local PostgresQA Report
Test plan
quota_bytessmall, upload past it on/file-storage/: 413 with a clear message, no rowCloses #581
Closes #586
https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4