Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
David-Lang opened this issue Dec 7, 2022 · 0 comments · Fixed by #184
Closed

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

David-Lang opened this issue Dec 7, 2022 · 0 comments · Fixed by #184
Labels
bug Something isn't working

Comments

@David-Lang
Copy link

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
}
}

@infamousjoeg infamousjoeg linked a pull request Dec 13, 2022 that will close this issue
@infamousjoeg infamousjoeg added the bug Something isn't working label Dec 13, 2022
@infamousjoeg infamousjoeg linked a pull request Jan 18, 2023 that will close this issue
infamousjoeg added a commit that referenced this issue Jan 20, 2023
* fix authn strategy logic

* allow no value in field

* if no cert provided, don't create cert pool

* allow variable for IgnoreSSLVerify

* Add local tests

* Added better error handling when client not created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants