Venafi / vcert

Go client SDK and command line utility designed to simplify integrations by automating key generation and certificate enrollment using Venafi machine identity services.
https://support.venafi.com/hc/en-us/articles/217991528
Apache License 2.0
88 stars 64 forks source link

getcred --config constantly generates stderr messages #432

Open yavin06 opened 6 months ago

yavin06 commented 6 months ago

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

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.