コード例 #1
0
    def setup(self):
        self.auth_header_test = AuthHeader()
        self.auth_header = self.auth_header_test.get(self.client)
        self.namespace = self.auth_header['X-Test-Namespace']
        self.user = User.load(None, self.auth_header['X-User'])

        self.provisioner_id = None
コード例 #2
0
ファイル: auth.py プロジェクト: katyafervent/kqueen
def identity(payload):
    """
    Read user_id from payload and return User.

    Args:
        payload (dict): Request payload

    Returns:
        user: detected user

    """
    user_id = payload['identity']
    try:
        user = User.load(None, user_id)
    except Exception:
        user = None
    return user