Commit f3549ff
[AAP-55305] Short circuiting claims processing if user is a super user (ansible#863)
## Description
<!-- Mandatory: Provide a clear, concise description of the changes and
their purpose -->
- What is being changed?
When running migrate service data gateway is put into a state that
prevents querying the gateway for user/object info. During JWT
authentication if the claims hash in the token doesn't match the claims
hash in the service a call from the service to the gateway to get the
claims (which then fails). With this patch, if a user has is_super_user
we will just completely skip processing the claims data which will
prevent this scenario and optimize authenticator for superusers in
general.
- Why is this change needed?
See above.
- How does this change address the issue?
Short circuits the claims processing if user is superuser.
## Type of Change
<!-- Mandatory: Check one or more boxes that apply -->
- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Documentation update
- [ ] Test update
- [ ] Refactoring (no functional changes)
- [ ] Development environment change
- [ ] Configuration change
## Self-Review Checklist
<!-- These items help ensure quality - they complement our automated CI
checks -->
- [X] I have performed a self-review of my code
- [X] I have added relevant comments to complex code sections
- [X] I have updated documentation where needed
- [X] I have considered the security impact of these changes
- [X] I have considered performance implications
- [X] I have thought about error handling and edge cases
- [X] I have tested the changes in my local environment
## Testing Instructions
<!-- Optional for test-only changes. Mandatory for all other changes -->
<!-- Must be detailed enough for reviewers to reproduce -->
### Prerequisites
<!-- List any specific setup required -->
### Steps to Test
1.
2.
3.
### Expected Results
<!-- Describe what should happen after following the steps -->
## Additional Context
<!-- Optional but helpful information -->
### Required Actions
<!-- Check if changes require work in other areas -->
<!-- Remove section if no external actions needed -->
- [ ] Requires documentation updates
<!-- API docs, feature docs, deployment guides -->
- [ ] Requires downstream repository changes
<!-- Specify repos: django-ansible-base, eda-server, etc. -->
- [ ] Requires infrastructure/deployment changes
<!-- CI/CD, installer updates, new services -->
- [ ] Requires coordination with other teams
<!-- UI team, platform services, infrastructure -->
- [ ] Blocked by PR/MR: #XXX
<!-- Reference blocking PRs/MRs with brief context -->
### Screenshots/Logs
<!-- Add if relevant to demonstrate the changes -->
---------
Co-authored-by: Seth Foster <[email protected]>
Co-authored-by: Claude <[email protected]>1 parent 92ea086 commit f3549ff
File tree
2 files changed
+120
-27
lines changed- ansible_base/jwt_consumer/common
- test_app/tests/jwt_consumer/common
2 files changed
+120
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
26 | 43 | | |
27 | 44 | | |
28 | 45 | | |
| |||
272 | 289 | | |
273 | 290 | | |
274 | 291 | | |
275 | | - | |
276 | | - | |
277 | | - | |
| 292 | + | |
| 293 | + | |
278 | 294 | | |
279 | 295 | | |
280 | 296 | | |
| |||
285 | 301 | | |
286 | 302 | | |
287 | 303 | | |
288 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
289 | 310 | | |
290 | | - | |
| 311 | + | |
| 312 | + | |
291 | 313 | | |
292 | 314 | | |
293 | 315 | | |
294 | 316 | | |
295 | 317 | | |
296 | 318 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
| 319 | + | |
| 320 | + | |
303 | 321 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 322 | + | |
| 323 | + | |
310 | 324 | | |
311 | | - | |
312 | | - | |
313 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
314 | 332 | | |
315 | 333 | | |
316 | 334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
537 | 537 | | |
538 | 538 | | |
539 | 539 | | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
540 | 594 | | |
541 | 595 | | |
542 | 596 | | |
| |||
758 | 812 | | |
759 | 813 | | |
760 | 814 | | |
| 815 | + | |
761 | 816 | | |
762 | 817 | | |
763 | 818 | | |
| |||
766 | 821 | | |
767 | 822 | | |
768 | 823 | | |
769 | | - | |
770 | | - | |
771 | | - | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
772 | 828 | | |
773 | 829 | | |
774 | 830 | | |
775 | | - | |
| 831 | + | |
776 | 832 | | |
777 | 833 | | |
| 834 | + | |
778 | 835 | | |
779 | | - | |
780 | | - | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
781 | 842 | | |
782 | | - | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
783 | 847 | | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
0 commit comments