langserve icon indicating copy to clipboard operation
langserve copied to clipboard

🔒 Add auth support to playground

Open eyurtsev opened this issue 1 year ago • 2 comments

Add support to playground for auth

eyurtsev avatar Dec 06 '23 03:12 eyurtsev

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.

Wildhammer avatar Dec 13 '23 19:12 Wildhammer

Is there any progress?

oyasuyuki avatar Jul 05 '24 12:07 oyasuyuki