Skip to content

Conversation

wallrj-cyberark
Copy link
Member

@wallrj-cyberark wallrj-cyberark commented Aug 20, 2025

A follow up to #689 and pulls some other changes from #681, to make that PR less sprawling.

I noticed the following problems with the mock dataupload API server.

  • Remove unused logic,
  • use meaningful handler names
  • more realistic responses

In another PR I may try and consolidate the various CyberArk API mocks into a separate package

… meaningful handler names, more realistic responses

Signed-off-by: Richard Wall <[email protected]>
<Message>The SHA256 you specified did not match the calculated checksum.</Message>
<RequestId>THR2V1RX700Z8SC7</RequestId>
<HostId>F0xSC0H93Xs0BlCx6RjasZgrtjNkNB7lF4+yz1AiPQHswpdEoqj3iTgEN8SUWgV2Qm/laPobVIMz9SYTNHqdoA==</HostId>
</Error>`
Copy link
Member Author

Choose a reason for hiding this comment

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

I temporarily modified the client to send mismatching body and request header digest, and this is the error recorded by mitmproxy:
image

w.Header().Set("Content-Type", "application/json")
_, _ = w.Write([]byte(`{"url":`)) // invalid JSON
return
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This wasn't used. I think it's a legacy of some previous version of the mock server.
S3 does not return JSON for PUT requests; either an empty response or an XML error.

Copy link
Contributor

@SgtCoDFish SgtCoDFish left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@SgtCoDFish SgtCoDFish merged commit 1209e4b into master Aug 20, 2025
2 checks passed
@SgtCoDFish SgtCoDFish deleted the VC-43403-inventory-api-mock-cleanup branch August 20, 2025 09:05
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.

3 participants