From 3d180ea6b1eac9b6123a0bcb81eea728094aea8b Mon Sep 17 00:00:00 2001 From: Sick Yoon Date: Thu, 14 Jul 2016 19:22:27 +0900 Subject: [PATCH] refactorign get_user_identity to authorized_userid --- aiohttp_security/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aiohttp_security/api.py b/aiohttp_security/api.py index a3607a6..327ad7e 100644 --- a/aiohttp_security/api.py +++ b/aiohttp_security/api.py @@ -26,7 +26,7 @@ def authorize(required=True, redirect_url=None, permission=None): coro = asyncio.coroutine(f) # get identity - identity = yield from get_user_identity(request) + identity = yield from authorized_userid(request) kwargs['identity'] = identity if required: @@ -89,7 +89,7 @@ def forget(request, response): @asyncio.coroutine -def get_user_identity(request): +def authorized_userid(request): identity_policy = request.app.get(IDENTITY_KEY) if identity_policy is None: return None @@ -119,7 +119,7 @@ def permits(request, permission, context=None): autz_policy = request.app.get(AUTZ_KEY) if autz_policy is None: return True - identity = yield from get_user_identity(request) + identity = yield from authorized_userid(request) access = yield from autz_policy.permits(identity, permission, context) return access