Skip to content

Commit

Permalink
feat: allow anonymous user to upload files
Browse files Browse the repository at this point in the history
  • Loading branch information
xingwanying committed Jan 17, 2025
1 parent 19d7ecd commit dc4f3dd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions server/auth/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"/api/auth/userinfo",
"/api/chat/qa",
"/api/chat/stream_qa",
"/api/aws/upload",
]

oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/api/auth/token")
Expand Down
7 changes: 0 additions & 7 deletions server/aws/router.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
from typing import Annotated
from fastapi import APIRouter, Depends, File, UploadFile, Form

Check failure on line 1 in server/aws/router.py

View workflow job for this annotation

GitHub Actions / build

Ruff (F401)

aws/router.py:1:20: F401 `typing.Annotated` imported but unused

from auth.get_user_info import get_user
from core.models.user import User
from .schemas import ImageMetaData
from .dependencies import get_s3_client
from .service import upload_image_to_s3

Check failure on line 4 in server/aws/router.py

View workflow job for this annotation

GitHub Actions / build

Ruff (F401)

aws/router.py:4:32: F401 `auth.get_user_info.get_user` imported but unused

Check failure on line 5 in server/aws/router.py

View workflow job for this annotation

GitHub Actions / build

Ruff (F401)

aws/router.py:5:30: F401 `core.models.user.User` imported but unused

ALLOWED_MIME_TYPES = {"image/jpeg", "image/png", "image/gif", "image/webp"}

router = APIRouter(
prefix="/api/aws",
tags=["aws"],
Expand Down

0 comments on commit dc4f3dd

Please sign in to comment.