Skip to content

Comments

feat: isolate mock keyring#17

Merged
vcwild merged 7 commits intomainfrom
isolate-mock-keyring
Nov 13, 2025
Merged

feat: isolate mock keyring#17
vcwild merged 7 commits intomainfrom
isolate-mock-keyring

Conversation

@vcwild
Copy link
Owner

@vcwild vcwild commented Nov 13, 2025

This pull request introduces several improvements and fixes to the akon-core crate and its CI/testing infrastructure. The most notable changes are the introduction of a feature-gated mock keyring implementation for testing, updates to default reconnection policy parameters, and improvements to PIN handling and test coverage. These changes enhance testability, ensure consistent credential handling, and update documentation and configuration to reflect new defaults.

Testing and CI improvements

  • Added a dedicated CI job in .github/workflows/ci.yml to run integration tests using the mock-keyring feature, enabling safe credential testing in CI environments.
  • Documented the mock keyring feature, usage instructions, and its dependency management in README.md.

Mock keyring and credential handling

  • Refactored both keyring.rs and keyring_mock.rs to use shared service name constants (KEYRING_SERVICE_OTP, KEYRING_SERVICE_PIN) for credential storage and retrieval, removing legacy hardcoded service names. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] F95e4543L100R100)
  • Updated PIN retrieval in the mock keyring to mirror production behavior by truncating PINs to 30 characters, ensuring consistent password assembly and validation.
  • Added unit and integration tests to verify long PIN truncation and correct password generation, improving coverage and reliability. [1] [2]

Reconnection policy defaults

  • Changed default values for reconnection policy parameters (max_attempts, consecutive_failures_threshold, health_check_interval_secs) in code, documentation, and test fixtures to reflect updated best practices. [1] [2] [3] [4] [5] [6] [7]

Dependency and version management

  • Bumped crate versions from 1.2.1 to 1.2.2 in Cargo.toml and akon-core/Cargo.toml. [1] [2]
  • Declared lazy_static as an optional dependency gated by the mock-keyring feature, ensuring it is only included for testing and not in production builds.

These changes collectively improve the reliability, security, and maintainability of credential management and reconnection logic in akon-core, while making it easier to test and validate in CI and local environments.

- Implemented a mock keyring for in-memory credential storage
- Added feature flag `mock-keyring` to enable mock keyring functionality
- Updated PIN retrieval to enforce a 30-character limit
- Created integration tests for long PIN truncation behavior
- Enhanced documentation on mock keyring usage and testing
- Replace legacy service name with constants for OTP storage
- Update mock keyring implementation to use new service names
- Ensure consistency in service name usage across keyring functions
- Updated version number in Cargo.toml for the main package
- Updated version number in Cargo.toml for the akon-core package
- Allow quicker polling and quicker response times
- Update regression tests to use new defaults
- Update docs
- Format code
- Cleaned up integration_keyring_tests by removing unnecessary imports.
@vcwild vcwild force-pushed the isolate-mock-keyring branch from 676645e to 4dc14e3 Compare November 13, 2025 22:37
- Added helper function to store secrets in the system keyring
- Updated tests to use system keyring for storing credentials
- Cleaned up stored secrets after test execution
- Reorganized arguments in `store_system_secret` function for clarity
- Improved formatting of command arguments in cleanup section
- Adjusted import order for consistency
@vcwild vcwild merged commit 04bf9a8 into main Nov 13, 2025
9 checks passed
@vcwild vcwild deleted the isolate-mock-keyring branch November 13, 2025 23:16
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.

1 participant