-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(embedded): add hook to allow superset admins to validate guest token parameters #30132
Conversation
Some cleanup and refactoring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #30132 +/- ##
===========================================
+ Coverage 60.48% 83.69% +23.20%
===========================================
Files 1931 529 -1402
Lines 76236 38421 -37815
Branches 8568 0 -8568
===========================================
- Hits 46114 32157 -13957
+ Misses 28017 6264 -21753
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @giftig and @dmarkey for dialing this in. @nytai already approved it, which is giving me an itchy trigger finger. If any of @giftig 's change requests are blockers, feel free to hit the "request changes" button to block the merge. Just make sure you're around to unblock it when the required adjustments are made ;) Thanks all :D |
My comments aren't really blocking, just a small improvement which would be nice imo. It's an easy +1 for me if the tests can be separated like they were before but without the repetition of test fixtures, but it's not a big enough issue to block the PR. |
Alright did another test refactor, broke out the tests again and moved them to their own class with the heavy dashboard fixture loaded in the class scope. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor question about noqa but LGTM
Not sure if I need to take action based on that failed cypress test? |
@dmarkey nothing that you've caused - we're investigating it currently, but it seems like a flaky test that may be caused by a perf regression that's been recently introduced. We're looking into it, but for now we'll just keep restarting the CI check until it passes.. |
feat(embedded): add hook to allow superset admins to validate guest t……oken parameters (apache#30132) Co-authored-by: David Markey
Thanks for merging! I guess it will be in 4.2.0? |
No, thank YOU! It'll definitely be in 5.0, and if we do a 4.2 (TBD) it'll definitely be in there, too. Right now, @sadpandajoe is building 4.1 RCs. I've labeled this PR to get cherries, but I'm not sure if that'll happen or not at this point. |
SUMMARY
This allows the Superset admin to tighten up Guest token configuration with a validator hook. Any aspect can be validated but most likely the RLS Clause.
TESTING INSTRUCTIONS
Set
GUEST_TOKEN_VALIDATOR_HOOK = lambda x: len(x["rls"]) == 1 and "tenant_id=" in x["rls"][0]["clause"]
and the RLS clause in the guest token will need to contain "tenant_id="ADDITIONAL INFORMATION