Skip to content

feat: added auto_renew_token remote feature#61

Merged
petruki merged 1 commit into
masterfrom
staging
Jul 5, 2026
Merged

feat: added auto_renew_token remote feature#61
petruki merged 1 commit into
masterfrom
staging

Conversation

@petruki

@petruki petruki commented Jul 5, 2026

Copy link
Copy Markdown
Member

This pull request introduces an automatic token renewal feature for remote authentication, allowing tokens to be refreshed in the background before they expire. The implementation includes new configuration options, core logic for safe and reliable token renewal, and comprehensive tests to ensure correctness and robustness.

Automatic Token Renewal Feature

  • RemoteOptions and configuration:

    • Added an auto_renew_token boolean option to RemoteOptions, with default set to False, allowing users to enable or disable automatic token renewal. [1] [2]
    • Updated documentation in README.md to describe the new option and its usage. [1] [2]
  • Core logic for auto-renewal in RemoteAuth:

    • Implemented background token renewal using a thread-safe timer, ensuring tokens are refreshed before expiry and handling edge cases such as concurrent renewals and cancellation. [1] [2] [3] [4]

Testing and Reliability

  • Added unit and integration tests:
    • Verified that token renewal is skipped for stale generations, results from stale renewals are discarded, and only the active timer can be cancelled.
    • Added integration tests to ensure tokens are renewed in the background when enabled, not renewed when disabled, and that failures in renewal are handled gracefully.

These changes improve reliability of remote authentication by reducing the risk of expired tokens and providing robust, configurable background renewal.

@petruki petruki self-assigned this Jul 5, 2026
@petruki petruki added enhancement New feature or request ai-generated Indicates that AI tools were used to generate this change labels Jul 5, 2026
@petruki petruki added this to the v1.1.0 milestone Jul 5, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jul 5, 2026

Copy link
Copy Markdown

@petruki petruki merged commit addaff1 into master Jul 5, 2026
15 checks passed
@petruki petruki deleted the staging branch July 5, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Indicates that AI tools were used to generate this change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant