[VC-43403] Refactor the CyberArk servicediscovery client to take an HTTP client#699
Merged
wallrj-cyberark merged 1 commit intomasterfrom Aug 28, 2025
Merged
Conversation
5ebbb26 to
76649af
Compare
76649af to
74ab7bc
Compare
9d9ff30 to
25eccd6
Compare
… unused options - Removed `WithHTTPClient` and `WithCustomEndpoint` options from the `servicediscovery.Client`. - Simplified `New` function to directly use `http.Client` and environment variable for base URL. - Updated tests to use `MockDiscoveryServer` with `testing.TB` for better integration. - Replaced hardcoded `ProdDiscoveryEndpoint` with `ProdDiscoveryAPIBaseURL` for consistency. - Adjusted dependent code to align with the new client initialization approach.
25eccd6 to
e61ad7a
Compare
mladen-rusev-cyberark
approved these changes
Aug 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WithCustomEndpointandWithHTTPClientoptions from theservicediscovery.Client.Newfunction to directly usehttp.Clientand fetch the base URL from theARK_DISCOVERY_APIenvironment variable.ProdDiscoveryEndpointconstant withProdDiscoveryAPIBaseURLfor clarity.testing.Tcleanup and environment variable setup for mock servers.Follow up PRs
Testing
Example of the extra logging from the tests, which helps diagnose test failures and helps to understand what API requests the client is making: