ohmyapi 0.4.4__py3-none-any.whl → 0.4.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ohmyapi/__init__.py +1 -1
- ohmyapi/builtin/auth/permissions.py +1 -0
- ohmyapi/builtin/auth/routes.py +7 -1
- {ohmyapi-0.4.4.dist-info → ohmyapi-0.4.6.dist-info}/METADATA +1 -1
- {ohmyapi-0.4.4.dist-info → ohmyapi-0.4.6.dist-info}/RECORD +7 -7
- {ohmyapi-0.4.4.dist-info → ohmyapi-0.4.6.dist-info}/WHEEL +0 -0
- {ohmyapi-0.4.4.dist-info → ohmyapi-0.4.6.dist-info}/entry_points.txt +0 -0
ohmyapi/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__VERSION__ = "0.4.
|
1
|
+
__VERSION__ = "0.4.6"
|
ohmyapi/builtin/auth/routes.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import time
|
2
2
|
from enum import Enum
|
3
|
-
from typing import Any, Dict, List
|
3
|
+
from typing import Any, Dict, List, Optional
|
4
4
|
|
5
5
|
import jwt
|
6
6
|
import settings
|
@@ -124,6 +124,12 @@ async def get_current_user(token: str = Depends(oauth2_scheme)) -> User:
|
|
124
124
|
return user
|
125
125
|
|
126
126
|
|
127
|
+
async def maybe_authenticated(token: Optional[str] = Depends(oauth2_scheme)) -> Optional[User]:
|
128
|
+
if token is None:
|
129
|
+
return None
|
130
|
+
return await get_current_user(token)
|
131
|
+
|
132
|
+
|
127
133
|
async def require_authenticated(current_user: User = Depends(get_current_user)) -> User:
|
128
134
|
"""Ensure the current user is an admin."""
|
129
135
|
if not current_user:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ohmyapi
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.6
|
4
4
|
Summary: Django-flavored scaffolding and management layer around FastAPI, Pydantic, TortoiseORM and Aerich migrations
|
5
5
|
License-Expression: MIT
|
6
6
|
Keywords: fastapi,tortoise,orm,pydantic,async,web-framework
|
@@ -1,9 +1,9 @@
|
|
1
|
-
ohmyapi/__init__.py,sha256=
|
1
|
+
ohmyapi/__init__.py,sha256=Aesb1aUp9E48itirzLhS0MUBd9wk-WqMgRtzjYBkOBE,22
|
2
2
|
ohmyapi/__main__.py,sha256=wcCrL4PjG51r5wVKqJhcoJPTLfHW0wNbD31DrUN0MWI,28
|
3
3
|
ohmyapi/builtin/auth/__init__.py,sha256=vOVCSJX8BALzs8h5ZW9507bjoscP37bncMjdMmBXcMM,42
|
4
4
|
ohmyapi/builtin/auth/models.py,sha256=FJ-F7wY5tXBSZl5YZth6UzhBSFISVCZNc2gp2uKvmR0,2602
|
5
|
-
ohmyapi/builtin/auth/permissions.py,sha256=
|
6
|
-
ohmyapi/builtin/auth/routes.py,sha256=
|
5
|
+
ohmyapi/builtin/auth/permissions.py,sha256=jpfiGf7CA8ghy7wI5OBYBafpqDsqM0SQYliCOGh7ZjA,170
|
6
|
+
ohmyapi/builtin/auth/routes.py,sha256=jBQ9kKXz00GRQ5nRgUehHy18JZHElI7ywAYIqKQ3oB8,6495
|
7
7
|
ohmyapi/builtin/demo/__init__.py,sha256=44Yo3mYmlKSKEwVp6O9urr-C_3qDQzCYLMn6B9i6wew,29
|
8
8
|
ohmyapi/builtin/demo/models.py,sha256=r06rfuhPJaI2fYsQ24L1JCOd67f2GQNfGnkgKAptOX8,1404
|
9
9
|
ohmyapi/builtin/demo/routes.py,sha256=1VTlEttrez6Qnhrz_9sTA-emtfXem0s0BkPVcLvg3k0,1801
|
@@ -26,7 +26,7 @@ ohmyapi/db/model/__init__.py,sha256=k3StTNuKatpwZo_Z5JBFa-927eJrzibFE8U4SA82asc,
|
|
26
26
|
ohmyapi/db/model/model.py,sha256=ui4g78c5xoS06Dj8Cdk7QgTjRnE68zKeL-AdmeYYPuQ,2776
|
27
27
|
ohmyapi/middleware/cors.py,sha256=p8HlKsZLM6jKLEa2-q22cIEZUKawirMQB9ajfxaM4xw,818
|
28
28
|
ohmyapi/router.py,sha256=5g0U59glu4hxxnIoTSFzb2S2offkOT3eE39aprzVxwo,83
|
29
|
-
ohmyapi-0.4.
|
30
|
-
ohmyapi-0.4.
|
31
|
-
ohmyapi-0.4.
|
32
|
-
ohmyapi-0.4.
|
29
|
+
ohmyapi-0.4.6.dist-info/METADATA,sha256=lRL0YxhyfMpilWolAShQispky9aHL7Xbt1WVjbXd03U,2657
|
30
|
+
ohmyapi-0.4.6.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
31
|
+
ohmyapi-0.4.6.dist-info/entry_points.txt,sha256=wb3lw8-meAlpiv1mqcQ3m25ukL7djagU_w89GkrC37k,43
|
32
|
+
ohmyapi-0.4.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|