Refactor auth handling wrapper
Compare changes
+ 75
− 59
@@ -6,23 +6,19 @@
@@ -54,6 +50,22 @@ def _get_auth_type():
@@ -87,6 +99,18 @@ def _validate_scitoken(request):
@@ -106,55 +130,47 @@ def _validate_x509(request):
This MR refactors the authentication wrapper authentication.validate
to make it easier to maintain. This effectively defines an 'api' for authentication types where they need to provide a '_request_has_xxx()method and a
_validate_xxx()` method.
This also improves the error handling by attempting all authentication methods, and only if they all fail do we return the first error encountered. This should enable users who have an invalid scitoken but a valid X.509 cred to gain access.