refactor: consolidate scattered SSO code into a dedicated dojo/sso/ package#14765
Open
Maffooch wants to merge 1 commit intoDefectDojo:devfrom
Open
refactor: consolidate scattered SSO code into a dedicated dojo/sso/ package#14765Maffooch wants to merge 1 commit intoDefectDojo:devfrom
Maffooch wants to merge 1 commit intoDefectDojo:devfrom
Conversation
SSO-related code (OAuth2, SAML2, OIDC, REMOTE_USER auth) was spread across dojo/middleware.py, dojo/context_processors.py, dojo/settings/settings.dist.py, dojo/user/views.py, dojo/templates/dojo/login.html, dojo/pipeline.py, dojo/remote_user.py, and dojo/settings/attribute-maps/. Move all of it into a single dojo/sso/ package so SSO logic lives in one place. No behavior change: settings names, URLs, and template output are preserved.
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.
Description
Code cleanup. SSO-related code (OAuth2, SAML2, OIDC, REMOTE_USER auth) was
previously spread across many shared files. This PR consolidates it into a
single dedicated
dojo/sso/Python package so SSO logic lives in one placeand the surrounding shared files (
dojo/urls.py,dojo/user/views.py,dojo/settings/settings.dist.py,dojo/middleware.py,dojo/context_processors.py,dojo/templates/dojo/login.html) only retainsmall, well-defined seams that hook into
dojo/sso/.No behavior changes — settings names, env-var names, URLs, and template
output are all preserved.
Changes
Files moved into
dojo/sso/:dojo/pipeline.py→dojo/sso/pipeline.pydojo/remote_user.py→dojo/sso/remote_user.pydojo/settings/attribute-maps/→dojo/sso/attribute_maps/Code extracted into new modules under
dojo/sso/:CustomSocialAuthExceptionMiddlewarefromdojo/middleware.py→dojo/sso/middleware.pydojo/context_processors.py→dojo/sso/context_processors.pyconfiguration from
dojo/settings/settings.dist.py→dojo/sso/settings.pydojo/user/views.py→dojo/sso/views.pydojo/templates/dojo/login.html→dojo/sso/templates/dojo/sso_login_buttons.htmlsocial_djangoanddjangosaml2URL routes →dojo/sso/urls.pyOther:
.dryrunsecurity.yamlupdated to reference new pathsunittests/test_remote_user.pyandunittests/test_social_auth_failure_handling.pyupdated for new import paths