Skip to content

Conversation

@musale
Copy link
Contributor

@musale musale commented Aug 22, 2025

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

  • Added BasicPair credential type and BasicTokenEndpointProvider for supporting HTTP Basic authentication against token endpoints, enabling flexible per-resource authentication flows. [1] [2] [3] [4]
  • Improved ClientCredentialsProvider to 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

  • Introduced AsyncGavaConnect as an async facade with per-resource credentials, simplifying client setup and context management for users.
  • Added explicit resource client modules, including CheckersClient and PinCheckResult for KRA PIN validation, with clear dependency documentation and explicit imports. [1] [2] [3]

Developer Experience and Documentation

  • Expanded and clarified the README.md with 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]
  • Updated pyproject.toml to include pydantic as a core dependency and added an optional OpenTelemetry dependency group. [1] [2]

Validation and Utility Improvements

  • Improved KRA PIN validation logic in KRAPINChecker to provide more robust format and content checks, with clear error messages.
  • Made OpenTelemetry tracing optional and fail-safe, so the SDK degrades gracefully if tracing libraries are not installed. [1] [2] [3]

musale added 3 commits August 22, 2025 17:02
…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.
@musale musale requested a review from Copilot August 22, 2025 15:41
Copy link
Contributor

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 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 CheckersClient with PIN validation endpoints supporting both POST and GET variants
  • Implements BasicTokenEndpointProvider for flexible HTTP Basic authentication against token endpoints
  • Introduces AsyncGavaConnect facade 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.

musale and others added 3 commits August 25, 2025 13:00
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.
@codecov
Copy link

codecov bot commented Aug 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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