Feat: rate limiting - #5
Conversation
- Implement OAuth2 user authentication with JWT session management - Add automatic rate limiting with exponential backoff and retry logic - Create sample structure with learning progression: - 01-basic-webhook: Basic GitHub App functionality - 02-configuration: Environment vs constructor configuration - 03-oauth2-integration: OAuth2 authentication examples - 04-advanced-features: Rate limiting and production patterns - Remove deprecated cruel_closer and oauth2_example samples - Add documentation for OAuth2 and rate limiting - Update README with detailed feature documentation - Add environment variable support for all OAuth2 configuration - Implement consistent issue auto-closing across all samples - Add rate limit monitoring endpoints and error handling - Version bump to 0.2.5 BREAKING CHANGES: - Removed samples/cruel_closer and samples/oauth2_example directories - OAuth2 routes now require oauth_session_secret parameter - Rate limiting parameters added to GitHubApp constructor
411ab33 to
799b618CompareThere was a problem hiding this comment.
Pull Request Overview
This release introduces rate limiting and enhanced OAuth2 configuration capabilities to the FastAPI-GitHubApp library. The PR adds automatic rate limit handling with exponential backoff for GitHub API calls, environment variable support for OAuth2 configuration, and reorganizes sample applications into a structured learning progression.
- Comprehensive rate limiting with
@with_rate_limit_handlingdecorator and manual retry functionality - OAuth2 environment variable configuration alongside existing constructor parameters
- Restructured samples into numbered sequence (01-04) demonstrating progressive complexity
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/githubapp/core.py | Adds rate limiting classes, decorator, and enhanced OAuth2 environment loading |
| src/githubapp/init.py | Exports new rate limiting decorator |
| src/githubapp/session.py | Formats session token creation method parameters |
| src/githubapp/oauth.py | Formats OAuth2 method signatures and conditional expressions |
| tests/test_rate_limiting.py | New comprehensive test suite for rate limiting functionality |
| tests/test_oauth*.py | Formatting improvements for OAuth2 test files |
| tests/test_core.py | Minor formatting addition |
| samples/* | New structured sample applications demonstrating features |
| pyproject.toml | Version bump to 0.2.5 |
| README.md | Updated documentation with rate limiting and OAuth2 details |
| CHANGELOG.md | New changelog format with detailed release notes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
e339986 to
58668a9Compare- Update default github_app_route from "/" to "/webhooks/github/" - Update fallback webhook route defaults in core.py - Update documentation and code comments to reflect new default - Update sample configurations and README files for consistency - Update curl example in main README to use new default path BREAKING CHANGE: Default webhook path changed from "/" to "/webhooks/github/". Existing GitHub App webhook URLs need to be updated in GitHub App settings.
58668a9 to
c7f78daCompareUh oh!
There was an error while loading. Please reload this page.
Release v0.2.5: Rate Limiting and Enhanced OAuth2 Configuration
This release improves on v0.2.0's OAuth2 and httpx features and adds rate limiting, environment variable support for OAuth2, and reorganizing samples for a better developer experience.
New Features
Rate Limiting
Retry-Afterheaders and rate limit guidance@with_rate_limit_handlingfor seamless integrationretry_with_rate_limitmethod for selective rate limitingrate_limit_retriesandrate_limit_max_sleepoptionsEnhanced OAuth2 Configuration
GITHUBAPP_OAUTH_CLIENT_IDGITHUBAPP_OAUTH_CLIENT_SECRETGITHUBAPP_OAUTH_SESSION_SECRETGITHUBAPP_OAUTH_REDIRECT_URIGITHUBAPP_OAUTH_SCOPESGITHUBAPP_ENABLE_OAUTHGITHUBAPP_OAUTH_ROUTES_PREFIXSample Applications Restructure
.env.examplefiles for each sample with proper OAuth2 configurationTechnical Improvements
GitHubAppclass with rate limitingload_env()Cleanup
cruel_closersample in favor of more specific functional samplesBreaking Changes
cruel_closersample removed (use01-basic-webhookinstead)oauth_session_secretparameter (from v0.2.0)Testing
tests/test_rate_limiting.py)Documentation
.github/prompts/Version: 0.2.5
Branch:
primetheus/rate-limitingBase: v0.2.0 (OAuth2 and httpx migration)
Compatibility: Python 3.8+, FastAPI 0.68+
This release focuses on production readiness with automatic rate limiting and improved developer experience through environment variable support and better sample organization.