-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(TPA): Add middleware to handle TPA exceptions
- Loading branch information
1 parent
8e8c8a6
commit 6eb9427
Showing
7 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"""Backend for the third party authentication exception middleware.""" | ||
|
||
|
||
def get_tpa_exception_middleware(): | ||
"""Get the ExceptionMiddleware class.""" | ||
try: | ||
from third_party_auth.middleware import ExceptionMiddleware # pylint: disable=import-outside-toplevel | ||
except ImportError: | ||
from django.utils.deprecation import MiddlewareMixin as ExceptionMiddleware # pylint: disable=import-outside-toplevel | ||
return ExceptionMiddleware |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
Third Party Auth Exception Middleware definitions. | ||
""" | ||
|
||
from importlib import import_module | ||
|
||
from django.conf import settings | ||
|
||
|
||
def get_tpa_exception_middleware(): | ||
"""Get the ExceptionMiddleware class.""" | ||
backend_function = settings.EOX_CORE_THIRD_PARTY_AUTH_BACKEND | ||
backend = import_module(backend_function) | ||
return backend.get_tpa_exception_middleware() |
This file contains 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
This file contains 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
This file contains 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
This file contains 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