'Ensure that the current request has been authenticated.'

def assert_authenticated(self):

    if (not self.context):
        msg = _('An    authenticated    call    was    made    and    there    is    no    request.context.    This    means    the    auth_context    middleware    is    not    in    place.    You    must    have    this    middleware    in    your    pipeline    to    perform    authenticated    calls')
        LOG.warning(msg)
        raise exception.Unauthorized(msg)
    if (not self.context.authenticated):
        raise exception.Unauthorized(_('auth_context    did    not    decode    anything    useful'))
