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
Added a get_server_info command
Added decorator states that this functionality is only supported in appliance and not in OSS
Added extra details parameter to ResourceNotFoundException
You can test the sdk by running this:
from conjur_sdk.client import Client
from conjur_sdk.providers.simple_credentials_provider import SimpleCredentialsProvider
from conjur_sdk.models import ConjurrcData, CredentialsData, SslVerificationMode
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
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'])