-
Notifications
You must be signed in to change notification settings - Fork 1k
Python: Add dependencies param to ag-ui FastAPI endpoint #3191
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
Conversation
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a dependencies parameter to the add_agent_framework_fastapi_endpoint() function to enable authentication and authorization for AG-UI endpoints using FastAPI's dependency injection system. The changes include comprehensive test coverage, updated documentation, and a working example demonstrating API key authentication.
Changes:
- Added
dependenciesparameter to FastAPI endpoint creation function for middleware-like authentication/authorization - Updated getting_started server example with complete API key authentication implementation
- Added comprehensive documentation in README with authentication examples and best practices
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py |
Added dependencies parameter to endpoint function signature and passed it to FastAPI decorator |
python/packages/ag-ui/tests/test_endpoint.py |
Added 4 new tests covering unauthorized blocking, authorized access, multiple dependencies, and backward compatibility |
python/packages/ag-ui/getting_started/server.py |
Added comprehensive authentication example with API key verification and security best practices documentation |
python/packages/ag-ui/README.md |
Added detailed security section with authentication examples and integration options |
Motivation and Context
dependenciesparameter toadd_agent_framework_fastapi_endpoint()for middleware-like behaviorDescription
Improve usage of FastAPI endpoint for AG-UI library.
Contribution Checklist