Skip to content

Commit

Permalink
fix: allow POST method in create_authorization_response (#65)
Browse files Browse the repository at this point in the history
* fix: allow `POST` method in `create_authorization_response`

fixes #64

* bump: 1.4.1
  • Loading branch information
aliev authored Aug 11, 2022
1 parent ab4f7ea commit da68dbf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ fail_fast: true

repos:
- repo: https://github.com/psf/black
rev: 21.6b0
rev: 22.3.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.2.0
hooks:
- id: trailing-whitespace
exclude: ^(setup\.cfg)
Expand All @@ -20,12 +20,12 @@ repos:
- id: detect-private-key

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

- repo: https://github.com/pycqa/flake8
rev: 3.9.2
rev: 4.0.1
hooks:
- id: flake8
2 changes: 1 addition & 1 deletion aioauth/__version__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__title__ = "aioauth"
__description__ = "Asynchronous OAuth 2.0 framework for Python 3."
__url__ = "https://github.com/aliev/aioauth"
__version__ = "1.4.0"
__version__ = "1.4.1"
__author__ = "Ali Aliyev"
__author_email__ = "[email protected]"
__license__ = "The MIT License (MIT)"
Expand Down
2 changes: 1 addition & 1 deletion aioauth/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ async def authorize(request: fastapi.Request) -> fastapi.Response:
Returns:
response: An :py:class:`aioauth.responses.Response` object.
"""
self.validate_request(request, [RequestMethod.GET])
self.validate_request(request, [RequestMethod.GET, RequestMethod.POST])

response_type_list = enforce_list(request.query.response_type)
response_type_classes = set()
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.4.0
current_version = 1.4.1
commit = True
tag = True

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

[coverage:run]
branch = True
omit =
omit =
site-packages
aioauth/__version__.py

Expand Down
2 changes: 1 addition & 1 deletion tests/test_request_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async def test_insecure_transport_error(server: AuthorizationServer):
async def test_allowed_methods(server: AuthorizationServer):
request_url = "https://localhost"

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

response = await server.create_authorization_response(request)
assert response.status_code == HTTPStatus.METHOD_NOT_ALLOWED
Expand Down

0 comments on commit da68dbf

Please sign in to comment.