You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From discussion earlier in the week, I think our ideal state would be one where we have two protocols or abstract base classes that handle all of the logic currently expressed in various Dependencies on the FastAPI app. One Authenticator and one Authorizer, which are then configured in the Settings object on the server configuration, are passed into router construction as dependencies that will discover who a user is (if required) and what a user can do (if required).
classAuthenticator(ABC):
@abstractmethoddefauthenticate(request: Request) ->UserSessionState:
...
classAPIAuthenticator(Authenticator):
defauthenticate(request: Request) ->UserSessionState:
api_key=get_api_key(request)
ifnotapi_key:
raiseNotAuthenticatedError("No API key in request")
ifapi_Keynotinknown_users:
raiseNotAuthenticatedError("API key not recognised")
returnUserSessionState(known_users[api_key])
classOIDCAuthenticator(Authenticator):
defauthenticate(request: Request) ->UserSessionState:
jwt=self.jwt_client.decode(request.headers["Authorization"])
returnUserSessionState(jwt["sub"])
We currently support multiple IdPs. Everyone who I've discussed it with seems to agree that reducing it to one (which may in turn support N if you like) is a good idea. But it's a sweeping change that will have to be done carefully.
We can "Authorizer" AccesPolicy and it's in tiled.access_policy. Work is in progress (by @nmaytan) to make these a bit nicer.
From discussion earlier in the week, I think our ideal state would be one where we have two protocols or abstract base classes that handle all of the logic currently expressed in various Dependencies on the FastAPI app. One Authenticator and one Authorizer, which are then configured in the Settings object on the server configuration, are passed into router construction as dependencies that will discover who a user is (if required) and what a user can do (if required).
The text was updated successfully, but these errors were encountered: