[VC-43403] CyberArk(dataupload): replace PostDataReadingsWithOptions with PutSnapshot#703
Merged
wallrj-cyberark merged 1 commit intomasterfrom Aug 28, 2025
Merged
Conversation
This was referenced Aug 28, 2025
78859a8 to
1a40e3f
Compare
Base automatically changed from
VC-43403-servicediscovery-inventory-api
to
master
August 28, 2025 12:11
77f9a57 to
cd8b55b
Compare
3ad3a61 to
878672e
Compare
…pshot - Introduced a new `Snapshot` struct to represent the payload for the CyberArk Discovery and Context API. - Renamed `PostDataReadingsWithOptions` to `PutSnapshot` to better reflect its purpose. - Updated `retrievePresignedUploadURL` to accept `clusterID` directly instead of using `Options`. - Refactored tests to use `PutSnapshot` and removed references to the old `PostDataReadingsWithOptions` method. Signed-off-by: Richard Wall <richard.wall@cyberark.com>
878672e to
49ca83c
Compare
maelvls
reviewed
Aug 28, 2025
| // If you omit that header, it is possible to PUT any data. | ||
| // There is a work around listed in that issue which we have shared with the | ||
| // CyberArk API team. | ||
| func (c *CyberArkClient) PostDataReadingsWithOptions(ctx context.Context, payload api.DataReadingsPost, opts Options) error { |
Member
There was a problem hiding this comment.
Thanks for doing that. The Options struct was odd, it looks much better now.
Member
|
Nothing feels off, I haven't run the tests nor tested this but the output you provided proves that the mocked tests are doing what they say they test. |
maelvls
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.
Stacked on #701
Trying to untangle the CyberArk dataupload API wrapper from the DataReadings API of the agent.
The conversion between DataReadings and Snapshot will be implemented in a followup PR.
Snapshotstruct to represent the payload for the CyberArk Discovery and Context API.PostDataReadingsWithOptionsmethod withPutSnapshot, which now uses theSnapshotstruct and removes the dependency onapi.DataReadingsPost.retrievePresignedUploadURLmethod to acceptclusterIDdirectly instead of relying onOptions.PutSnapshotmethod andSnapshotstruct. Removed unused imports and legacy test cases.Follow up PRs
Testing
I ran the data upload test with against the real API.