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

getcred --config constantly generates stderr messages #432

Open
yavin06 opened this issue Feb 28, 2024 · 0 comments
Open

getcred --config constantly generates stderr messages #432

yavin06 opened this issue Feb 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@yavin06
Copy link

yavin06 commented Feb 28, 2024

PROBLEM SUMMARY
When running vcert get cred --config , vcert constantly generates the following 2 lines as standard error:

vCert: 2024/02/27 09:13:41 Loading configuration from ./foo section DEFAULT
vCert: 2024/02/27 09:13:41 Validating configuration section DEFAULT

This makes parse the output a difficult, especially when trying to consume json output.

These messages are not really standard error, they are informational. They should only be visible when an option like --verbose is enabled.

STEPS TO REPRODUCE

  • Create an ini file that looks like this:
tpp_url: https://tpp.url.com
tpp_user: vcert_tpp_user
tpp_password: secretpassword
  • run the command
/usr/local/bin/vcert getcred --config config_file --format json

EXPECTED RESULTS
The only thing that should be returned is the json, something like this:

{
    "access_token": "REDACTED==",
    "expires": 1740656419,
    "expires_in": 31535919,
    "identity": "local:{REDACTED}",
    "refresh_token": "REDACTED==",
    "refresh_until": 1740656419,
    "scope": "certificate:manage,revoke",
    "token_type": "Bearer"
}

ACTUAL RESULTS
output looks like this:

vCert: 2024/02/28 12:43:08 Loading configuration from /etc/vcert/foo section DEFAULT
vCert: 2024/02/28 12:43:08 Validating configuration section DEFAULT
{
    "access_token": "REDACTED==",
    "expires": 1740660119,
    "expires_in": 31535919,
    "identity": "local:{REDACTED}",
    "refresh_token": "REDACTED==",
    "refresh_until": 1740660119,
    "scope": "certificate:manage,revoke",
    "token_type": "Bearer"
}

ENVIRONMENT DETAILS
vcert 5.2.0

COMMENTS/WORKAROUNDS
can work around this on the shell by redirecting std err to /dev/null, but that does not work when calling the command from something like ruby or puppet.

@yavin06 yavin06 added the bug Something isn't working label Feb 28, 2024
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
Development

No branches or pull requests

1 participant