langserve
langserve copied to clipboard
🔒 Add auth support to playground
Add support to playground for auth
Definitely need this for my use-case. Trying to expose the playground to an authorized set of users.
I have the following code:
router = APIRouter()
add_routes(router, chain1, path="/chain1")
add_routes(router, chain2, path="/chain2")
add_routes(router, chain3, path="/chain3")
PROTECTED = [Depends(check_access_token)]
app = FastAPI()
@app.get("/")
async def redirect_root_to_docs():
return RedirectResponse("/docs")
app.include_router(
router,
dependencies=PROTECTED
)
this protects the endpoints but the calls made from the playground frontend app are blocked since they lack authorization header.
would be great to add a mechanism to make access to the playground app authorized.
Is there any progress?