Skip to content

Commit

Permalink
Revert "Added an adapter for FastAPI"
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Jun 9, 2023
1 parent 5f3ec58 commit 77b5976
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 137 deletions.
38 changes: 0 additions & 38 deletions authomatic/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
.. autoclass:: DjangoAdapter
:members:
.. autoclass:: FastAPIAdapter
:members:
.. autoclass:: Webapp2Adapter
:members:
Expand Down Expand Up @@ -283,38 +280,3 @@ def set_header(self, key, value):

def set_status(self, status):
self.response.status = status


class FastAPIAdapter(BaseAdapter):
def __init__(self, request, response):
"""
Adapter for FastAPI framework.
:param request:
An instance of the :class:`starlette.requests.HTTPConnection` class.
:param response:
An instance of the :class:`starlette.responses.Response` class.
"""
self.request = request
self.response = response

@property
def params(self):
return self.request.query_params

@property
def url(self):
return str(self.request.url)

@property
def cookies(self):
return self.request.cookies

def write(self, value):
self.response += value

def set_header(self, key, value):
self.response.headers[key] = value

def set_status(self, status):
self.response.status_code = int(status.split(' ')[0])
63 changes: 0 additions & 63 deletions examples/fastapi/app/app.py

This file was deleted.

26 changes: 0 additions & 26 deletions examples/fastapi/functional_test/app.py

This file was deleted.

1 change: 0 additions & 1 deletion news/216.feature

This file was deleted.

1 change: 0 additions & 1 deletion tests/functional_tests/config_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def teardown():
# Only frameworks included here will be tested.
INCLUDE_FRAMEWORKS = [
# 'django',
'fastapi', # Runs with https
'flask', # Runs with https
'pyramid', # Runs with https
]
Expand Down
7 changes: 0 additions & 7 deletions tests/functional_tests/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@
check_url=config.HOST_ALIAS,
ssl=True,
),
'FastAPI': liveandletdie.FastAPIServer(
os.path.join(EXAMPLES_DIR, 'fastapi/functional_test/app.py'),
host=config.HOST,
port=config.PORT,
check_url=config.HOST_ALIAS,
ssl=True,
)
}

APPS = dict((k, v) for k, v in ALL_APPS.items() if
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ deps=
liveandletdie
pyopenssl
pyvirtualdisplay
fastapi[all]
py3: django
py3: python3-openid
passenv=TRAVIS,FUNCTIONAL_TESTS_CONFIG
Expand Down

0 comments on commit 77b5976

Please sign in to comment.