fastapi-betterauth 0.2.2__tar.gz → 0.2.4__tar.gz
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.
- {fastapi_betterauth-0.2.2 → fastapi_betterauth-0.2.4}/PKG-INFO +1 -1
- {fastapi_betterauth-0.2.2 → fastapi_betterauth-0.2.4}/pyproject.toml +1 -1
- {fastapi_betterauth-0.2.2 → fastapi_betterauth-0.2.4}/src/fastapi_betterauth/__init__.py +6 -8
- {fastapi_betterauth-0.2.2 → fastapi_betterauth-0.2.4}/.gitignore +0 -0
- {fastapi_betterauth-0.2.2 → fastapi_betterauth-0.2.4}/LICENSE +0 -0
- {fastapi_betterauth-0.2.2 → fastapi_betterauth-0.2.4}/README.md +0 -0
- {fastapi_betterauth-0.2.2 → fastapi_betterauth-0.2.4}/src/fastapi_betterauth/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi-betterauth
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: FastAPI helpers for Better Auth JWT verification
|
|
5
5
|
Project-URL: Homepage, https://github.com/lukonik/fastapi-betterauth
|
|
6
6
|
Project-URL: Repository, https://github.com/lukonik/fastapi-betterauth
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
1
|
from ssl import SSLContext
|
|
3
|
-
from typing import Any
|
|
2
|
+
from typing import Any, TypedDict, cast
|
|
4
3
|
|
|
5
4
|
import jwt
|
|
6
5
|
from fastapi import HTTPException, Request, status
|
|
@@ -17,14 +16,13 @@ def _get_authorization_scheme_param(
|
|
|
17
16
|
return scheme, param.strip()
|
|
18
17
|
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
class User:
|
|
19
|
+
class User(TypedDict, total=False):
|
|
22
20
|
aud: str
|
|
23
21
|
createdAt: str
|
|
24
22
|
email: str
|
|
25
|
-
emailVerified:
|
|
26
|
-
exp:
|
|
27
|
-
iat:
|
|
23
|
+
emailVerified: bool
|
|
24
|
+
exp: int
|
|
25
|
+
iat: int
|
|
28
26
|
id: str
|
|
29
27
|
image: str
|
|
30
28
|
iss: str
|
|
@@ -76,7 +74,7 @@ class BetterAuth(OAuth2):
|
|
|
76
74
|
issuer=self.base_url,
|
|
77
75
|
audience=self.base_url,
|
|
78
76
|
)
|
|
79
|
-
return User
|
|
77
|
+
return cast(User, response)
|
|
80
78
|
except (jwt.PyJWTError, TypeError) as exc:
|
|
81
79
|
raise TokenValidationError("Invalid bearer token") from exc
|
|
82
80
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|