cyberark / conjur-api-python

Python client for the CyberArk Conjur API
Apache License 2.0
8 stars 3 forks source link

Add get_server_info command #4

Closed mbenita-Cyberark closed 2 years ago

mbenita-Cyberark commented 2 years ago

Desired Outcome

Currently the cli uses the SDK internals (invoke_endpoint command) to communicate with conjur server. Specifically the cli invoke the INFO endpoint. which is not implemented in the client

Once the Readme file + integration tests will be added we should add tests and readme instructions on how to use this functionality

Implemented Changes

if name == 'main': url="url_here" conjur_data = ConjurrcData( conjur_url=url, account="account_name" ) credentials_provider = SimpleCredentialsProvider() credentials = CredentialsData(username="username", password="password", machine=url) credentials_provider.save(credentials) c = Client(conjur_data, credentials_provider=credentials_provider, ssl_verification_mode=SslVerificationMode.INSECURE) print(c.get_server_info()['configuration']['conjur']['account'])



### Definition of Done
- [ ] api working

#### Changelog

- [x] The CHANGELOG has been updated, or
- [ ] This PR does not include user-facing changes and doesn't require a
  CHANGELOG update

#### Test coverage

- [ ] This PR includes new unit and integration tests to go with the code
  changes, or
- [x] The changes in this PR do not require tests 

#### Documentation

- [ ] Docs (e.g. `README`s) were updated in this PR
- [x] A follow-up issue to update official docs will be created
- [ ] This PR does not require updating any documentation

#### Behavior

- [x] This PR changes product behavior and has been reviewed by a PO, or
- [ ] These changes are part of a larger initiative that will be reviewed later, or
- [ ] No behavior was changed with this PR

#### Security

- [ ] Security architect has reviewed the changes in this PR,
- [ ] These changes are part of a larger initiative with a separate security review, or
- [x] There are no security aspects to these changes