async def get_auth(request):
    """Returns the user_id associated with a particular request.

    Args:
        request: aiohttp Request object.

    Returns:
        The user_id associated with the request, or None if no user is
        associated with the request.

    Raises:
        RuntimeError: Middleware is not installed
    """

    auth_val = request.get(AUTH_KEY)
    if auth_val:
        return auth_val

    auth_policy = request.get(POLICY_KEY)
    if auth_policy is None:
        raise RuntimeError('auth_middleware not installed')

    request[AUTH_KEY] = await auth_policy.get(request)
    return request[AUTH_KEY]
Returns the user_id associated with a particular request.

    Args:
        request: aiohttp Request object.

    Returns:
        The user_id associated with the request, or None if no user is
        associated with the request.

    Raises:
        RuntimeError: Middleware is not installed