-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
token create doesn't accept 'd' suffix for ttl #19815
Comments
Addition: the same seems to be valid for -explicit-max-ttl . The docs reference this page for valid suffixes, which includes 'd': |
The inclusion of days on that page is incorrect :-/ Vault actually uses Go's duration string format, which only supports units up to hours. Go's documentation for this can be found at https://pkg.go.dev/time#ParseDuration |
The inclusion of days on that page is not incorrect - Vault does use Go's duration string format, but with some modifications. We should be using If we don't support |
Interesting. Vault certainly didn't support I propose it would be useful to add an info-box to the page mentioning that support for |
I did a search on the Vault codebase and found quite a few uses of In the specific case mentioned in this issue, the problem cases are the ones in |
This issue has been fixed. Closing it for now. |
Describe the bug
vault token create -policy=mypolicy -ttl=1d
fails with error:
invalid value "1d" for flag -ttl: time: unknown unit "ds" in duration "1ds"
The same command works fine if 'd' is replaced with 'h'.
To Reproduce
Steps to reproduce the behavior:
vault token create -policy=mypolicy -ttl=1d
(note: result is the same regardless if the policy exists or not)Expected behavior
token gets created with a 1 day ttl.
Environment:
Vault Server Version (retrieve with
vault status
):Version 1.12.2
Build Date 2022-11-23T12:53:46Z
Vault CLI Version (retrieve with
vault version
):Vault v1.13.0 (a4cf0dc), built 2023-03-01T14:58:13Z
Server Operating System/Architecture:
Ubuntu 20.04.5 LTS
Vault server configuration file(s):
The text was updated successfully, but these errors were encountered: