From d89f6b7e3d011f53b60dedf8a46d76f87e3af3e6 Mon Sep 17 00:00:00 2001
From: Grygorii Yermolenko <gyermolenko@gmail.com>
Date: Tue, 2 Jan 2018 14:31:19 +0200
Subject: [PATCH] Fix in demos related to async-await syntax (#123)

- remove 3.4 version from setup.py
- add cryprography package to requirements since it is used in
dictionary_auth
- add a few missed async kwords
---
 demo/database_auth/db_auth.py | 2 +-
 demo/database_auth/main.py    | 2 +-
 requirements-dev.txt          | 1 +
 setup.py                      | 1 -
 4 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/demo/database_auth/db_auth.py b/demo/database_auth/db_auth.py
index 82c29bd..be206f9 100644
--- a/demo/database_auth/db_auth.py
+++ b/demo/database_auth/db_auth.py
@@ -10,7 +10,7 @@ class DBAuthorizationPolicy(AbstractAuthorizationPolicy):
     def __init__(self, dbengine):
         self.dbengine = dbengine
 
-    def authorized_userid(self, identity):
+    async def authorized_userid(self, identity):
         async with self.dbengine as conn:
             where = sa.and_(db.users.c.login == identity,
                             sa.not_(db.users.c.disabled))
diff --git a/demo/database_auth/main.py b/demo/database_auth/main.py
index a2a6be8..3aafff5 100644
--- a/demo/database_auth/main.py
+++ b/demo/database_auth/main.py
@@ -13,7 +13,7 @@ from demo.db_auth import DBAuthorizationPolicy
 from demo.handlers import Web
 
 
-def init(loop):
+async def init(loop):
     redis_pool = await create_pool(('localhost', 6379))
     db_engine = await create_engine(user='aiohttp_security',
                                          password='aiohttp_security',
diff --git a/requirements-dev.txt b/requirements-dev.txt
index be4cefb..281a7e7 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -10,5 +10,6 @@ aiopg[sa]==0.13.1
 aioredis==1.0.0
 hiredis==0.2.0
 passlib==1.7.1
+cryptography==2.1.4
 aiohttp==2.3.7
 pytest-aiohttp==0.3.0
diff --git a/setup.py b/setup.py
index acee563..7b1be8c 100644
--- a/setup.py
+++ b/setup.py
@@ -42,7 +42,6 @@ setup(name='aiohttp-security',
           'Intended Audience :: Developers',
           'Programming Language :: Python',
           'Programming Language :: Python :: 3',
-          'Programming Language :: Python :: 3.4',
           'Programming Language :: Python :: 3.5',
           'Programming Language :: Python :: 3.6',
           'Topic :: Internet :: WWW/HTTP',