128 Commits

Author SHA1 Message Date
Sam Bull
0346ec8b6d Update ci.yaml 2021-01-14 13:58:08 +00:00
Sam Bull
2f6bf14120 Add mypy to CI. 2020-12-18 18:14:01 +00:00
Sam Bull
aa184593f8 Merge branch 'ci' into typing 2020-12-18 18:12:01 +00:00
Sam Bull
cfa326b502 Update ci.yaml 2020-12-18 18:10:41 +00:00
Sam Bull
3836f750bc Delete .travis.yml 2020-12-18 18:08:53 +00:00
Sam Bull
117eb19e1e Create ci.yaml 2020-12-18 18:07:48 +00:00
Sam Bull
b3b5367460 Add type annotations. 2020-12-18 17:58:38 +00:00
dependabot-preview[bot]
2247eb72f9 Bump aiohttp from 3.7.2 to 3.7.3 (#363)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.7.2 to 3.7.3.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.7.2...v3.7.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-11 14:26:19 +02:00
dependabot-preview[bot]
75f317fe2d Bump aiopg[sa] from 1.0.0 to 1.1.0 (#367)
Bumps [aiopg[sa]](https://github.com/aio-libs/aiopg) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/aio-libs/aiopg/releases)
- [Changelog](https://github.com/aio-libs/aiopg/blob/master/CHANGES.txt)
- [Commits](https://github.com/aio-libs/aiopg/compare/v1.0.0...v1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-11 14:26:01 +02:00
dependabot-preview[bot]
2c17f8eb7a Bump cryptography from 3.3 to 3.3.1 (#366)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.3 to 3.3.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.3...3.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-11 12:52:01 +02:00
dependabot-preview[bot]
4623aa0cca Bump cryptography from 3.2.1 to 3.3 (#365)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.2.1 to 3.3.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.2.1...3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-12-09 10:15:15 +02:00
dependabot-preview[bot]
101c19f8c9 Bump aiohttp from 3.6.3 to 3.7.2 (#358)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.6.3 to 3.7.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.6.3...v3.7.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-13 10:31:12 +02:00
dependabot-preview[bot]
9131976657 Bump sphinx from 3.3.0 to 3.3.1 (#362)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.3.0...v3.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-13 10:22:24 +02:00
dependabot-preview[bot]
ba6d455e8d Bump sphinx from 3.2.1 to 3.3.0 (#361)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.2.1 to 3.3.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.2.1...v3.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-03 07:49:03 +02:00
dependabot-preview[bot]
ae2d4d8d25 Bump cryptography from 3.2 to 3.2.1 (#360)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.2 to 3.2.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.2...3.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-02 23:10:08 +02:00
dependabot-preview[bot]
57893dc274 Bump cryptography from 3.0 to 3.2 (#357)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.0 to 3.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.0...3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-31 20:12:48 +02:00
dependabot-preview[bot]
15068563cc Bump pytest from 6.1.1 to 6.1.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.1 to 6.1.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.1.1...6.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-29 05:45:09 +00:00
dependabot-preview[bot]
b78b525864 Bump aiohttp from 3.6.2 to 3.6.3
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.6.2 to 3.6.3.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.6.2...v3.6.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-13 05:48:23 +00:00
dependabot-preview[bot]
235330ae1e Bump passlib from 1.7.3 to 1.7.4
Bumps [passlib](https://passlib.readthedocs.io) from 1.7.3 to 1.7.4.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-09 05:46:46 +00:00
dependabot-preview[bot]
19c044f6ad Bump passlib from 1.7.2 to 1.7.3
Bumps [passlib](https://passlib.readthedocs.io) from 1.7.2 to 1.7.3.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-07 05:44:15 +00:00
dependabot-preview[bot]
8662c2ac8f Bump flake8 from 3.8.3 to 3.8.4
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.8.3 to 3.8.4.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.8.3...3.8.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-05 08:34:48 +00:00
dependabot-preview[bot]
c85f3b660d Bump pytest from 6.1.0 to 6.1.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.0 to 6.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.1.0...6.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-05 06:29:36 +00:00
dependabot-preview[bot]
9bb8c41786 Bump pytest from 6.0.2 to 6.1.0
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.0.2 to 6.1.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.0.2...6.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-28 05:51:44 +00:00
dependabot-preview[bot]
1751e8bf55 Bump pytest from 6.0.1 to 6.0.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.0.1...6.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-14 07:59:04 +00:00
dependabot-preview[bot]
06ef997a7c Bump coverage from 5.2.1 to 5.3
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.2.1 to 5.3.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.2.1...coverage-5.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-14 07:21:27 +00:00
dependabot-preview[bot]
65c94f624f Bump pytest-mock from 3.3.0 to 3.3.1
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.3.0...v3.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-27 05:50:50 +00:00
dependabot-preview[bot]
cb0aa10a25 Bump pytest-mock from 3.2.0 to 3.3.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.2.0...v3.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-24 06:30:52 +00:00
dependabot-preview[bot]
67816eb354 Bump pytest-cov from 2.10.0 to 2.10.1
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.10.0 to 2.10.1.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.10.0...v2.10.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-17 09:19:18 +00:00
dependabot-preview[bot]
9aa6c4eea3 Bump sphinx from 3.2.0 to 3.2.1
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.2.0...v3.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-17 07:18:04 +00:00
dependabot-preview[bot]
e41852d763 Bump sphinx from 3.1.2 to 3.2.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.1.2 to 3.2.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.1.2...v3.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-10 06:40:21 +00:00
dependabot-preview[bot]
80728460b9 Bump pytest from 6.0.0 to 6.0.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.0.0...6.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-31 06:54:27 +00:00
dependabot-preview[bot]
f86069281f Bump pytest from 5.4.3 to 6.0.0
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.4.3 to 6.0.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.4.3...6.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-29 06:43:00 +00:00
dependabot-preview[bot]
2b90dc7be2 Bump coverage from 5.2 to 5.2.1
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.2 to 5.2.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.2...coverage-5.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 06:51:27 +00:00
dependabot-preview[bot]
ea83d1c4e4 Bump cryptography from 2.9.2 to 3.0
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.9.2 to 3.0.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.9.2...3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-21 07:04:43 +00:00
dependabot-preview[bot]
05eef37ac6 Bump pytest-mock from 3.1.1 to 3.2.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.1.1...v3.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-20 11:27:44 +00:00
dependabot-preview[bot]
1b34d7de74 Bump sphinx from 3.1.1 to 3.1.2
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.1.1...v3.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-20 10:52:23 +00:00
dependabot-preview[bot]
cb242e9c09 Bump coverage from 5.1 to 5.2
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.1 to 5.2.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.1...coverage-5.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-20 07:04:16 +00:00
dependabot-preview[bot]
d903ffda50 Bump hiredis from 1.0.1 to 1.1.0
Bumps [hiredis](https://github.com/redis/hiredis-py) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/redis/hiredis-py/releases)
- [Changelog](https://github.com/redis/hiredis-py/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/hiredis-py/compare/v1.0.1...v1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-20 07:02:19 +00:00
dependabot-preview[bot]
2bc9eb88b1 Bump sphinx from 3.1.0 to 3.1.1
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.1.0...v3.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-15 08:46:15 +00:00
dependabot-preview[bot]
106c322b1a Bump pytest-cov from 2.9.0 to 2.10.0
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.9.0 to 2.10.0.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.9.0...v2.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-15 08:09:25 +00:00
dependabot-preview[bot]
e3c6d00665 Bump flake8 from 3.8.2 to 3.8.3
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.8.2 to 3.8.3.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.8.2...3.8.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-09 07:46:42 +00:00
dependabot-preview[bot]
78867ce3c1 Bump sphinx from 3.0.4 to 3.1.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.0.4 to 3.1.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.0.4...v3.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-09 07:42:38 +00:00
dependabot-preview[bot]
0133d23d4a Bump pytest-mock from 3.1.0 to 3.1.1
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.1.0...v3.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-05 06:33:18 +00:00
dependabot-preview[bot]
e00a5eeb49 Bump pytest from 5.4.2 to 5.4.3
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.4.2 to 5.4.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.4.2...5.4.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-03 08:03:53 +00:00
dependabot-preview[bot]
323d28b625 Bump sphinx from 3.0.3 to 3.0.4
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.0.3...v3.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-27 06:37:53 +00:00
dependabot-preview[bot]
c6a8fd5a0e Bump pytest-cov from 2.8.1 to 2.9.0
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.8.1 to 2.9.0.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.8.1...v2.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-25 08:54:00 +00:00
dependabot-preview[bot]
94ee8c2348 Bump flake8 from 3.8.1 to 3.8.2
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.8.1 to 3.8.2.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.8.1...3.8.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-25 06:59:30 +00:00
dependabot-preview[bot]
84277f5f2e Bump flake8 from 3.7.9 to 3.8.1
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.7.9 to 3.8.1.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.7.9...3.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-12 07:43:12 +00:00
dependabot-preview[bot]
c88e176c07 Bump pytest from 5.4.1 to 5.4.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.4.1 to 5.4.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.4.1...5.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-11 07:38:29 +00:00
dependabot-preview[bot]
2ffed0380f Bump sphinx from 3.0.2 to 3.0.3
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.0.2...v3.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-27 06:58:30 +00:00
dependabot-preview[bot]
f24a9b2914 Bump cryptography from 2.9.1 to 2.9.2
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.9.1 to 2.9.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.9.1...2.9.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-23 06:44:52 +00:00
dependabot-preview[bot]
52420cd2ba Bump cryptography from 2.9 to 2.9.1
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.9 to 2.9.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.9...2.9.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-22 06:43:34 +00:00
dependabot-preview[bot]
ac4bd3620f Bump sphinx from 3.0.1 to 3.0.2
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.0.1...v3.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 07:48:51 +00:00
dependabot-preview[bot]
46d13348e8 Bump pytest-mock from 3.0.0 to 3.1.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.0.0...v3.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 07:25:45 +00:00
dependabot-preview[bot]
aea0d5ba21 Bump coverage from 5.0.4 to 5.1
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.0.4 to 5.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.0.4...coverage-5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-13 08:19:34 +00:00
dependabot-preview[bot]
72e9a80fee Bump sphinx from 3.0.0 to 3.0.1
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v3.0.0...v3.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-13 06:55:37 +00:00
dependabot-preview[bot]
09f7b7e855 Bump sphinx from 2.4.4 to 3.0.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 2.4.4 to 3.0.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v2.4.4...v3.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-06 07:00:34 +00:00
dependabot-preview[bot]
0729ca10c8 Bump cryptography from 2.8 to 2.9
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.8 to 2.9.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.8...2.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-03 06:53:13 +00:00
dependabot-preview[bot]
173da83582 Bump pytest-mock from 2.0.0 to 3.0.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 2.0.0 to 3.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v2.0.0...v3.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-01 06:45:41 +00:00
dependabot-preview[bot]
7494e75fd1 Bump coverage from 5.0.3 to 5.0.4
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.0.3 to 5.0.4.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.0.3...coverage-5.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-17 06:32:16 +00:00
dependabot-preview[bot]
e5bd591a17 Bump pytest from 5.3.5 to 5.4.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.3.5 to 5.4.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.3.5...5.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-16 06:41:33 +00:00
dependabot-preview[bot]
50ed7703c1 Bump sphinx from 2.4.3 to 2.4.4
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 2.4.3 to 2.4.4.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v2.4.3...v2.4.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-06 06:29:35 +00:00
dependabot-preview[bot]
02dc750bc7 Bump sphinx from 2.4.2 to 2.4.3
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 2.4.2 to 2.4.3.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v2.4.2...v2.4.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-24 06:49:29 +00:00
dependabot-preview[bot]
c36a654393 Bump sphinx from 2.4.1 to 2.4.2
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v2.4.1...v2.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-19 06:32:37 +00:00
dependabot-preview[bot]
85df85a1c2 Bump sphinx from 2.4.0 to 2.4.1
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/2.0/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v2.4.0...v2.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 06:32:15 +00:00
dependabot-preview[bot]
859689f82c Bump sphinx from 2.3.1 to 2.4.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 2.3.1 to 2.4.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/2.0/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v2.3.1...v2.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-10 06:49:40 +00:00
dependabot-preview[bot]
e4bb720132 Bump pytest from 5.3.4 to 5.3.5
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.3.4 to 5.3.5.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.3.4...5.3.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 06:30:24 +00:00
dependabot-preview[bot]
ee8b55af0f Bump pytest from 5.3.3 to 5.3.4
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.3.3 to 5.3.4.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.3.3...5.3.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-21 06:41:24 +00:00
dependabot-preview[bot]
f6bb8f1564 Bump pytest from 5.3.2 to 5.3.3
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.3.2 to 5.3.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.3.2...5.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-20 06:56:57 +00:00
dependabot-preview[bot]
56cc1b46be Bump coverage from 5.0.2 to 5.0.3
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.0.2 to 5.0.3.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.0.2...coverage-5.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 07:30:45 +00:00
dependabot-preview[bot]
6599dd4250 Bump pytest-mock from 1.13.0 to 2.0.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 1.13.0 to 2.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v1.13.0...v2.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 07:29:59 +00:00
dependabot-preview[bot]
9ea0ae319a Bump coverage from 5.0.1 to 5.0.2
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.0.1...coverage-5.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 06:44:31 +00:00
dependabot-preview[bot]
14c03dba69 Bump coverage from 5.0 to 5.0.1
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.0 to 5.0.1.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.0...coverage-5.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-23 07:55:52 +00:00
dependabot-preview[bot]
fd0228240a Bump sphinx from 2.3.0 to 2.3.1
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v2.3.0...v2.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-23 06:37:59 +00:00
dependabot-preview[bot]
88ecee7ee1 Bump pytest from 5.3.1 to 5.3.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.3.1 to 5.3.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.3.1...5.3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-16 11:14:26 +00:00
dependabot-preview[bot]
cc1eaf6c92 Bump sphinx from 2.2.2 to 2.3.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 2.2.2 to 2.3.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v2.2.2...v2.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-16 09:03:35 +00:00
dependabot-preview[bot]
74281bd7e4 Bump coverage from 4.5.4 to 5.0
Bumps [coverage](https://github.com/nedbat/coveragepy) from 4.5.4 to 5.0.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-4.5.4...coverage-5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-16 06:43:50 +00:00
Thijs Triemstra
9f9ca363c9 hash is a reserved symbol name (#282) 2019-12-10 23:10:54 +02:00
dependabot-preview[bot]
8dfe89594a Bump pytest-mock from 1.12.1 to 1.13.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 1.12.1 to 1.13.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v1.12.1...v1.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-06 06:39:35 +00:00
dependabot-preview[bot]
eedb79b560 Bump sphinx from 2.2.1 to 2.2.2
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v2.2.1...v2.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-03 08:11:44 +00:00
dependabot-preview[bot]
139d8d9974 Bump aioredis from 1.3.0 to 1.3.1
Bumps [aioredis](https://github.com/aio-libs/aioredis) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/aio-libs/aioredis/releases)
- [Changelog](https://github.com/aio-libs/aioredis/blob/master/CHANGES.txt)
- [Commits](https://github.com/aio-libs/aioredis/compare/v1.3.0...v1.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-03 07:00:24 +00:00
dependabot-preview[bot]
e3eecf1bd0 Bump pytest from 5.3.0 to 5.3.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.3.0 to 5.3.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.3.0...5.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-27 06:36:45 +00:00
dependabot-preview[bot]
e5ce21edcf Bump passlib from 1.7.1 to 1.7.2
Bumps [passlib](https://bitbucket.org/ecollins/passlib) from 1.7.1 to 1.7.2.
- [Commits](https://bitbucket.org/ecollins/passlib/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-25 06:43:02 +00:00
dependabot-preview[bot]
21bba9ec12 Bump pytest-mock from 1.12.0 to 1.12.1
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 1.12.0 to 1.12.1.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v1.12.0...v1.12.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-21 06:33:55 +00:00
dependabot-preview[bot]
1a80a79b69 Bump pytest-mock from 1.11.2 to 1.12.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 1.11.2 to 1.12.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v1.11.2...v1.12.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-20 06:59:16 +00:00
dependabot-preview[bot]
ce30bd4544 Bump pytest from 5.2.4 to 5.3.0
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.2.4 to 5.3.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.2.4...5.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-20 06:32:26 +00:00
dependabot-preview[bot]
99408d151e Bump pytest from 5.2.3 to 5.2.4
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.2.3 to 5.2.4.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.2.3...5.2.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-18 06:43:57 +00:00
dependabot-preview[bot]
11c5b691b7 Bump pytest from 5.2.2 to 5.2.3
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.2.2 to 5.2.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.2.2...5.2.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-15 06:35:49 +00:00
dependabot-preview[bot]
0ae8668ad2 Bump hiredis from 1.0.0 to 1.0.1 (#274)
Bumps [hiredis](https://github.com/redis/hiredis-py) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/redis/hiredis-py/releases)
- [Changelog](https://github.com/redis/hiredis-py/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/hiredis-py/compare/v1.0.0...v1.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-14 16:25:29 +02:00
dependabot-preview[bot]
f58d9b5c7a Bump aiohttp-session from 2.8.0 to 2.9.0
Bumps [aiohttp-session](https://github.com/aio-libs/aiohttp_session) from 2.8.0 to 2.9.0.
- [Release notes](https://github.com/aio-libs/aiohttp_session/releases)
- [Changelog](https://github.com/aio-libs/aiohttp-session/blob/master/CHANGES.txt)
- [Commits](https://github.com/aio-libs/aiohttp_session/compare/v2.8.0...v2.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-05 08:50:33 +00:00
dependabot-preview[bot]
7e15f918b7 Bump flake8 from 3.7.8 to 3.7.9
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.7.8 to 3.7.9.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.7.8...3.7.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-29 06:39:50 +00:00
dependabot-preview[bot]
0b16e3a745 Bump sphinx from 2.2.0 to 2.2.1
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v2.2.0...v2.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-28 07:15:59 +00:00
dependabot-preview[bot]
c5f4c63892 Bump pytest from 5.2.1 to 5.2.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.2.1...5.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-25 06:38:42 +00:00
dependabot-preview[bot]
94c7af6c8d Bump pytest-mock from 1.11.1 to 1.11.2
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 1.11.1 to 1.11.2.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v1.11.1...v1.11.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-24 06:52:04 +00:00
dependabot-preview[bot]
775b1ccffc Bump cryptography from 2.7 to 2.8
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.7 to 2.8.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.7...2.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-17 14:32:54 +00:00
dependabot-preview[bot]
8e2d1bdf6b Bump aiohttp from 3.6.1 to 3.6.2
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.6.1 to 3.6.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.6.1...v3.6.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-10 11:25:52 +00:00
dependabot-preview[bot]
be08d06057 Bump pytest from 5.2.0 to 5.2.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.2.0...5.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-07 14:26:29 +00:00
dependabot-preview[bot]
1bcf612222 Bump pytest-cov from 2.7.1 to 2.8.1
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.7.1 to 2.8.1.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.7.1...v2.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-07 10:32:14 +00:00
dependabot-preview[bot]
96ee5d2cb3 Bump pytest-mock from 1.11.0 to 1.11.1
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 1.11.0 to 1.11.1.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v1.11.0...v1.11.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-07 08:21:34 +00:00
dependabot-preview[bot]
534043e109 Bump pytest from 5.1.3 to 5.2.0
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.1.3 to 5.2.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.1.3...5.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-30 08:23:29 +00:00
dependabot-preview[bot]
4572e2c23c Bump pytest-mock from 1.10.4 to 1.11.0
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 1.10.4 to 1.11.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/1.10.4...v1.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-30 07:57:06 +00:00
dependabot-preview[bot]
0cd61422fc Bump aioredis from 1.2.0 to 1.3.0
Bumps [aioredis](https://github.com/aio-libs/aioredis) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/aio-libs/aioredis/releases)
- [Changelog](https://github.com/aio-libs/aioredis/blob/master/CHANGES.txt)
- [Commits](https://github.com/aio-libs/aioredis/compare/v1.2.0...v1.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-25 08:00:25 +00:00
dependabot-preview[bot]
5667dfd0e1 Bump aiopg from 0.16.0 to 1.0.0
Bumps [aiopg](https://github.com/aio-libs/aiopg) from 0.16.0 to 1.0.0.
- [Release notes](https://github.com/aio-libs/aiopg/releases)
- [Changelog](https://github.com/aio-libs/aiopg/blob/master/CHANGES.txt)
- [Commits](https://github.com/aio-libs/aiopg/compare/v0.16.0...v1.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-24 06:56:31 +00:00
dependabot-preview[bot]
cb300bb5ee Bump pytest from 5.1.2 to 5.1.3
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.1.2 to 5.1.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.1.2...5.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-23 07:18:19 +00:00
dependabot-preview[bot]
a25d215b43 Bump aiohttp from 3.6.0 to 3.6.1 (#258)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.6.0 to 3.6.1.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.6.0...v3.6.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-20 17:33:59 +03:00
dependabot-preview[bot]
74345a25ef Bump aiohttp from 3.4.4 to 3.6.0
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.4.4 to 3.6.0.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.4.4...v3.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-18 12:29:12 +00:00
dependabot-preview[bot]
3cd857dca8 Bump aiohttp-session from 2.7.0 to 2.8.0
Bumps [aiohttp-session](https://github.com/aio-libs/aiohttp_session) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/aio-libs/aiohttp_session/releases)
- [Changelog](https://github.com/aio-libs/aiohttp-session/blob/master/CHANGES.txt)
- [Commits](https://github.com/aio-libs/aiohttp_session/compare/v2.7.0...v2.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-18 11:33:06 +00:00
dependabot-preview[bot]
9007a7ca55 Bump coverage from 4.5.2 to 4.5.4
Bumps [coverage](https://github.com/nedbat/coveragepy) from 4.5.2 to 4.5.4.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-4.5.2...coverage-4.5.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-17 11:26:21 +00:00
dependabot-preview[bot]
b87e58efe7 Bump sphinx from 1.8.2 to 2.2.0
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 1.8.2 to 2.2.0.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v1.8.2...v2.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-17 09:36:19 +00:00
dependabot-preview[bot]
ba6fbd0708 Bump aiopg from 0.15.0 to 0.16.0
Bumps [aiopg](https://github.com/aio-libs/aiopg) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/aio-libs/aiopg/releases)
- [Commits](https://github.com/aio-libs/aiopg/compare/v0.15.0...v0.16.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-17 07:09:31 +00:00
dependabot-preview[bot]
342991c21d Bump flake8 from 3.6.0 to 3.7.8
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.6.0 to 3.7.8.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.6.0...3.7.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-17 06:59:58 +00:00
dependabot-preview[bot]
c3e7a4c8bb Bump pytest from 4.0.2 to 5.1.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 4.0.2 to 5.1.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/4.0.2...5.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-16 21:31:56 +00:00
dependabot-preview[bot]
c81b89a9e7 Bump pytest-cov from 2.6.0 to 2.7.1 (#249)
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.6.0 to 2.7.1.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.6.0...v2.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-17 00:03:44 +03:00
dependabot-preview[bot]
30b07a6033 Bump cryptography from 2.4.2 to 2.7
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.4.2 to 2.7.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.4.2...2.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-16 20:57:12 +00:00
dependabot-preview[bot]
e745334204 Bump hiredis from 0.3.0 to 1.0.0
Bumps [hiredis](https://github.com/redis/hiredis-py) from 0.3.0 to 1.0.0.
- [Release notes](https://github.com/redis/hiredis-py/releases)
- [Changelog](https://github.com/redis/hiredis-py/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/hiredis-py/compare/v0.3.0...v1.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-16 20:12:01 +00:00
Andrew Svetlov
05ebfe1142 Reduce build matrix 2019-09-16 22:07:46 +03:00
dependabot-preview[bot]
22a3bd36e1 Bump pytest-mock from 1.10.0 to 1.10.4
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 1.10.0 to 1.10.4.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v1.10.0...1.10.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-16 18:56:31 +00:00
pyup.io bot
901cf1a7e0 Scheduled weekly dependency update for week 50 (#203)
* Update pytest from 4.0.1 to 4.0.2

* Update pyjwt from 1.7.0 to 1.7.1
2018-12-17 19:40:55 +02:00
pyup.io bot
82cff61379 Scheduled weekly dependency update for week 48 (#200)
* Update pytest from 3.10.1 to 4.0.1

* Update coverage from 4.5.1 to 4.5.2

* Update hiredis from 0.2.0 to 0.3.0

* Update cryptography from 2.4.1 to 2.4.2

* Update pyjwt from 1.6.4 to 1.7.0
2018-12-03 19:54:17 +02:00
pyup.io bot
cb0e17d9c5 Scheduled weekly dependency update for week 45 (#197)
* Update pytest from 3.10.0 to 3.10.1

* Update sphinx from 1.8.1 to 1.8.2

* Update cryptography from 2.3.1 to 2.4.1
2018-11-13 00:19:08 +02:00
pyup.io bot
27c95969c2 Update pytest from 3.9.3 to 3.10.0 (#196) 2018-11-06 10:59:52 +02:00
pyup.io bot
0b2e3cd6c0 Scheduled weekly dependency update for week 43 (#195)
* Update flake8 from 3.5.0 to 3.6.0

* Update pytest from 3.9.1 to 3.9.3

* Update aioredis from 1.1.0 to 1.2.0
2018-10-30 14:50:30 +01:00
pyup.io bot
dab8b6f248 Update pytest from 3.8.2 to 3.9.1 (#194) 2018-10-23 07:56:11 +03:00
pyup.io bot
460ddfd50c Scheduled weekly dependency update for week 41 (#193)
* Update async-timeout from 3.0 to 3.0.1

* Update aiohttp-session from 2.6.0 to 2.7.0
2018-10-15 23:28:04 +03:00
pyup.io bot
354b1a8995 Update pytest from 3.8.1 to 3.8.2 (#192) 2018-10-09 10:27:19 +03:00
imgbot[bot]
9b428003d0 [ImgBot] optimizes images (#191)
/docs/_static/aiohttp-icon-128x128.png -- 18.93kb -> 17.33kb (8.43%)
2018-10-06 22:40:24 +03:00
pyup.io bot
124c83ee24 Scheduled weekly dependency update for week 38 (#190)
* Update pytest from 3.7.4 to 3.8.1

* Update pytest-cov from 2.5.1 to 2.6.0

* Update sphinx from 1.7.8 to 1.8.1

* Update aiohttp-session from 2.5.1 to 2.6.0

* Update aiohttp from 3.4.2 to 3.4.4
2018-09-28 08:20:32 +03:00
Andrew Svetlov
74381e8cc2 Fix badges in README 2018-09-27 10:36:27 +03:00
26 changed files with 257 additions and 170 deletions

38
.github/workflows/ci.yaml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Test
on: pull_request
jobs:
mypy:
name: Check annotations with Mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install aiohttp mypy
- run: mypy
test:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements-dev.txt
pip install codecov
- name: Run tests
run: |
make coverage
- name: Upload coverage to Codecov
run: |
codecov

37
.mypy.ini Normal file
View File

@@ -0,0 +1,37 @@
[mypy]
files = aiohttp_security, demo, tests
check_untyped_defs = True
follow_imports_for_stubs = True
disallow_any_decorated = True
disallow_any_generics = True
disallow_incomplete_defs = True
disallow_subclassing_any = True
disallow_untyped_calls = True
disallow_untyped_decorators = True
disallow_untyped_defs = True
implicit_reexport = False
no_implicit_optional = True
show_error_codes = True
strict_equality = True
warn_incomplete_stub = True
warn_redundant_casts = True
warn_unreachable = True
warn_unused_ignores = True
disallow_any_unimported = True
warn_return_any = True
[mypy-aiohttp_security.abc.*]
disallow_any_decorated = False
[mypy-tests.*]
disallow_any_decorated = False
disallow_untyped_defs = False
[mypy-aiopg.*]
ignore_missing_imports = True
[mypy-aioredis.*]
ignore_missing_imports = True
[mypy-passlib.*]
ignore_missing_imports = True

View File

@@ -1,39 +0,0 @@
language: python
python:
- 3.5
- 3.6
- 3.7-dev
- nightly
matrix:
allow_failures:
- python: 3.7-dev
- python: nightly
install:
- pip install --upgrade pip
- pip install -r requirements-dev.txt
- pip install codecov
script:
- make coverage
after_success:
- codecov
env:
matrix:
- PYTHONASYNCIODEBUG=x
- PYTHONASYNCIODEBUG=
deploy:
provider: pypi
user: aio-libs-bot
password:
secure: "fHbpT6AuRM+K6hg0nWT7ov/qJAAFJ7N5Mot1Z02QVHv9+XXJsqSmzJHMyv4FNWSO+IG9ulJ/wrVpQ/wr5S1FiCVJYpMFJP/71fqT7MbrgUg+ovbGrs1AfJHHQtVc91Az9Yl2nP+wzJCplJIuxO8IVjKHS87QxupzMHapo97ItYM6yvCNzIP+3JjvZyl5/ocqdUpl4KiS/tzXbiaBSlVgmI/013EbD5U36wcz2AAszTcBzKTDJh0BF4wr4brHnVPKr4gRSZPZRYduZ7WXh0rJt/aGyNGm9siYkKhuE+pzd/6vIbN3keKEhAjafCl4+Z3a0eL0ACyt8CBCBHf9/n4KYm+KPwLe3NYWKkO6qCJpZ+bMNfQInKiEoWJx9KDaKjdCVivlKY+abaJiF/thO4udunn3PfPz2O8MlkZRoTVqASN1sP60cULTlxfLi8x0RVqMKIHejNQi/AN8/4poCPFfFOOia/WQqq1pD45vJh8pNxsc6IEAjhHUgvMDnK0DBkEs4i2catZKc2YPEjgAkvplvTE4tH8Tzyj5EvMwM56h2zfByeKs9ojkvzyhPLhWq7d8JTPWPAyj72FsrpGm12cLU/E9g9KKj6Hg5E3F0+V2Zs7wXc+fT1ovC5/NRL2WpT2+k1wF/9Q7ZrbQ9InunHXYU7GJCFzRE8XlcRsBGPcR3Ls="
distributions: "sdist bdist_wheel"
on:
tags: true
all_branches: true
python: 3.6
condition: $PYTHONASYNCIODEBUG = ""

View File

@@ -1,7 +1,7 @@
aiohttp_security aiohttp_security
================ ================
.. image:: https://travis-ci.org/aio-libs/aiohttp-security.svg?branch=master .. image:: https://travis-ci.com/aio-libs/aiohttp-security.svg?branch=master
:target: https://travis-ci.org/aio-libs/aiohttp-security :target: https://travis-ci.com/aio-libs/aiohttp-security
.. image:: https://codecov.io/github/aio-libs/aiohttp-security/coverage.svg?branch=master .. image:: https://codecov.io/github/aio-libs/aiohttp-security/coverage.svg?branch=master
:target: https://codecov.io/github/aio-libs/aiohttp-security :target: https://codecov.io/github/aio-libs/aiohttp-security
.. image:: https://readthedocs.org/projects/aiohttp-security/badge/?version=latest .. image:: https://readthedocs.org/projects/aiohttp-security/badge/?version=latest

View File

@@ -1,4 +1,8 @@
import abc import abc
from enum import Enum
from typing import Any, Optional, Union
from aiohttp import web
# see http://plope.com/pyramid_auth_design_api_postmortem # see http://plope.com/pyramid_auth_design_api_postmortem
@@ -6,13 +10,14 @@ import abc
class AbstractIdentityPolicy(metaclass=abc.ABCMeta): class AbstractIdentityPolicy(metaclass=abc.ABCMeta):
@abc.abstractmethod @abc.abstractmethod
async def identify(self, request): async def identify(self, request: web.Request) -> Optional[str]:
"""Return the claimed identity of the user associated request or """Return the claimed identity of the user associated request or
``None`` if no identity can be found associated with the request.""" ``None`` if no identity can be found associated with the request."""
pass pass
@abc.abstractmethod @abc.abstractmethod
async def remember(self, request, response, identity, **kwargs): async def remember(self, request: web.Request, response: web.StreamResponse,
identity: str, **kwargs: Any) -> None:
"""Remember identity. """Remember identity.
Modify response object by filling it's headers with remembered user. Modify response object by filling it's headers with remembered user.
@@ -23,7 +28,7 @@ class AbstractIdentityPolicy(metaclass=abc.ABCMeta):
pass pass
@abc.abstractmethod @abc.abstractmethod
async def forget(self, request, response): async def forget(self, request: web.Request, response: web.StreamResponse) -> None:
""" Modify response which can be used to 'forget' the """ Modify response which can be used to 'forget' the
current identity on subsequent requests.""" current identity on subsequent requests."""
pass pass
@@ -32,7 +37,8 @@ class AbstractIdentityPolicy(metaclass=abc.ABCMeta):
class AbstractAuthorizationPolicy(metaclass=abc.ABCMeta): class AbstractAuthorizationPolicy(metaclass=abc.ABCMeta):
@abc.abstractmethod @abc.abstractmethod
async def permits(self, identity, permission, context=None): async def permits(self, identity: str, permission: Union[str, Enum],
context: Any = None) -> bool:
"""Check user permissions. """Check user permissions.
Return True if the identity is allowed the permission in the Return True if the identity is allowed the permission in the
@@ -41,7 +47,7 @@ class AbstractAuthorizationPolicy(metaclass=abc.ABCMeta):
pass pass
@abc.abstractmethod @abc.abstractmethod
async def authorized_userid(self, identity): async def authorized_userid(self, identity: str) -> Optional[str]:
"""Retrieve authorized user id. """Retrieve authorized user id.
Return the user_id of the user identified by the identity Return the user_id of the user identified by the identity

View File

@@ -1,15 +1,23 @@
import enum import enum
import warnings import warnings
from aiohttp import web
from aiohttp_security.abc import (AbstractIdentityPolicy,
AbstractAuthorizationPolicy)
from functools import wraps from functools import wraps
from typing import Any, Callable, Optional, TypeVar, Union
from aiohttp import web
from aiohttp_security.abc import AbstractAuthorizationPolicy, AbstractIdentityPolicy
IDENTITY_KEY = 'aiohttp_security_identity_policy' IDENTITY_KEY = 'aiohttp_security_identity_policy'
AUTZ_KEY = 'aiohttp_security_autz_policy' AUTZ_KEY = 'aiohttp_security_autz_policy'
# _AIP/_AAP are shorthand for Optional[policy] when we retrieve from request.
_AAP = Optional[AbstractAuthorizationPolicy]
_AIP = Optional[AbstractIdentityPolicy]
_Handler = TypeVar('_Handler', bound=Union[Callable[[web.Request], Any],
Callable[[object, web.Request], Any]])
async def remember(request, response, identity, **kwargs):
async def remember(request: web.Request, response: web.StreamResponse,
identity: str, **kwargs: Any) -> None:
"""Remember identity into response. """Remember identity into response.
The action is performed by identity_policy.remember() The action is performed by identity_policy.remember()
@@ -30,7 +38,7 @@ async def remember(request, response, identity, **kwargs):
await identity_policy.remember(request, response, identity, **kwargs) await identity_policy.remember(request, response, identity, **kwargs)
async def forget(request, response): async def forget(request: web.Request, response: web.StreamResponse) -> None:
"""Forget previously remembered identity. """Forget previously remembered identity.
Usually it clears cookie or server-side storage to forget user Usually it clears cookie or server-side storage to forget user
@@ -47,9 +55,9 @@ async def forget(request, response):
await identity_policy.forget(request, response) await identity_policy.forget(request, response)
async def authorized_userid(request): async def authorized_userid(request: web.Request) -> Optional[str]:
identity_policy = request.config_dict.get(IDENTITY_KEY) identity_policy: _AIP = request.config_dict.get(IDENTITY_KEY)
autz_policy = request.config_dict.get(AUTZ_KEY) autz_policy: _AAP = request.config_dict.get(AUTZ_KEY)
if identity_policy is None or autz_policy is None: if identity_policy is None or autz_policy is None:
return None return None
identity = await identity_policy.identify(request) identity = await identity_policy.identify(request)
@@ -59,20 +67,21 @@ async def authorized_userid(request):
return user_id return user_id
async def permits(request, permission, context=None): async def permits(request: web.Request, permission: Union[str, enum.Enum],
context: Any = None) -> bool:
assert isinstance(permission, (str, enum.Enum)), permission assert isinstance(permission, (str, enum.Enum)), permission
assert permission assert permission
identity_policy = request.config_dict.get(IDENTITY_KEY) identity_policy: _AIP = request.config_dict.get(IDENTITY_KEY)
autz_policy = request.config_dict.get(AUTZ_KEY) autz_policy: _AAP = request.config_dict.get(AUTZ_KEY)
if identity_policy is None or autz_policy is None: if identity_policy is None or autz_policy is None:
return True return True
identity = await identity_policy.identify(request) identity = await identity_policy.identify(request)
# non-registered user still may has some permissions # non-registered user still may have some permissions
access = await autz_policy.permits(identity, permission, context) access = await autz_policy.permits(identity, permission, context)
return access return access
async def is_anonymous(request): async def is_anonymous(request: web.Request) -> bool:
"""Check if user is anonymous. """Check if user is anonymous.
User is considered anonymous if there is not identity User is considered anonymous if there is not identity
@@ -87,7 +96,7 @@ async def is_anonymous(request):
return False return False
async def check_authorized(request): async def check_authorized(request: web.Request) -> str:
"""Checker that raises HTTPUnauthorized for anonymous users. """Checker that raises HTTPUnauthorized for anonymous users.
""" """
userid = await authorized_userid(request) userid = await authorized_userid(request)
@@ -96,31 +105,32 @@ async def check_authorized(request):
return userid return userid
def login_required(fn): def login_required(fn: _Handler) -> _Handler:
"""Decorator that restrict access only for authorized users. """Decorator that restrict access only for authorized users.
User is considered authorized if authorized_userid User is considered authorized if authorized_userid
returns some value. returns some value.
""" """
@wraps(fn) @wraps(fn)
async def wrapped(*args, **kwargs): async def wrapped(*args: Union[object, web.Request]) -> Any:
request = args[-1] request = args[-1]
if not isinstance(request, web.BaseRequest): if not isinstance(request, web.Request):
msg = ("Incorrect decorator usage. " msg = ("Incorrect decorator usage. "
"Expecting `def handler(request)` " "Expecting `def handler(request)` "
"or `def handler(self, request)`.") "or `def handler(self, request)`.")
raise RuntimeError(msg) raise RuntimeError(msg)
await check_authorized(request) await check_authorized(request)
return await fn(*args, **kwargs) return await fn(*args) # type: ignore[arg-type]
warnings.warn("login_required decorator is deprecated, " warnings.warn("login_required decorator is deprecated, "
"use check_authorized instead", "use check_authorized instead",
DeprecationWarning) DeprecationWarning)
return wrapped return wrapped # type: ignore[return-value]
async def check_permission(request, permission, context=None): async def check_permission(request: web.Request, permission: Union[str, enum.Enum],
context: Any = None) -> None:
"""Checker that passes only to authoraised users with given permission. """Checker that passes only to authoraised users with given permission.
If user is not authorized - raises HTTPUnauthorized, If user is not authorized - raises HTTPUnauthorized,
@@ -134,10 +144,7 @@ async def check_permission(request, permission, context=None):
raise web.HTTPForbidden() raise web.HTTPForbidden()
def has_permission( def has_permission(permission: Union[str, enum.Enum], context: Any = None): # type: ignore
permission,
context=None,
):
"""Decorator that restricts access only for authorized users """Decorator that restricts access only for authorized users
with correct permissions. with correct permissions.
@@ -145,11 +152,11 @@ def has_permission(
if user is authorized and does not have permission - if user is authorized and does not have permission -
raises HTTPForbidden. raises HTTPForbidden.
""" """
def wrapper(fn): def wrapper(fn): # type: ignore
@wraps(fn) @wraps(fn)
async def wrapped(*args, **kwargs): async def wrapped(*args, **kwargs): # type: ignore
request = args[-1] request = args[-1]
if not isinstance(request, web.BaseRequest): if not isinstance(request, web.Request):
msg = ("Incorrect decorator usage. " msg = ("Incorrect decorator usage. "
"Expecting `def handler(request)` " "Expecting `def handler(request)` "
"or `def handler(self, request)`.") "or `def handler(self, request)`.")
@@ -166,7 +173,8 @@ def has_permission(
return wrapper return wrapper
def setup(app, identity_policy, autz_policy): def setup(app: web.Application, identity_policy: AbstractIdentityPolicy,
autz_policy: AbstractAuthorizationPolicy) -> None:
assert isinstance(identity_policy, AbstractIdentityPolicy), identity_policy assert isinstance(identity_policy, AbstractIdentityPolicy), identity_policy
assert isinstance(autz_policy, AbstractAuthorizationPolicy), autz_policy assert isinstance(autz_policy, AbstractAuthorizationPolicy), autz_policy

View File

@@ -5,28 +5,32 @@ more handy.
""" """
from aiohttp import web
from typing import Any, NewType, Optional, Union, cast
from .abc import AbstractIdentityPolicy from .abc import AbstractIdentityPolicy
_Sentinel = NewType('_Sentinel', object)
sentinel = object() sentinel = _Sentinel(object())
class CookiesIdentityPolicy(AbstractIdentityPolicy): class CookiesIdentityPolicy(AbstractIdentityPolicy):
def __init__(self): def __init__(self) -> None:
self._cookie_name = 'AIOHTTP_SECURITY' self._cookie_name = 'AIOHTTP_SECURITY'
self._max_age = 30 * 24 * 3600 self._max_age = 30 * 24 * 3600
async def identify(self, request): async def identify(self, request: web.Request) -> Optional[str]:
identity = request.cookies.get(self._cookie_name) return request.cookies.get(self._cookie_name)
return identity
async def remember(self, request, response, identity, max_age=sentinel, async def remember(self, request: web.Request, response: web.StreamResponse,
**kwargs): identity: str, max_age: Union[_Sentinel, Optional[int]] = sentinel,
**kwargs: Any) -> None:
if max_age is sentinel: if max_age is sentinel:
max_age = self._max_age max_age = self._max_age
max_age = cast(Optional[int], max_age)
response.set_cookie(self._cookie_name, identity, response.set_cookie(self._cookie_name, identity,
max_age=max_age, **kwargs) max_age=max_age, **kwargs)
async def forget(self, request, response): async def forget(self, request: web.Request, response: web.StreamResponse) -> None:
response.del_cookie(self._cookie_name) response.del_cookie(self._cookie_name)

View File

@@ -2,12 +2,17 @@
""" """
from typing import Optional
from aiohttp import web
from .abc import AbstractIdentityPolicy from .abc import AbstractIdentityPolicy
try: try:
import jwt import jwt
HAS_JWT = True
except ImportError: # pragma: no cover except ImportError: # pragma: no cover
jwt = None HAS_JWT = False
AUTH_HEADER_NAME = 'Authorization' AUTH_HEADER_NAME = 'Authorization'
@@ -15,21 +20,21 @@ AUTH_SCHEME = 'Bearer '
class JWTIdentityPolicy(AbstractIdentityPolicy): class JWTIdentityPolicy(AbstractIdentityPolicy):
def __init__(self, secret, algorithm='HS256'): def __init__(self, secret: str, algorithm: str = 'HS256'):
if jwt is None: if not HAS_JWT:
raise RuntimeError('Please install `PyJWT`') raise RuntimeError('Please install `PyJWT`')
self.secret = secret self.secret = secret
self.algorithm = algorithm self.algorithm = algorithm
async def identify(self, request): async def identify(self, request: web.Request) -> Optional[str]:
header_identity = request.headers.get(AUTH_HEADER_NAME) header_identity = request.headers.get(AUTH_HEADER_NAME)
if header_identity is None: if header_identity is None:
return return None
if not header_identity.startswith(AUTH_SCHEME): if not header_identity.startswith(AUTH_SCHEME):
raise ValueError('Invalid authorization scheme. ' + raise ValueError('Invalid authorization scheme. ' +
'Should be `Bearer <token>`') 'Should be `{}<token>`'.format(AUTH_SCHEME))
token = header_identity.split(' ')[1].strip() token = header_identity.split(' ')[1].strip()
@@ -38,8 +43,9 @@ class JWTIdentityPolicy(AbstractIdentityPolicy):
algorithms=[self.algorithm]) algorithms=[self.algorithm])
return identity return identity
async def remember(self, *args, **kwargs): # pragma: no cover async def remember(self, request: web.Request, response: web.StreamResponse,
identity: str, **kwargs: None) -> None:
pass pass
async def forget(self, request, response): # pragma: no cover async def forget(self, request: web.Request, response: web.StreamResponse) -> None:
pass pass

View File

View File

@@ -4,6 +4,7 @@ aiohttp_session.setup() should be called on application initialization
to configure aiohttp_session properly. to configure aiohttp_session properly.
""" """
from aiohttp import web
try: try:
from aiohttp_session import get_session from aiohttp_session import get_session
HAS_AIOHTTP_SESSION = True HAS_AIOHTTP_SESSION = True
@@ -15,21 +16,22 @@ from .abc import AbstractIdentityPolicy
class SessionIdentityPolicy(AbstractIdentityPolicy): class SessionIdentityPolicy(AbstractIdentityPolicy):
def __init__(self, session_key='AIOHTTP_SECURITY'): def __init__(self, session_key: str = 'AIOHTTP_SECURITY'):
self._session_key = session_key self._session_key = session_key
if not HAS_AIOHTTP_SESSION: # pragma: no cover if not HAS_AIOHTTP_SESSION: # pragma: no cover
raise ImportError( raise ImportError(
'SessionIdentityPolicy requires `aiohttp_session`') 'SessionIdentityPolicy requires `aiohttp_session`')
async def identify(self, request): async def identify(self, request: web.Request) -> str:
session = await get_session(request) session = await get_session(request)
return session.get(self._session_key) return session.get(self._session_key)
async def remember(self, request, response, identity, **kwargs): async def remember(self, request: web.Request, response: web.StreamResponse,
identity: str, **kwargs: None) -> None:
session = await get_session(request) session = await get_session(request)
session[self._session_key] = identity session[self._session_key] = identity
async def forget(self, request, response): async def forget(self, request: web.Request, response: web.StreamResponse) -> None:
session = await get_session(request) session = await get_session(request)
session.pop(self._session_key, None) session.pop(self._session_key, None)

0
demo/__init__.py Normal file
View File

View File

View File

@@ -1,5 +1,7 @@
import sqlalchemy as sa from enum import Enum
from typing import Any, Optional, Union
import sqlalchemy as sa
from aiohttp_security.abc import AbstractAuthorizationPolicy from aiohttp_security.abc import AbstractAuthorizationPolicy
from passlib.hash import sha256_crypt from passlib.hash import sha256_crypt
@@ -7,13 +9,13 @@ from . import db
class DBAuthorizationPolicy(AbstractAuthorizationPolicy): class DBAuthorizationPolicy(AbstractAuthorizationPolicy):
def __init__(self, dbengine): def __init__(self, dbengine: Any):
self.dbengine = dbengine self.dbengine = dbengine
async def authorized_userid(self, identity): async def authorized_userid(self, identity: str) -> Optional[str]:
async with self.dbengine.acquire() as conn: async with self.dbengine.acquire() as conn:
where = sa.and_(db.users.c.login == identity, where = sa.and_(db.users.c.login == identity,
sa.not_(db.users.c.disabled)) sa.not_(db.users.c.disabled)) # type: ignore[no-untyped-call]
query = db.users.count().where(where) query = db.users.count().where(where)
ret = await conn.scalar(query) ret = await conn.scalar(query)
if ret: if ret:
@@ -21,13 +23,11 @@ class DBAuthorizationPolicy(AbstractAuthorizationPolicy):
else: else:
return None return None
async def permits(self, identity, permission, context=None): async def permits(self, identity: str, permission: Union[str, Enum],
if identity is None: context: None = None) -> bool:
return False
async with self.dbengine.acquire() as conn: async with self.dbengine.acquire() as conn:
where = sa.and_(db.users.c.login == identity, where = sa.and_(db.users.c.login == identity,
sa.not_(db.users.c.disabled)) sa.not_(db.users.c.disabled)) # type: ignore[no-untyped-call]
query = db.users.select().where(where) query = db.users.select().where(where)
ret = await conn.execute(query) ret = await conn.execute(query)
user = await ret.fetchone() user = await ret.fetchone()
@@ -49,14 +49,14 @@ class DBAuthorizationPolicy(AbstractAuthorizationPolicy):
return False return False
async def check_credentials(db_engine, username, password): async def check_credentials(db_engine: Any, username: str, password: str) -> bool:
async with db_engine.acquire() as conn: async with db_engine.acquire() as conn:
where = sa.and_(db.users.c.login == username, where = sa.and_(db.users.c.login == username,
sa.not_(db.users.c.disabled)) sa.not_(db.users.c.disabled)) # type: ignore[no-untyped-call]
query = db.users.select().where(where) query = db.users.select().where(where)
ret = await conn.execute(query) ret = await conn.execute(query)
user = await ret.fetchone() user = await ret.fetchone()
if user is not None: if user is not None:
hash = user[2] hashed = user[2]
return sha256_crypt.verify(password, hash) return sha256_crypt.verify(password, hashed) # type: ignore[no-any-return]
return False return False

View File

@@ -1,4 +1,5 @@
from textwrap import dedent from textwrap import dedent
from typing import NoReturn
from aiohttp import web from aiohttp import web
@@ -27,7 +28,7 @@ class Web(object):
</body> </body>
""") """)
async def index(self, request): async def index(self, request: web.Request) -> web.Response:
username = await authorized_userid(request) username = await authorized_userid(request)
if username: if username:
template = self.index_template.format( template = self.index_template.format(
@@ -37,37 +38,41 @@ class Web(object):
response = web.Response(body=template.encode()) response = web.Response(body=template.encode())
return response return response
async def login(self, request): async def login(self, request: web.Request) -> NoReturn:
response = web.HTTPFound('/') invalid_resp = web.HTTPUnauthorized(body=b'Invalid username/password combination')
form = await request.post() form = await request.post()
login = form.get('login') login = form.get('login')
password = form.get('password') password = form.get('password')
db_engine = request.app.db_engine db_engine = request.app['db_engine']
if not (isinstance(login, str) and isinstance(password, str)):
raise invalid_resp
if await check_credentials(db_engine, login, password): if await check_credentials(db_engine, login, password):
response = web.HTTPFound('/')
await remember(request, response, login) await remember(request, response, login)
raise response raise response
raise web.HTTPUnauthorized( raise invalid_resp
body=b'Invalid username/password combination')
async def logout(self, request): async def logout(self, request: web.Request) -> web.Response:
await check_authorized(request) await check_authorized(request)
response = web.Response(body=b'You have been logged out') response = web.Response(body=b'You have been logged out')
await forget(request, response) await forget(request, response)
return response return response
async def internal_page(self, request): async def internal_page(self, request: web.Request) -> web.Response:
await check_permission(request, 'public') await check_permission(request, 'public')
response = web.Response( response = web.Response(
body=b'This page is visible for all registered users') body=b'This page is visible for all registered users')
return response return response
async def protected_page(self, request): async def protected_page(self, request: web.Request) -> web.Response:
await check_permission(request, 'protected') await check_permission(request, 'protected')
response = web.Response(body=b'You are on protected page') response = web.Response(body=b'You are on protected page')
return response return response
def configure(self, app): def configure(self, app: web.Application) -> None:
router = app.router router = app.router
router.add_route('GET', '/', self.index, name='index') router.add_route('GET', '/', self.index, name='index')
router.add_route('POST', '/login', self.login, name='login') router.add_route('POST', '/login', self.login, name='login')

View File

@@ -1,4 +1,5 @@
import asyncio import asyncio
from typing import Any, Tuple
from aiohttp import web from aiohttp import web
from aiohttp_session import setup as setup_session from aiohttp_session import setup as setup_session
@@ -13,14 +14,14 @@ from demo.database_auth.db_auth import DBAuthorizationPolicy
from demo.database_auth.handlers import Web from demo.database_auth.handlers import Web
async def init(loop): async def init(loop: asyncio.AbstractEventLoop) -> Tuple[Any, ...]:
redis_pool = await create_pool(('localhost', 6379)) redis_pool = await create_pool(('localhost', 6379))
db_engine = await create_engine(user='aiohttp_security', db_engine = await create_engine(user='aiohttp_security',
password='aiohttp_security', password='aiohttp_security',
database='aiohttp_security', database='aiohttp_security',
host='127.0.0.1') host='127.0.0.1')
app = web.Application() app = web.Application()
app.db_engine = db_engine app['db_engine'] = db_engine
setup_session(app, RedisStorage(redis_pool)) setup_session(app, RedisStorage(redis_pool))
setup_security(app, setup_security(app,
SessionIdentityPolicy(), SessionIdentityPolicy(),
@@ -35,7 +36,7 @@ async def init(loop):
return srv, app, handler return srv, app, handler
async def finalize(srv, app, handler): async def finalize(srv: Any, app: Any, handler: Any) -> None:
sock = srv.sockets[0] sock = srv.sockets[0]
app.loop.remove_reader(sock.fileno()) app.loop.remove_reader(sock.fileno())
sock.close() sock.close()
@@ -46,7 +47,7 @@ async def finalize(srv, app, handler):
await app.finish() await app.finish()
def main(): def main() -> None:
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
srv, app, handler = loop.run_until_complete(init(loop)) srv, app, handler = loop.run_until_complete(init(loop))
try: try:

View File

View File

@@ -1,20 +1,25 @@
from enum import Enum
from typing import Dict, Optional, Union
from aiohttp_security.abc import AbstractAuthorizationPolicy from aiohttp_security.abc import AbstractAuthorizationPolicy
from .users import User
class DictionaryAuthorizationPolicy(AbstractAuthorizationPolicy): class DictionaryAuthorizationPolicy(AbstractAuthorizationPolicy):
def __init__(self, user_map): def __init__(self, user_map: Dict[str, User]):
super().__init__() super().__init__()
self.user_map = user_map self.user_map = user_map
async def authorized_userid(self, identity): async def authorized_userid(self, identity: str) -> Optional[str]:
"""Retrieve authorized user id. """Retrieve authorized user id.
Return the user_id of the user identified by the identity Return the user_id of the user identified by the identity
or 'None' if no user exists related to the identity. or 'None' if no user exists related to the identity.
""" """
if identity in self.user_map: return identity if identity in self.user_map else None
return identity
async def permits(self, identity, permission, context=None): async def permits(self, identity: str, permission: Union[str, Enum],
context: None = None) -> bool:
"""Check user permissions. """Check user permissions.
Return True if the identity is allowed the permission in the Return True if the identity is allowed the permission in the
current context, else return False. current context, else return False.
@@ -26,7 +31,7 @@ class DictionaryAuthorizationPolicy(AbstractAuthorizationPolicy):
return permission in user.permissions return permission in user.permissions
async def check_credentials(user_map, username, password): async def check_credentials(user_map: Dict[str, User], username: str, password: str) -> bool:
user = user_map.get(username) user = user_map.get(username)
if not user: if not user:
return False return False

View File

@@ -1,4 +1,5 @@
from textwrap import dedent from textwrap import dedent
from typing import Dict, NoReturn
from aiohttp import web from aiohttp import web
@@ -8,6 +9,7 @@ from aiohttp_security import (
) )
from .authz import check_credentials from .authz import check_credentials
from .users import User
index_template = dedent(""" index_template = dedent("""
@@ -27,7 +29,7 @@ index_template = dedent("""
""") """)
async def index(request): async def index(request: web.Request) -> web.Response:
username = await authorized_userid(request) username = await authorized_userid(request)
if username: if username:
template = index_template.format( template = index_template.format(
@@ -40,22 +42,26 @@ async def index(request):
) )
async def login(request): async def login(request: web.Request) -> NoReturn:
response = web.HTTPFound('/') user_map: Dict[str, User] = request.app['user_map']
invalid_response = web.HTTPUnauthorized(body='Invalid username / password combination')
form = await request.post() form = await request.post()
username = form.get('username') username = form.get('username')
password = form.get('password') password = form.get('password')
verified = await check_credentials( if not (isinstance(username, str) and isinstance(password, str)):
request.app.user_map, username, password) raise invalid_response
verified = await check_credentials(user_map, username, password)
if verified: if verified:
response = web.HTTPFound('/')
await remember(request, response, username) await remember(request, response, username)
return response raise response
return web.HTTPUnauthorized(body='Invalid username / password combination') raise invalid_response
async def logout(request): async def logout(request: web.Request) -> web.Response:
await check_authorized(request) await check_authorized(request)
response = web.Response( response = web.Response(
text='You have been logged out', text='You have been logged out',
@@ -65,7 +71,7 @@ async def logout(request):
return response return response
async def internal_page(request): async def internal_page(request: web.Request) -> web.Response:
await check_permission(request, 'public') await check_permission(request, 'public')
response = web.Response( response = web.Response(
text='This page is visible for all registered users', text='This page is visible for all registered users',
@@ -74,7 +80,7 @@ async def internal_page(request):
return response return response
async def protected_page(request): async def protected_page(request: web.Request) -> web.Response:
await check_permission(request, 'protected') await check_permission(request, 'protected')
response = web.Response( response = web.Response(
text='You are on protected page', text='You are on protected page',
@@ -83,7 +89,7 @@ async def protected_page(request):
return response return response
def configure_handlers(app): def configure_handlers(app: web.Application) -> None:
router = app.router router = app.router
router.add_get('/', index, name='index') router.add_get('/', index, name='index')
router.add_post('/login', login, name='login') router.add_post('/login', login, name='login')

View File

@@ -11,9 +11,9 @@ from demo.dictionary_auth.handlers import configure_handlers
from demo.dictionary_auth.users import user_map from demo.dictionary_auth.users import user_map
def make_app(): def make_app() -> web.Application:
app = web.Application() app = web.Application()
app.user_map = user_map app['user_map'] = user_map
configure_handlers(app) configure_handlers(app)
# secret_key must be 32 url-safe base64-encoded bytes # secret_key must be 32 url-safe base64-encoded bytes

View File

@@ -1,6 +1,11 @@
from collections import namedtuple from typing import NamedTuple, Tuple
class User(NamedTuple):
username: str
password: str
permissions: Tuple[str, ...]
User = namedtuple('User', ['username', 'password', 'permissions'])
user_map = { user_map = {
user.username: user for user in [ user.username: user for user in [

View File

@@ -1,3 +1,6 @@
from enum import Enum
from typing import NoReturn, Optional, Union
from aiohttp import web from aiohttp import web
from aiohttp_session import SimpleCookieStorage, session_middleware from aiohttp_session import SimpleCookieStorage, session_middleware
from aiohttp_security import check_permission, \ from aiohttp_security import check_permission, \
@@ -11,15 +14,15 @@ from aiohttp_security.abc import AbstractAuthorizationPolicy
# For more complicated authorization policies see examples # For more complicated authorization policies see examples
# in the 'demo' directory. # in the 'demo' directory.
class SimpleJack_AuthorizationPolicy(AbstractAuthorizationPolicy): class SimpleJack_AuthorizationPolicy(AbstractAuthorizationPolicy):
async def authorized_userid(self, identity): async def authorized_userid(self, identity: str) -> Optional[str]:
"""Retrieve authorized user id. """Retrieve authorized user id.
Return the user_id of the user identified by the identity Return the user_id of the user identified by the identity
or 'None' if no user exists related to the identity. or 'None' if no user exists related to the identity.
""" """
if identity == 'jack': return identity if identity == 'jack' else None
return identity
async def permits(self, identity, permission, context=None): async def permits(self, identity: str, permission: Union[str, Enum],
context: None = None) -> bool:
"""Check user permissions. """Check user permissions.
Return True if the identity is allowed the permission Return True if the identity is allowed the permission
in the current context, else return False. in the current context, else return False.
@@ -27,7 +30,7 @@ class SimpleJack_AuthorizationPolicy(AbstractAuthorizationPolicy):
return identity == 'jack' and permission in ('listen',) return identity == 'jack' and permission in ('listen',)
async def handler_root(request): async def handler_root(request: web.Request) -> web.Response:
is_logged = not await is_anonymous(request) is_logged = not await is_anonymous(request)
return web.Response(text='''<html><head></head><body> return web.Response(text='''<html><head></head><body>
Hello, I'm Jack, I'm {logged} logged in.<br /><br /> Hello, I'm Jack, I'm {logged} logged in.<br /><br />
@@ -42,29 +45,29 @@ async def handler_root(request):
), content_type='text/html') ), content_type='text/html')
async def handler_login_jack(request): async def handler_login_jack(request: web.Request) -> NoReturn:
redirect_response = web.HTTPFound('/') redirect_response = web.HTTPFound('/')
await remember(request, redirect_response, 'jack') await remember(request, redirect_response, 'jack')
raise redirect_response raise redirect_response
async def handler_logout(request): async def handler_logout(request: web.Request) -> NoReturn:
redirect_response = web.HTTPFound('/') redirect_response = web.HTTPFound('/')
await forget(request, redirect_response) await forget(request, redirect_response)
raise redirect_response raise redirect_response
async def handler_listen(request): async def handler_listen(request: web.Request) -> web.Response:
await check_permission(request, 'listen') await check_permission(request, 'listen')
return web.Response(body="I can listen!") return web.Response(body="I can listen!")
async def handler_speak(request): async def handler_speak(request: web.Request) -> web.Response:
await check_permission(request, 'speak') await check_permission(request, 'speak')
return web.Response(body="I can speak!") return web.Response(body="I can speak!")
async def make_app(): async def make_app() -> web.Application:
# #
# WARNING!!! # WARNING!!!
# Never use SimpleCookieStorage on production!!! # Never use SimpleCookieStorage on production!!!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -53,7 +53,7 @@ Now you have two tables:
+-----------------+ +-----------------+
| user_id | | user_id |
+-----------------+ +-----------------+
| permission_name | | perm_name |
+-----------------+ +-----------------+

View File

@@ -1,18 +1,18 @@
-e . -e .
flake8==3.5.0 flake8==3.8.4
async-timeout==3.0 async-timeout==3.0.1
pytest==3.7.4 pytest==6.1.2
pytest-cov==2.5.1 pytest-cov==2.10.1
pytest-mock==1.10.0 pytest-mock==3.3.1
coverage==4.5.1 coverage==5.3
sphinx==1.7.8 sphinx==3.3.1
pep257==0.7.0 pep257==0.7.0
aiohttp-session==2.5.1 aiohttp-session==2.9.0
aiopg[sa]==0.15.0 aiopg[sa]==1.1.0
aioredis==1.1.0 aioredis==1.3.1
hiredis==0.2.0 hiredis==1.1.0
passlib==1.7.1 passlib==1.7.4
cryptography==2.3.1 cryptography==3.3.1
aiohttp==3.4.2 aiohttp==3.7.3
pytest-aiohttp==0.3.0 pytest-aiohttp==0.3.0
pyjwt==1.6.4 pyjwt==1.7.1

0
tests/__init__.py Normal file
View File

View File

@@ -67,7 +67,7 @@ async def test_identify_broken_scheme(loop, make_token, aiohttp_client):
try: try:
await policy.identify(request) await policy.identify(request)
except ValueError as exc: except ValueError as exc:
raise web.HTTPBadRequest(reason=exc) raise web.HTTPBadRequest(reason=str(exc))
return web.Response() return web.Response()