Open
Conversation
…eful degradation and improve token management
…PIN validation - Added AsyncGavaConnect class for async operations with checkers API. - Implemented CheckersClient for KRA PIN validation with methods for validating PINs. - Created BasicTokenEndpointProvider for handling token retrieval with Basic auth. - Introduced BasicPair data class for managing client credentials. - Updated auth module to include new classes and methods. - Added smoke tests and unit tests for validation and error handling. - Updated dependencies in pyproject.toml to include pydantic. - Enhanced error handling for API responses, including rate limiting and unauthorized access.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a comprehensive PIN validation feature for the GavaConnect SDK with enhanced authentication and modular architecture. The main focus is adding KRA PIN validation capabilities through a new async facade pattern and improved authentication flow using Basic-to-Bearer token conversion.
- Adds
CheckersClientwith PIN validation endpoints supporting both POST and GET variants - Implements
BasicTokenEndpointProviderfor flexible HTTP Basic authentication against token endpoints - Introduces
AsyncGavaConnectfacade for simplified client setup with per-resource credentials - Enhances OpenTelemetry integration with graceful degradation when libraries are unavailable
Reviewed Changes
Copilot reviewed 22 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/unit/test_checkers_*.py |
Comprehensive test coverage for PIN validation success, GET variant, 401 retry, and error scenarios |
tests/test_telemetry_degradation.py |
Tests for graceful OpenTelemetry degradation without required dependencies |
tests/test_pin.py |
Enhanced PIN format validation tests with improved edge case coverage |
gavaconnect/resources/checkers/ |
New modular PIN validation client with Pydantic models and alias support |
gavaconnect/facade_async.py |
Async facade providing simplified SDK usage with automatic credential management |
gavaconnect/auth/ |
Enhanced authentication with Basic credential types and token endpoint providers |
gavaconnect/http/telemetry.py |
Optional OpenTelemetry support with fail-safe behavior |
| Configuration files | Updated dependencies and documentation for new features |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…verage reports, enhance KRA PIN validation, and streamline async handling in various modules. Add tests for error handling and successful PIN validation scenarios.
…ect-sdk-python into fix/auth-issues
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…enhance telemetry tests for graceful degradation
…ing, and type checking
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.
This pull request introduces major improvements to the GavaConnect SDK, focusing on modular authentication, resource client structure, and developer experience. It adds a new async facade for easier usage, introduces a flexible authentication provider system (including Basic and Bearer flows), and reorganizes the codebase to make resource clients and their dependencies more explicit. The documentation and usage examples are also significantly expanded and clarified.
The most important changes are:
Authentication System Enhancements
BasicPaircredential type andBasicTokenEndpointProviderfor supporting HTTP Basic authentication against token endpoints, enabling flexible per-resource authentication flows. [1] [2] [3] [4]ClientCredentialsProviderto support configurable timeouts and minimum token TTL, and refactored token refresh logic for concurrency safety and reliability. [1] [2] [3] [4]Async Facade and Resource Client Structure
AsyncGavaConnectas an async facade with per-resource credentials, simplifying client setup and context management for users.CheckersClientandPinCheckResultfor KRA PIN validation, with clear dependency documentation and explicit imports. [1] [2] [3]Developer Experience and Documentation
README.mdwith basic, PIN validation, and advanced usage examples, and updated the authentication documentation to explain the pluggable policy system and per-resource credential isolation. [1] [2]pyproject.tomlto includepydanticas a core dependency and added an optional OpenTelemetry dependency group. [1] [2]Validation and Utility Improvements
KRAPINCheckerto provide more robust format and content checks, with clear error messages.