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
71 stars 15 forks source link

cybr conjur logon-non-interactive with environment variables failing #182

Closed David-Lang closed 1 year ago

David-Lang commented 1 year ago

Describe the bug cybr conjur logon-non-interactive with environment variables failing

To Reproduce Steps to reproduce the behavior:

  1. set environment variables
  2. cybr conjur logon-non-interactive

Additional context Looks like the "if err != nil" conditional is missing after getClientFromEnvironmentVariable() so it always try's to getClientFromAuthenticator()

// If .conjurrc is empty, attempt to get client from environment variables if account == "" && baseURL == "" && certPath == "" { // Get client from environment variables client, loginPair, err := getClientFromEnvironmentVariable() // If partial environment variables were provided, try authenticator client, loginPair, err = getClientFromAuthenticator() // Partial environment variables were provided, assume user is attempting to use environment variables if err != nil { return &conjurapi.Client{}, &authn.LoginPair{}, err } // If no error returned, return client created from environment variables if *client != (conjurapi.Client{}) { return client, loginPair, nil } }