-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
from fastapi import APIRouter, Depends, Response, Request, status | ||
from sqlalchemy.orm import Session | ||
from typing import Annotated | ||
|
||
from fastapi import APIRouter, Depends, Response, Request, HTTPException, status | ||
from fastapi.security import HTTPBasic, HTTPBasicCredentials | ||
|
||
|
||
from database import get_db | ||
# from models import User | ||
from models import HKUser | ||
|
||
|
||
security = HTTPBasic() | ||
|
||
router = APIRouter() | ||
|
||
router = APIRouter(previx="/users", tags=["users"], responses={404: {"description": "Not found"}}) | ||
|
||
# users 핸들러 | ||
# @router.get("/") | ||
|
||
@app.get("/users/me") | ||
def read_current_user(credentials: Annotated[HTTPBasicCredentials, Depends(security)]): | ||
return {"username": credentials.username, "password": credentials.password} |