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

Option to let vault token renew (CLI) fail on non-fulfillable request #28710

Open
roehrijn opened this issue Oct 15, 2024 · 1 comment
Open

Comments

@roehrijn
Copy link

roehrijn commented Oct 15, 2024

Is your feature request related to a problem? Please describe.
When building scripts and pipeline using Vault CLI, we often have the requirement to check for token validity and try to renew the token for the amount expected script runtime. Of course it is possible to renew the token with vault token renew but the CLI just prints a warning to stderr in case it can not fulfill the requested time increase and caps it to the max value. This makes it cumbersome to parse that WARNING or the TTL and then dicide based on the result to propably re-login.

Describe the solution you'd like
It would be nice if the vault token renew command had an option to let the command fail in case the request can not be fulfilled. This would make it possible to chain Vault CLI executions like that:

vault token renew -increment=5m || vault login ...

Jan Roehrich [email protected], Mercedes-Benz Tech Innovation GmbH, legal info/Impressum

@roehrijn roehrijn changed the title Option to let vault token renew fail in case of non-fulfillable request Option to let vault token renew (CLI) fail in case of non-fulfillable request Oct 15, 2024
@roehrijn roehrijn changed the title Option to let vault token renew (CLI) fail in case of non-fulfillable request Option to let vault token renew (CLI) fail on non-fulfillable request Oct 15, 2024
@saiaunghlyanhtet
Copy link

@miagilepner @roehrijn I would like to work on this feature. Is it ok to add a new flag --fail-if-not-fulfilled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants