add bots token
This commit is contained in:
parent
43c385386e
commit
d472348bc7
@ -20,7 +20,6 @@ class CurrentUser:
|
|||||||
session_id: str
|
session_id: str
|
||||||
permissions: List[str]
|
permissions: List[str]
|
||||||
|
|
||||||
|
|
||||||
async def _fetch_current_user(
|
async def _fetch_current_user(
|
||||||
request: Request,
|
request: Request,
|
||||||
credentials: HTTPAuthorizationCredentials,
|
credentials: HTTPAuthorizationCredentials,
|
||||||
@ -76,7 +75,8 @@ async def fetch_user_for_sio(
|
|||||||
token: str,
|
token: str,
|
||||||
ip: str,
|
ip: str,
|
||||||
user_agent: str,
|
user_agent: str,
|
||||||
require_permissions: bool = False
|
require_permissions: bool = False,
|
||||||
|
is_bot: bool = False
|
||||||
) -> CurrentUser:
|
) -> CurrentUser:
|
||||||
"""
|
"""
|
||||||
Fetches user data for Socket.IO, decoupled from FastAPI's Request object.
|
Fetches user data for Socket.IO, decoupled from FastAPI's Request object.
|
||||||
@ -88,7 +88,8 @@ async def fetch_user_for_sio(
|
|||||||
"token": token,
|
"token": token,
|
||||||
"ip": ip,
|
"ip": ip,
|
||||||
"user_agent": user_agent,
|
"user_agent": user_agent,
|
||||||
"require_permissions": require_permissions
|
"require_permissions": require_permissions,
|
||||||
|
"is_bot": is_bot,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
except httpx.RequestError as e:
|
except httpx.RequestError as e:
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "common-lib"
|
name = "common-lib"
|
||||||
version = "0.0.31"
|
version = "0.0.32"
|
||||||
description = "Библиотека общих компонентов для микросервисов yobble"
|
description = "Библиотека общих компонентов для микросервисов yobble"
|
||||||
authors = [{ name = "cheykrym", email = "you@example.com" }]
|
authors = [{ name = "cheykrym", email = "you@example.com" }]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user