user_dependency#
- async nublado.controller.dependencies.user.user_dependency(context, x_auth_request_user, x_auth_request_token)#
Return the validated user for the given request.
Some user routes will have both a user token and a user name specified in the headers. We want to make sure that the user name matches the name of the user that owns the token.
- Returns:
Validated user metadata from Gafaelfawr.
- Return type:
- Raises:
InvalidTokenError – Raised if the user’s token is invalid.
PermissionDeniedError – Raised if the user’s token does not match the username in the header.
rubin.gafaelfawr.GafaelfawrError – Raised if user information could not be retrieved from Gafaelfawr.
rubin.repertoire.RepertoireError – Raised if Gafaelfawr could not be found in service discovery.
- Parameters:
context (
RequestContext)x_auth_request_user (
str)x_auth_request_token (
str)