Skip to content

Commit

Permalink
Remove internal get match salts endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
raimannma committed Nov 4, 2024
1 parent 4b18945 commit c4e6793
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 33 deletions.
27 changes: 0 additions & 27 deletions deadlock_analytics_api/routers/internal.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from fastapi import APIRouter, Depends
from fastapi.openapi.models import APIKey
from pydantic import BaseModel, Field
from starlette.exceptions import HTTPException
from starlette.responses import JSONResponse, Response

from deadlock_analytics_api import utils
Expand Down Expand Up @@ -48,32 +47,6 @@ class MatchSalts(BaseModel):
failed: bool | None = Field(None)


@router.get("/match-salts")
def get_match_salts(
response: Response, api_key: APIKey = Depends(utils.get_internal_api_key)
) -> list[MatchSalts]:
response.headers["Cache-Control"] = "private, max-age=1200"
print(f"Authenticated with API key: {api_key}")
query = """
SELECT match_id, cluster_id, metadata_salt, replay_salt, failed
FROM match_salts
"""
with CH_POOL.get_client() as client:
results = client.execute(query)
if len(results) == 0:
raise HTTPException(status_code=404, detail="Match not found")
return [
MatchSalts(
match_id=row[0],
cluster_id=row[1],
metadata_salt=row[2],
replay_salt=row[3],
failed=row[4],
)
for row in results
]


@router.post("/match-salts")
def post_match_salts(
response: Response,
Expand Down
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ psycopg2-binary = "^2.9.10"
uuid = "^1.30"
cachetools = "^5.5.0"
pika = "^1.3.2"
sentry-sdk = {version = "^2.17.0", extras = ["fastapi"]}
sentry-sdk = {version = "^2.18.0", extras = ["fastapi"]}
boto3 = "^1.35.54"

[tool.poetry.group.dev.dependencies]
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
annotated-types==0.7.0 ; python_version >= "3.12" and python_version < "4.0"
anyio==4.6.2.post1 ; python_version >= "3.12" and python_version < "4.0"
boto3==1.35.52 ; python_version >= "3.12" and python_version < "4.0"
botocore==1.35.52 ; python_version >= "3.12" and python_version < "4.0"
boto3==1.35.54 ; python_version >= "3.12" and python_version < "4.0"
botocore==1.35.54 ; python_version >= "3.12" and python_version < "4.0"
cachetools==5.5.0 ; python_version >= "3.12" and python_version < "4.0"
certifi==2024.8.30 ; python_version >= "3.12" and python_version < "4.0"
click==8.1.7 ; python_version >= "3.12" and python_version < "4.0"
Expand All @@ -23,7 +23,7 @@ python-dateutil==2.9.0.post0 ; python_version >= "3.12" and python_version < "4.
pytz==2024.2 ; python_version >= "3.12" and python_version < "4"
redis[hiredis]==5.2.0 ; python_version >= "3.12" and python_version < "4.0"
s3transfer==0.10.3 ; python_version >= "3.12" and python_version < "4.0"
sentry-sdk[fastapi]==2.17.0 ; python_version >= "3.12" and python_version < "4.0"
sentry-sdk[fastapi]==2.18.0 ; python_version >= "3.12" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.12" and python_version < "4.0"
sniffio==1.3.1 ; python_version >= "3.12" and python_version < "4.0"
starlette==0.41.2 ; python_version >= "3.12" and python_version < "4.0"
Expand Down

0 comments on commit c4e6793

Please sign in to comment.