Skip to content

✨ add cache system to improve perfs on google keys fetching#2

Merged
ripoul merged 1 commit intomainfrom
add-cache-interface
Dec 19, 2025
Merged

✨ add cache system to improve perfs on google keys fetching#2
ripoul merged 1 commit intomainfrom
add-cache-interface

Conversation

@ripoul
Copy link
Copy Markdown
Owner

@ripoul ripoul commented Dec 19, 2025

No description provided.

Copy link
Copy Markdown

Copilot AI left a 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 introduces a caching system to improve performance when fetching Google's signing keys for webhook validation. The cache is optional and allows users to provide their own cache backend implementation to avoid repeated HTTP requests to Google's key endpoint.

Key Changes:

  • Added a flexible cache abstraction with CacheInterface and CacheConfig classes
  • Integrated cache support into the Validator class with fallback to HTTP fetch
  • Added comprehensive test coverage for cache hit, miss, and invalid data scenarios

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
google_wallet_webhook_auth/cache.py Introduces new CacheInterface abstract class and CacheConfig dataclass for cache configuration
google_wallet_webhook_auth/validator.py Adds optional cache_config parameter and implements cache check/store logic in _get_google_key()
tests/test_validator.py Adds three new test cases covering cache hit, miss, and invalid cached data scenarios
README.md Documents cache usage with a Django example implementation
pyproject.toml Updates version from 0.1.0 to 1.0.0
uv.lock Reflects the version bump in the lock file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ripoul ripoul force-pushed the add-cache-interface branch from 6dce805 to b1c3c05 Compare December 19, 2025 21:11
@ripoul ripoul force-pushed the add-cache-interface branch from b1c3c05 to 24b1ac0 Compare December 19, 2025 21:14
@ripoul ripoul merged commit 4889689 into main Dec 19, 2025
4 checks passed
@ripoul ripoul deleted the add-cache-interface branch December 19, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants