Describe the bug
cybr conjur logon-non-interactive with environment variables failing
To Reproduce
Steps to reproduce the behavior:
set environment variables
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
}
}
Describe the bug cybr conjur logon-non-interactive with environment variables failing
To Reproduce Steps to reproduce the behavior:
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 } }