username_path_dependency

async controller.dependencies.user.username_path_dependency(username, x_auth_request_user)

Validate and return the username in the request path.

Some routes take the uesrname in the request path and require the authenticated user match that username. This dependency performs that check.

Returns:

Validated username.

Return type:

str

Raises:

PermissionDeniedError – Raised if the username in the header added by Gafaelfawr doesn’t match the username in the path.

Parameters:
  • username (str)

  • x_auth_request_user (str)