mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-06 04:19:26 +00:00
* Add routing middleware Factor out starlette BaseHTTPMiddleware Fix exceptions for starlette < 0.19 Fix docstring formatting Rename middleware/base.py to abstract.py Rework routing middleware * Clean up abstract API docstrings * Move connexion context into extensions * Allow empty middleware list
16 lines
306 B
Python
16 lines
306 B
Python
import asyncio
|
|
import json
|
|
|
|
|
|
def fake_basic_auth(username, password, required_scopes=None):
|
|
if username == password:
|
|
return {'uid': username}
|
|
return None
|
|
|
|
|
|
def fake_json_auth(token, required_scopes=None):
|
|
try:
|
|
return json.loads(token)
|
|
except ValueError:
|
|
return None
|