Buckets:

download
raw
960 Bytes
import os
from fastapi import FastAPI, Depends, Security
from fastapi_auth0 import Auth0, Auth0User
auth0_domain = os.getenv('AUTH0_DOMAIN', '')
auth0_api_audience = os.getenv('AUTH0_API_AUDIENCE', '')
auth = Auth0(domain=auth0_domain, api_audience=auth0_api_audience, scopes={
'read:blabla': 'Read BlaBla resource'
})
app = FastAPI()
@app.get("/public")
async def get_public():
return {"message": "Anonymous user"}
@app.get("/secure", dependencies=[Depends(auth.implicit_scheme)])
async def get_secure(user: Auth0User = Security(auth.get_user)):
return {"message": f"{user}"}
@app.get("/secure/blabla", dependencies=[Depends(auth.implicit_scheme)])
async def get_secure_scoped(user: Auth0User = Security(auth.get_user, scopes=["read:blabla"])):
return {"message": f"{user}"}
@app.get("/secure/blabla2")
async def get_secure_scoped2(user: Auth0User = Security(auth.get_user, scopes=["read:blabla"])):
return {"message": f"{user}"}

Xet Storage Details

Size:
960 Bytes
·
Xet hash:
ba76952d73b346570e32864e98241c1a2a9bc29c34ceacc336be5f6561fab614

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.