Skip to content

CLI: add an option for renew command fail on non-fulfillable request… #29060

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

Merged

Conversation

saiaunghlyanhtet
Copy link
Contributor

@saiaunghlyanhtet saiaunghlyanhtet commented Nov 30, 2024

Description

What does this PR do?
This pull request adds an optional flag (--fail-if-not-fulfilled) to the renew command, which lets the renew command fail on unfulfillable requests and allows command chaining to allow further executions.

Related Issue: #28710

Copy link

hashicorp-cla-app bot commented Nov 30, 2024

CLA assistant check
All committers have signed the CLA.

@saiaunghlyanhtet saiaunghlyanhtet marked this pull request as ready for review November 30, 2024 06:23
@saiaunghlyanhtet saiaunghlyanhtet requested a review from a team as a code owner November 30, 2024 06:23
@saiaunghlyanhtet saiaunghlyanhtet requested review from brewgator and removed request for a team November 30, 2024 06:23
@saiaunghlyanhtet saiaunghlyanhtet force-pushed the feature/valut-token-renew-fail branch from 6944989 to 0bfa0c1 Compare December 2, 2024 06:49
Copy link
Contributor

@bosouza bosouza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @saiaunghlyanhtet, thank you for the contribution! I'm currently gathering some opinions regarding this CLI-only implementation, will get back to you end of next week at the latest on that.

@saiaunghlyanhtet saiaunghlyanhtet force-pushed the feature/valut-token-renew-fail branch 2 times, most recently from f9a4096 to 06a493c Compare January 1, 2025 13:11
@saiaunghlyanhtet saiaunghlyanhtet requested a review from a team as a code owner January 1, 2025 13:11
@saiaunghlyanhtet saiaunghlyanhtet force-pushed the feature/valut-token-renew-fail branch from 06a493c to 94a436b Compare January 1, 2025 13:14
@@ -0,0 +1,3 @@
```release-note:improvement
CLI: adds an optional flag (--fail-if-not-fullfilled) to the renew command, which lets the renew command fail on unfulfillable requests and allows command chaining to allow further executions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's one remaining typo in this fulfilled. Also in the PR title and description.

@@ -53,3 +59,7 @@ flags](/vault/docs/commands) included on all commands.
Vault will not honor this request for periodic tokens. If not supplied, Vault will use
the default TTL. This is specified as a numeric string with suffix like "30s"
or "5m". This is aliased as "-i".

- `--fail-if-not-fulfilled` - Allow command chaining after renew request fail.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should match the command Usage field that's displayed in vault token renew --help. This seems to be a consistent pattern across options for many (all?) commands. I'd suggest setting both Usage and these docs to an initial short description of what the flag does, like your Fail if the requested TTL increment cannot be fully fulfilled. and then move on with these additional details of how it can be used.

Also a nit: the current text seems a bit repetitive by mentioning that the flag allows command chaining twice.

@saiaunghlyanhtet saiaunghlyanhtet changed the title CLI: add an option for renew command fail on non-fullfillable request… CLI: add an option for renew command fail on non-fulfillable request… Jan 5, 2025
@saiaunghlyanhtet saiaunghlyanhtet force-pushed the feature/valut-token-renew-fail branch from 94a436b to 028f058 Compare January 11, 2025 10:47
Copy link
Contributor

@bosouza bosouza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for the changes and sorry about the delay, I was out of office. This looks good, just take a look at the merge conflict and I'll approve and merge this

@saiaunghlyanhtet saiaunghlyanhtet force-pushed the feature/valut-token-renew-fail branch from 028f058 to 5a7c32c Compare January 28, 2025 09:29
@saiaunghlyanhtet
Copy link
Contributor Author

Hey, thanks for the changes and sorry about the delay, I was out of office. This looks good, just take a look at the merge conflict and I'll approve and merge this

Resolved conflict.

bosouza
bosouza previously approved these changes Jan 28, 2025
Copy link
Contributor

@bosouza bosouza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution! I'll ping someone from the education team to review the docs and we should be good!

Comment on lines 66 to 68
- `--fail-if-not-fulfilled` - Fail if the requested TTL increment cannot be fully fulfilled.
Vault will allow token renewal request completion with capped duration even if renew request fails.
And Vault will also allow command chaining after renew command.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `--fail-if-not-fulfilled` - Fail if the requested TTL increment cannot be fully fulfilled.
Vault will allow token renewal request completion with capped duration even if renew request fails.
And Vault will also allow command chaining after renew command.
- `--fail-if-not-fulfilled` - Fail if the requested TTL increment cannot be
fully fulfilled. Vault allows command chaining and token renewal request
completion with capped duration even if renew request fails.

Style correction: write in active voice

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made changes as requested.

… to allow command chaining

Signed-off-by: saiaunghlyanhtet <[email protected]>
@bosouza bosouza merged commit 1643847 into hashicorp:main Feb 4, 2025
73 of 75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants