alisaifee / flask-limiter

Rate Limiting extension for Flask

Home Page:https://flask-limiter.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Limit by oauth2 user

iPurya opened this issue · comments

I want to limit it by user... i didnt find any reference for key_func how works.

@app.post("/imgocr")
@limiter.limit("1/second;12/minute;200/hour")
async def imgocr(request: Request, file: UploadFile = File(...), user= Depends(get_current_user)):
    ...

You can find the documentation for the limiting functions here

Closing due to inactivity. Please re open if there’s any follow up questions