infamousjoeg / cybr-cli

A "Swiss Army Knife" command-line interface (CLI) for easy human and non-human interaction with @CyberArk suite of products.
Apache License 2.0
72 stars 16 forks source link

Add "cybr conjur whoami" to see identity currently logged in as. #149

Closed jodyhuntatx closed 2 years ago

jodyhuntatx commented 2 years ago

Make it easy to see current login identity. Good for debugging.

infamousjoeg commented 2 years ago
  1. Attempt stdout suppressed conjur list.
  2. If list successful, report username used.
  3. If list unsuccessful, report no logged in user.

The unfortunate part about this is there is no API endpoint to query for whoami. The regular Conjur CLI just reports back what is stored in the Conjur Identity file stored locally, which implies an authenticated session when there could be none. This process should rectify that implication.

infamousjoeg commented 2 years ago

Actually, there is a /whoami endpoint. Will just use that instead. It's not available through conjur-api-go pkg, so will be a direct http.client request.