Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds authentication support to the fastpubsub system, introducing OAuth2-based client authentication with JWT tokens and scope-based authorization for API endpoints.
Key Changes:
- Implements client management with CRUD operations for authentication clients
- Adds JWT token generation and validation with scope-based permissions
- Integrates authorization checks across all topic and subscription API endpoints
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_models.py | Tests for client model scope validation |
| tests/services/test_clients.py | Comprehensive client service tests including token operations |
| tests/services/test_auth.py | Tests for scope checking and authorization |
| tests/helpers.py | Renamed helper function for clarity |
| tests/conftest.py | Added Client model to test cleanup |
| tests/api/routers/test_topics.py | Updated to use renamed helper function |
| tests/api/routers/test_subscriptions.py | Updated to use renamed helper function |
| tests/api/routers/test_clients.py | API tests for client endpoints |
| pyproject.toml | Added authentication dependencies |
| migrations/versions/002_3818df3592a5_new_migration.py | Database migration for clients table |
| fastpubsub/services/topics.py | Added type hint for delete_topic parameter |
| fastpubsub/services/helpers.py | Enhanced entity helpers to support UUID types |
| fastpubsub/services/clients.py | Core client management and JWT token services |
| fastpubsub/services/auth.py | Authorization logic with scope validation |
| fastpubsub/services/init.py | Exported new client and auth services |
| fastpubsub/models.py | Added client-related models and unified error model |
| fastpubsub/main.py | Added CLI commands for client management |
| fastpubsub/exceptions.py | Added authentication exception types |
| fastpubsub/database.py | Added Client database model |
| fastpubsub/config.py | Added authentication configuration |
| fastpubsub/api/routers/topics.py | Integrated authorization for topic endpoints |
| fastpubsub/api/routers/subscriptions.py | Integrated authorization for subscription endpoints |
| fastpubsub/api/routers/monitoring.py | Updated error response model |
| fastpubsub/api/routers/clients.py | New router for client management endpoints |
| fastpubsub/api/app.py | Registered client router and exception handlers |
| env.sample | Added authentication environment variables |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 27 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
allisson
added a commit
that referenced
this pull request
Jan 2, 2026
* Initial plan * Add comprehensive authentication documentation to README - Add authentication configuration section with all auth-related environment variables - Add Docker commands section for generate_secret_key and create_client - Add Authentication section to API Reference explaining scopes and OAuth flow - Add Clients API documentation with all CRUD endpoints - Add Example 1 showing how to set up authentication - Add Example 3 showing how to create clients with different scopes - Add Security best practices section - Add Authentication Issues troubleshooting section - Renumber all examples to maintain consistency Co-authored-by: allisson <5202+allisson@users.noreply.github.com> * Fix formatting: add backticks to token_version in security section Co-authored-by: allisson <5202+allisson@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: allisson <5202+allisson@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.