You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(dataupload): replace PostDataReadingsWithOptions with PutSnapshot
- Introduced a new `Snapshot` struct to represent the payload for the
CyberArk Discovery and Context API.
- Replaced the `PostDataReadingsWithOptions` method with `PutSnapshot`,
which now uses the `Snapshot` struct and removes the dependency on
`api.DataReadingsPost`.
- Updated the `retrievePresignedUploadURL` method to accept `clusterID`
directly instead of relying on `Options`.
- Refactored tests to align with the new `PutSnapshot` method and
`Snapshot` struct. Removed unused imports and legacy test cases.
Signed-off-by: Richard Wall <[email protected]>
require.ErrorContains(t, err, "programmer mistake: the cluster name")
50
+
name: "error when bearer token is incorrect",
51
+
snapshot: dataupload.Snapshot{
52
+
ClusterID: "test",
53
+
AgentVersion: "test-version",
78
54
},
79
-
},
80
-
{
81
-
name: "error when bearer token is incorrect",
82
-
payload: defaultPayload,
83
-
opts: defaultOpts,
84
55
authenticate: setToken("fail-token"),
85
56
requireFn: func(t*testing.T, errerror) {
86
57
require.ErrorContains(t, err, "while retrieving snapshot upload URL: received response with status code 500: should authenticate using the correct bearer token")
87
58
},
88
59
},
89
60
{
90
-
name: "invalid JSON from server (RetrievePresignedUploadURL step)",
0 commit comments