cyberark / cyberark-conjur-cli

CyberArk Conjur command line interface written in Python
https://www.conjur.org
Apache License 2.0
17 stars 16 forks source link

Update README.md #398

Closed mbenita-Cyberark closed 2 years ago

mbenita-Cyberark commented 2 years ago

Desired Outcome

We split the SDK code from this repo. however some changes were made in the api of creating SDK Client before the split was done. In this PR We update the readme file to show how to initialize Client from this repo . Note htat once the split will be completed and the SDK will be fully functional from the new repo this changes will be removed as the SDK code will be deleted from this repo

Definition of Done

Changelog

Test coverage

Documentation

Behavior

Security

InbalZilberman commented 2 years ago

@mbenita-Cyberark I am missing some context here. is this change offered before the new repo is out?

orenbm commented 2 years ago

@mbenita-Cyberark I am missing some context here. is this change offered before the new repo is out?

@InbalZilberman this change is not related to the split of the SDK from this project. It is a leftover to a previous change that was not documented.

InbalZilberman commented 2 years ago

instead of By default, the CredentialStoreFactory favors saving credentials (login ID and password) to the system's credential store. If we do not support the detected credential store, or the credential stoe is not accessible, the credentials are written to a configuration file, .netrc, in plaintext. Example of usage:

First connection to Conjur:
credentials = CredentialsData(login=username, password=api_key, machine=conjur_url)
credentials_provider = CredentialStoreFactory.create_credential_store()
credentials_provider.save(credentials)
del credentials

Note: The password should be in the form of the api_key.

Already connected:

If a prior connection has been made by the SDK or the CLI with your username and account, then the credentials already stored in the credentials store. In that case, we only need to get the credentials store using CredentialStoreFactory

credentials_provider = CredentialStoreFactory.create_credential_store()

The .netrc file or (_netrc for Windows environments) contains credentials needed to log in to the Conjur endpoint and should consist of 'machine', 'login', and 'password'. If credentials written to the .netrc, it is strongly recommended that you delete those credentials when not using the SDK. The file is located at the user home directory.


I think we should go with By default, the CredentialStoreFactory favors saving credentials (login ID and password) to the system's credential store. If the system's credential store is not supported , or the credential store is not accessible, the credentials are written to a configuration file, .netrc, in plaintext. @mbenita-Cyberark where is the .netrc is found? what is the full path?? The .netrc file or (_netrc for Windows environments) contains credentials needed to log in to the Conjur endpoint and should consist of 'machine', 'login', and 'password'. If credentials written to the .netrc, it is strongly recommended that you delete those credentials when not using the SDK. The file is located at the user home directory.

Usages Examples:

Connecting to Conjur with specific credentials
credentials = CredentialsData(login=username, password=api_key, machine=conjur_url)
credentials_provider = CredentialStoreFactory.create_credential_store()
credentials_provider.save(credentials)
del credentials

Note: The password should be in the form of the api_key. In this example we connect to Conjur with the credentials that were provided and these credentials are saved to the credential store.

Connecting to Conjur with credentials that are stored already

The code assumes that a prior connection has been made and the credentials already stored in the credentials store.

credentials_provider = CredentialStoreFactory.create_credential_store()