Skip to content

Conversation

@simonabler
Copy link
Contributor

Description

Currently, the internal RestClient created by the DigestAuthenticatorManager does not allow any customization of settings like SSL validation, timeouts, or proxies.
Specifically, using the existing RestClient (that includes the authenticator itself) isn't viable, as it creates an endless authentication loop.

Solution

Allow injecting a custom RestClientOptions instance into the DigestAuthenticator.
These options will be applied to the internally created client used for the digest handshake.
This approach provides flexibility (e.g., bypassing SSL checks) without affecting the main client.

Changes introduced:

  • Added a new constructor parameter (RestClientOptions handshakeClientOptions) to DigestAuthenticator.
  • DigestAuthenticatorManager accepts these options and applies them internally.
  • Backward compatibility ensured: existing constructors remain unchanged.

Type of change

Please delete options that are not relevant.

  • ✨ New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • ✅ All tests were ran and new tests were added (if needed)

This commit enables injecting custom RestClientOptions into DigestAuthenticator, allowing full control over the internal RestClient used during the digest handshake. It provides flexibility to configure SSL validation, proxies, and other client-specific settings without creating authentication loops.

- Added optional RestClientOptions parameter to DigestAuthenticator
- Passed RestClientOptions through DigestAuthenticatorManager
- Ensured backward compatibility (default behavior remains unchanged)"
Added unit test VerifyHandshakeUsesInjectedClientOptions to ensure DigestAuthenticator correctly applies injected RestClientOptions (tested via Proxy callback) during the digest handshake request.
@bernardbr
Copy link
Collaborator

LGTM.

Hello @simonabler, apologies for the delay. I plan to proceed with the merge later this week. Thank you again for your support and contributions.

Copy link
Collaborator

@bernardbr bernardbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bernardbr bernardbr merged commit b0a64b5 into thenoobsbr:master Jun 19, 2025
2 checks passed
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