🐛 add middleware to handle social auth provider unavailability gracefully#13523
🐛 add middleware to handle social auth provider unavailability gracefully#13523Maffooch merged 18 commits intoDefectDojo:bugfixfrom
Conversation
🔴 Risk threshold exceeded.This pull request modifies a sensitive file (dojo/middleware.py) multiple times; the scanner flags these as sensitive codepath edits and recommends configuring allowed paths/authors in .dryrunsecurity.yaml. Review and approve or restrict these changes per your sensitivity policy.
🔴 Configured Codepaths Edit in
|
| Vulnerability | Configured Codepaths Edit |
|---|---|
| Description | Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml. |
🔴 Configured Codepaths Edit in dojo/middleware.py
| Vulnerability | Configured Codepaths Edit |
|---|---|
| Description | Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml. |
🔴 Configured Codepaths Edit in dojo/middleware.py
| Vulnerability | Configured Codepaths Edit |
|---|---|
| Description | Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml. |
🔴 Configured Codepaths Edit in dojo/middleware.py
| Vulnerability | Configured Codepaths Edit |
|---|---|
| Description | Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml. |
🔴 Configured Codepaths Edit in dojo/middleware.py
| Vulnerability | Configured Codepaths Edit |
|---|---|
| Description | Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml. |
🔴 Configured Codepaths Edit in dojo/middleware.py
| Vulnerability | Configured Codepaths Edit |
|---|---|
| Description | Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml. |
🔴 Configured Codepaths Edit in dojo/middleware.py
| Vulnerability | Configured Codepaths Edit |
|---|---|
| Description | Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml. |
We've notified @mtesauro.
All finding details can be found in the DryRun Security Dashboard.
756938a to
c6e1403
Compare
|
Is there not a better/cleaner way to do this, for example by subclassing the social auth middleware? |
7a5b134 to
bf5b515
Compare
I adapted the code. Also, the standard login is always available as fallback. |
|
Thanks for the efforts @manuel-sommer , but did you consider other approaches? I am not yet convinced this middleware solution is the best way to implement this. When I look at the Django Social Auth app I see some pointers around customizing the middleware and exception handling:
Could you take a look and/or convince us that the proposed solution in this PR is the best fit? |
b0a5636 to
894e86f
Compare
Thank you for the guidance here @valentijnscholten. Learned something new :-) |
|
Looks nice and clean @manuel-sommer :-) I don't have a way to test this. Dis you manage to test these specific types or errors? We need to make sure we don't break the SSO for the Pro clients :-) |
a4072ab to
6c7768a
Compare
8aeb513 to
3230e5c
Compare
|
@valentijnscholten, I implemented a unittest, but don't have the chance to test all different possibilities in a real environment. |
3230e5c to
11556e7
Compare
|
@kiblik Are you good with this? Wanted to ask before we merged it since you had requested changes that haven't been dismissed. |
…ully (DefectDojo#13523) * 🎉 add middleware to handle social auth provider unavailability gracefully * - * - * update according to recommendation * add unittest * update * update on unittest * add integrationtest * update unittest description * udpate * udpate * fix unittest * add authforbidden
-->
