notation icon indicating copy to clipboard operation
notation copied to clipboard

Parsing days in timestamp fails in notation cert generate-test -e

Open nelson-wu opened this issue 3 years ago • 2 comments

$ notation cert generate-test -e 12d
Incorrect Usage: invalid value "12d" for flag -e: parse error

Since the -h page gives --expiry value, -e value certificate expiry (default: 8760h0m0s), I expected it to be able to parse "d" as days. Perhaps clarify the allowed format in the help?

nelson-wu avatar Nov 12 '21 22:11 nelson-wu

Thanks @nelson-wu. @shizhMSFT, what do you think? Any PRs are welcome to fix

SteveLasker avatar Jan 14 '22 21:01 SteveLasker

The expiry value is parsed into time.Duration by the built-in method time.ParseDuration() and it does not support days.

shizhMSFT avatar Jan 15 '22 04:01 shizhMSFT

Closed Duplicate issue: https://github.com/notaryproject/notation/issues/423

    With  the current implementation, we yet don't support `d` (e.g. `30d` ).

Originally posted by @shizhMSFT in https://github.com/notaryproject/notation/pull/417#discussion_r1009073464

notation sign command supports an optional expiry flag for user to specify a "best by use" time for the artifact. The duration can be specified in minutes(m) or/and hours(h). The intention of this issue is to support duration in days, for example, 30d, 1d3h20m.

priteshbandi avatar Nov 23 '22 21:11 priteshbandi

Close this issue as notation cert generate-test doesn't support --expire flag. Please create a new issue to request this feature if needed

yizha1 avatar Aug 04 '23 07:08 yizha1