Repository navigation
Tech-debt batch 10: rotate the session on sign-in; UsageMeter contract (#615 #616) - #617
Merged
Merged
Conversation
Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Keep site-lock's unlock marker across the sign-in session reset via a per-app preserve_across_sign_in registry; drop CSRF rotation on tenant switch (same principal). Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
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. |
Deploying simple-module-python with
|
| Latest commit: |
a820aef
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://13b08803.simple-module-python.pages.dev |
| Branch Preview URL: | https://fix-debt-batch-10.simple-module-python.pages.dev |
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
simple_module_hosting.session.preserve_across_sign_in(app, key). Site lock registers its unlock marker, so a visitor who unlocks the site is not asked again after signing in. A CSRF token minted before sign-in is refused afterwards (403). Keycloak's OIDC callback keeps the session and calls the newsimple_module_hosting.csrf.rotate_csrf_token(request).tenants.contracts.UsageMeteris an implementation-free usage-metering protocol next toEntitlementProvider. It coverscheck,consume,record,refund,reserve/commit/releaseandsummary, plusUsageOutcome,UsageReservation,UsageSummaryRowandUsageExceededError.UnlimitedUsageMeteris the default onapp.state.tenants.usage, andget_usage_meter(app)returns the installed one.POST /api/tenants/{id}/switchreturns a bare 204 with no new token, so rotating would 403 every open tab.preserve_across_sign_in. This is in the CHANGELOG.Verification
make lintpassed.make test-py: 5999 passed, 39 skipped.make test-js: 770 passed.QA Report
Test plan
Closes #615
Closes #616
https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4