feat: support guest-token revocation per embedded dashboard#40676
Draft
rusackas wants to merge 1 commit into
Draft
feat: support guest-token revocation per embedded dashboard#40676rusackas wants to merge 1 commit into
rusackas wants to merge 1 commit into
Conversation
… [DRAFT] Guest tokens are self-contained JWTs with no revocation: when an admin revokes embedded access, existing tokens stay valid until exp (ASVS 7.4.1, CWE-613). Add a guest_token_revoked_before column (epoch seconds) to embedded_dashboards (migration c8d2e3f4a5b6) and reject, in get_guest_user_from_request, any guest token whose iat predates the revocation cutoff of one of its embedded-dashboard resources. Add SecurityManager.revoke_guest_token_access(embedded_uuid) to set the cutoff to now. Guest tokens already carry iat, so no token format change. DRAFT: implements the SIP's Part A3 mechanism. Wiring revoke_guest_token_access into an admin UI / REST action is a follow-up. The revocation check adds a DAO lookup per guest request; needs validation under embedded load. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40676 +/- ##
==========================================
- Coverage 64.18% 63.80% -0.39%
==========================================
Files 2591 2651 +60
Lines 138471 142188 +3717
Branches 32120 32575 +455
==========================================
+ Hits 88883 90725 +1842
- Misses 48056 49895 +1839
- Partials 1532 1568 +36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Guest tokens (embedded dashboards) are self-contained JWTs validated only for signature,
exp, andaud— there is no revocation. When an admin revokes a guest's access, existing tokens remain valid until expiry (ASVS 7.4.1, CWE-613).This implements the SIP's Part A3:
guest_token_revoked_before(epoch seconds) toembedded_dashboards(migrationc8d2e3f4a5b6).get_guest_user_from_requestnow rejects any guest token whoseiatpredates the revocation cutoff of one of its embedded-dashboard resources.SecurityManager.revoke_guest_token_access(embedded_uuid)sets the cutoff to now — revoking all currently-issued tokens for that dashboard while leaving later-issued ones valid.Guest tokens already carry
iat, so no token-format change is required. Default behavior is unchanged (NULLcutoff ⇒ no revocation).WHY DRAFT (
hold:testing)Wiring
revoke_guest_token_accessinto an admin UI / REST action is a follow-up (this PR provides the mechanism). The revocation check adds a DAO lookup per guest request — needs validation under embedded load.TESTING INSTRUCTIONS
Tests: token issued before the cutoff is rejected; token issued after is still valid; no cutoff ⇒ valid; missing
iat⇒ not revoked.ADDITIONAL INFORMATION
embedded_dashboards.guest_token_revoked_before; reversible)🤖 Generated with Claude Code