-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔒 Easier Auth -- I'd like to pass a fastapi dependency to the add_routes method to secure them #354
Comments
@randypitcherii thanks for reporting! This makes sense. For now, if you should be able to achieve that using the |
This helps a ton!! Thank you : ) |
Added an ability to pass path dependencies to Examples using global dependencies and path dependencies have been added here: https://github.com/langchain-ai/langserve/tree/main/examples/auth Neither of these options allows to do anything with the return value from the dependency as might be required to do implement logic specific to a particular user. For those use cases, the best way right now is either using:
|
This PR adds an example that shows how to implement per user logic with sample Auth using the APIHandler primitive. Another example for: #354
Path dependencies are available here: https://github.com/langchain-ai/langserve/releases/tag/v0.0.38 |
Added some examples to the README for Auth: https://github.com/langchain-ai/langserve?tab=readme-ov-file#advanced @randypitcherii Could you let me know if you encounter any issues on existing endpoints (except for playground)? |
This is related to #294 -- fastapi dependency support lets me use swagger, but I'd still be blocked from securely accessing the playground until playground code supports auth headers.
Thanks! 🙏
The text was updated successfully, but these errors were encountered: