sorted
All checks were successful
deploy / deploy (push) Successful in 1m11s

This commit is contained in:
2023-12-17 20:13:17 +03:00
parent bb48a8ef11
commit 517de93ccd
15 changed files with 39 additions and 40 deletions

View File

@@ -1,8 +1,9 @@
from services.core import get_author
from functools import wraps
import aiohttp
from aiohttp.web import HTTPUnauthorized
from services.core import get_author
from settings import AUTH_URL
@@ -12,7 +13,7 @@ async def check_auth(req) -> (bool, int | None):
# Logging the authentication token
print(f"[services.auth] checking auth token: {token}")
query_name = "validate_jwt_token"
opeation = "ValidateToken"
operation = "ValidateToken"
headers = {
"Content-Type": "application/json",
}
@@ -20,14 +21,14 @@ async def check_auth(req) -> (bool, int | None):
variables = {
"params": {
"token_type": "access_token",
"token": token.encode("utf-8"),
"token": token,
}
}
gql = {
"query": f"query {opeation}($params: ValidateJWTTokenInput!) {{ {query_name}(params: $params) {{ is_valid claims }} }}",
"query": f"query {operation}($params: ValidateJWTTokenInput!) {{ {query_name}(params: $params) {{ is_valid claims }} }}",
"variables": variables,
"operationName": opeation,
"operationName": operation,
}
print(f"[services.auth] Graphql: {gql}")
try:

View File

@@ -1,7 +1,9 @@
from typing import Any, List
import aiohttp
from settings import API_BASE
from typing import List, Any
from models.member import ChatMember
from settings import API_BASE
headers = {"Content-Type": "application/json"}

View File

@@ -1,7 +1,7 @@
import json
from models.chat import ChatUpdate, Message
from services.rediscache import redis
from models.chat import Message, ChatUpdate
async def notify_message(message: Message, action="create"):

View File

@@ -1,4 +1,5 @@
import redis.asyncio as aredis
from settings import REDIS_URL

View File

@@ -1,4 +1,4 @@
from ariadne import QueryType, MutationType
from ariadne import MutationType, QueryType
query = QueryType()
mutation = MutationType()