Skip to content

Commit 3467594

Browse files
amyfromandigithub-actions[bot]
authored andcommitted
Format code and sort imports
1 parent 7503e14 commit 3467594

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

services/api-v3/api/routes/object.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
import hashlib
22
import json
33
import mimetypes
4+
from functools import lru_cache
45
from typing import Any
56

67
import starlette.requests
78
from api.database import get_async_session, get_engine
89
from api.routes.security import has_access
9-
from fastapi import (
10-
APIRouter,
11-
Depends,
12-
HTTPException,
13-
)
10+
from fastapi import APIRouter, Depends, HTTPException
1411
from minio import Minio
15-
from sqlalchemy import text
1612
from pydantic import Field
1713
from pydantic_settings import BaseSettings, SettingsConfigDict
18-
from functools import lru_cache
14+
from sqlalchemy import text
1915
from starlette.datastructures import UploadFile as StarletteUploadFile
2016

2117

@@ -45,7 +41,6 @@ def get_file_settings() -> FileSettings:
4541
)
4642

4743

48-
4944
router = APIRouter(
5045
prefix="/object",
5146
tags=["file"],
@@ -93,6 +88,7 @@ def get_storage_host_bucket() -> tuple[str, str]:
9388
Also ensures host has no port (hostname only) if storage_host ever includes one.
9489
"""
9590
import urllib.parse
91+
9692
settings = get_file_settings()
9793

9894
raw_host = settings.s3_endpoint

services/api-v3/api/routes/security.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ async def redirect_callback(code: str, state: Optional[str] = None):
358358
)
359359

360360
# validate jwt https://dev.macrostrat.org/dev/me
361-
#TODO remove the groups and sub and add the user_name
361+
# TODO remove the groups and sub and add the user_name
362362
access_token = create_access_token(
363363
data={
364364
"sub": user.sub,
@@ -398,7 +398,7 @@ async def redirect_callback(code: str, state: Optional[str] = None):
398398
samesite=samesite,
399399
secure=secure,
400400
)
401-
#TODO remove the token type
401+
# TODO remove the token type
402402
refresh_jwt = jwt.encode(
403403
{
404404
"user_id": user.id,
@@ -464,7 +464,7 @@ async def refresh_token(
464464
else "web_user"
465465
)
466466
# setting new access cookie
467-
#TODO can remove groups, sub. add user_name.
467+
# TODO can remove groups, sub. add user_name.
468468
access_token = create_access_token(
469469
data={"sub": user.sub, "role": role, "user_id": user.id, "groups": list(ids)}
470470
)

services/api-v3/api/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from pydantic import Field
22
from pydantic_settings import BaseSettings, SettingsConfigDict
33

4+
45
class Settings(BaseSettings):
56
model_config = SettingsConfigDict(
67
env_file=".env",
@@ -21,4 +22,5 @@ class Settings(BaseSettings):
2122
jwt_secret_key: str = Field(alias="SECRET_KEY")
2223
jwt_algorithm: str = Field(default="HS256", alias="JWT_ENCRYPTION_ALGORITHM")
2324

25+
2426
settings = Settings()

0 commit comments

Comments
 (0)