-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
# Add protection to docs with multiple users
DocShield(
app=app,
credentials={
"admin": settings.docshield_admin_pass,
"developer":settings.docshielde_pass,
}
)
@app.get("/")
def root():
logger.info("Hi, Welcome to FastAPI application")
return {"message": "Hello World pushing out to ubuntu"}
@app.post("/posts/{id}")
def create_post():
logger.info(f"Post with id-{id} created")
return {"message": "Post created"}
I have two users defined in DocShield 1- admin, 2- develper
now according to there role they should see assigned API routes
eg. In swagger URL
Admin can access both routes
Developer can only access root route (or as required)
How can we define roles like this?
Metadata
Metadata
Assignees
Labels
No labels