Skip to content

Commit da68dbf

Browse files
authored
fix: allow POST method in create_authorization_response (#65)
* fix: allow `POST` method in `create_authorization_response` fixes #64 * bump: 1.4.1
1 parent ab4f7ea commit da68dbf

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ fail_fast: true
55

66
repos:
77
- repo: https://github.com/psf/black
8-
rev: 21.6b0
8+
rev: 22.3.0
99
hooks:
1010
- id: black
1111

1212
- repo: https://github.com/pre-commit/pre-commit-hooks
13-
rev: v4.0.1
13+
rev: v4.2.0
1414
hooks:
1515
- id: trailing-whitespace
1616
exclude: ^(setup\.cfg)
@@ -20,12 +20,12 @@ repos:
2020
- id: detect-private-key
2121

2222
- repo: https://github.com/pre-commit/mirrors-mypy
23-
rev: v0.910
23+
rev: v0.950
2424
hooks:
2525
- id: mypy
2626
exclude: ^(docs/|setup\.py|tests/)
2727

2828
- repo: https://github.com/pycqa/flake8
29-
rev: 3.9.2
29+
rev: 4.0.1
3030
hooks:
3131
- id: flake8

aioauth/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__title__ = "aioauth"
22
__description__ = "Asynchronous OAuth 2.0 framework for Python 3."
33
__url__ = "https://github.com/aliev/aioauth"
4-
__version__ = "1.4.0"
4+
__version__ = "1.4.1"
55
__author__ = "Ali Aliyev"
66
__author_email__ = "[email protected]"
77
__license__ = "The MIT License (MIT)"

aioauth/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ async def authorize(request: fastapi.Request) -> fastapi.Response:
324324
Returns:
325325
response: An :py:class:`aioauth.responses.Response` object.
326326
"""
327-
self.validate_request(request, [RequestMethod.GET])
327+
self.validate_request(request, [RequestMethod.GET, RequestMethod.POST])
328328

329329
response_type_list = enforce_list(request.query.response_type)
330330
response_type_classes = set()

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.4.0
2+
current_version = 1.4.1
33
commit = True
44
tag = True
55

@@ -12,7 +12,7 @@ addopts = -s --strict-markers -vv --cache-clear --maxfail=1 --cov=aioauth --cov-
1212

1313
[coverage:run]
1414
branch = True
15-
omit =
15+
omit =
1616
site-packages
1717
aioauth/__version__.py
1818

tests/test_request_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async def test_insecure_transport_error(server: AuthorizationServer):
3939
async def test_allowed_methods(server: AuthorizationServer):
4040
request_url = "https://localhost"
4141

42-
request = Request(url=request_url, method=RequestMethod.POST)
42+
request = Request(url=request_url, method="DELETE") # type: ignore
4343

4444
response = await server.create_authorization_response(request)
4545
assert response.status_code == HTTPStatus.METHOD_NOT_ALLOWED

0 commit comments

Comments
 (0)