feat: implement JWT authentication system
- Add register endpoint with bcrypt password hashing - Add login endpoint returning JWT tokens - Add logout endpoint with token blacklisting - Add /me endpoint for current user info - Add rate limiting (5/minute) for login attempts using slowapi - Add user settings GET and PATCH endpoints - Create auth middleware via get_current_user dependency - Add UserSettings and UserSettingsUpdate schemas
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from slowapi import Limiter
|
||||
from slowapi.util import get_remote_address
|
||||
from .api import auth, bots, backtest, simulate, config
|
||||
from .core.limiter import limiter
|
||||
|
||||
app = FastAPI(
|
||||
title="Randebu Trading Bot API",
|
||||
@@ -8,6 +11,8 @@ app = FastAPI(
|
||||
version="0.1.0",
|
||||
)
|
||||
|
||||
app.state.limiter = limiter
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
|
||||
Reference in New Issue
Block a user