Skip to content

Commit 499300d

Browse files
committed
Actualización curso backend
1 parent 1d35b0a commit 499300d

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

Backend/FastAPI/routers/basic_auth_users.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
from pydantic import BaseModel
77
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
88

9-
router = APIRouter(prefix="/basicauth",
10-
tags=["basicauth"],
11-
responses={status.HTTP_404_NOT_FOUND: {"message": "No encontrado"}})
9+
router = APIRouter(
10+
prefix="/basicauth",
11+
tags=["basicauth"],
12+
responses={status.HTTP_404_NOT_FOUND: {"message": "No encontrado"}}
13+
)
1214

1315
oauth2 = OAuth2PasswordBearer(tokenUrl="login")
1416

Backend/FastAPI/routers/jwt_auth_users.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
88
from jose import jwt, JWTError
99
from passlib.context import CryptContext
10-
from datetime import datetime, timedelta
11-
import timezone
10+
from datetime import datetime, timedelta, timezone
1211

1312
ALGORITHM = "HS256"
1413
ACCESS_TOKEN_DURATION = 1
1514
SECRET = "201d573bd7d1344d3a3bfce1550b69102fd11be3db6d379508b6cccc58ea230b"
1615

17-
router = APIRouter(prefix="/jwtauth",
18-
tags=["jwtauth"],
19-
responses={status.HTTP_404_NOT_FOUND: {"message": "No encontrado"}})
16+
router = APIRouter(
17+
prefix="/jwtauth",
18+
tags=["jwtauth"],
19+
responses={status.HTTP_404_NOT_FOUND: {"message": "No encontrado"}}
20+
)
2021

2122
oauth2 = OAuth2PasswordBearer(tokenUrl="login")
2223

Backend/FastAPI/routers/products.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
from fastapi import APIRouter
66

7-
router = APIRouter(prefix="/products",
8-
tags=["products"],
9-
responses={404: {"message": "No encontrado"}})
7+
router = APIRouter(
8+
prefix="/products",
9+
tags=["products"],
10+
responses={404: {"message": "No encontrado"}}
11+
)
1012

11-
products_list = ["Producto 1", "Producto 2",
12-
"Producto 3", "Producto 4", "Producto 5"]
13+
products_list = ["Producto 1", "Producto 2", "Producto 3", "Producto 4", "Producto 5"]
1314

1415

1516
@router.get("/")

Backend/FastAPI/routers/users_db.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
from db.client import db_client
99
from bson import ObjectId
1010

11-
router = APIRouter(prefix="/userdb",
12-
tags=["userdb"],
13-
responses={status.HTTP_404_NOT_FOUND: {"message": "No encontrado"}})
11+
router = APIRouter(
12+
prefix="/userdb",
13+
tags=["userdb"],
14+
responses={status.HTTP_404_NOT_FOUND: {"message": "No encontrado"}}
15+
)
1416

1517

1618
@router.get("/", response_model=list[User])

0 commit comments

Comments
 (0)