-
Notifications
You must be signed in to change notification settings - Fork 25
[VC-43753] CyberArk(client): add CyberArk snapshot conversion and test utilities #684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Resource interface{} | ||
DeletedAt Time | ||
Resource interface{} `json:"resource"` | ||
DeletedAt Time `json:"deleted_at,omitempty"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added json annotations here so that I can unmarshal date readings from a file, for testing.
The agent already has an --input-file
option, but stops decoding the input at api.DataReading.Data
, leaving the actual data as interface{}
.
In the test in this PR I need to decode the Data, so that it has the same types as the DataGatherer.Fetch return values.
pkg/datagatherer/k8s/discovery.go
Outdated
type DiscoveryData struct { | ||
ServerVersion *version.Info `json:"server_version"` | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a data type instead of the ad-hoc map that was previously returned by this data gatherer,
to make it easier to do a type conversion in ConverDatareadingsToCyberarkSnapshot function.
9606752
to
4d8e691
Compare
88c1cc7
to
8b9a233
Compare
2d44e46
to
34d67da
Compare
- kind: k8s-discovery | ||
name: ark/discovery | ||
- kind: k8s-dynamic | ||
name: ark/secrets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wallrj-cyberark Since the name here is ark-specific, does that mean that we will fetch secrets twice (once for TLSPK and once for the Secret solution?)
caadaf0
to
e8f50da
Compare
78700c9
to
b7adba8
Compare
a331e26
to
0bfb107
Compare
ae1b4fb
to
d82113d
Compare
- Introduced a new `MachineHub` output mode in the agent configuration. - Added `--machine-hub` flag to enable the `MachineHub` mode. - Implemented `CyberArkClient` for publishing data readings to CyberArk's API. - Created `LoadClientConfigFromEnvironment` to load CyberArk client configuration from environment variables. - Updated tests to cover `MachineHub` mode and CyberArk client functionality. - Modified mock data and discovery logic to support CyberArk integration. Signed-off-by: Richard Wall <[email protected]>
d82113d
to
8842333
Compare
- Introduced `ConvertDataReadingsToCyberarkSnapshot` to transform data readings into CyberArk snapshot format. - Enhanced `PostDataReadingsWithOptions` to utilize the new snapshot conversion. - Added `DynamicData` and `DiscoveryData` types for structured data handling. - Updated `DataGathererDynamic` and `DataGathererDiscovery` to return strongly typed data. - Implemented `ParseDataReadings` in `testutil` for decoding and testing data readings. - Added test data and golden file support for snapshot conversion validation. Signed-off-by: Richard Wall <[email protected]>
e8f50da
to
7686607
Compare
8842333
to
5a2ae3c
Compare
Stacked on #696
ConvertDataReadingsToCyberarkSnapshot
to transform data readings into CyberArk snapshot format.PostDataReadingsWithOptions
to utilize the new snapshot conversion.DynamicData
andDiscoveryData
types for structured data handling.DataGathererDynamic
andDataGathererDiscovery
to return strongly typed data.ParseDataReadings
intestutil
for decoding and testing data readings.The client still deviates from the API requirements, as follows:
...but I prefer to address those in followup PRs, as time permits.
Part of: https://venafi.atlassian.net/browse/VC-43753
Followup PRs
Testing
TODO