-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add checker for pin by id #19
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
base: main
Are you sure you want to change the base?
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.
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 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 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.