smallstep / cli

🧰 A zero trust swiss army knife for working with X509, OAuth, JWT, OATH OTP, etc.
https://smallstep.com/cli
Apache License 2.0
3.56k stars 248 forks source link

Allow certificate lifetimes to be given in d,mo,y as well as hours. #1182

Open sshipway opened 1 month ago

sshipway commented 1 month ago

Hello!

Issue details

Currently, certificate lifetimes can only be given in hours, minutes and seconds. If you want to create a cert with a 90 day life, you cant say --not-after 90d but instead have to put --not-after 2160h

We should be able to use time periods in days or years; months might be awkward as they are different lengths and the 'm' would clash with 'minutes' but maybe '1M' could mean '30d'?

I would like to be able to use time windows such as

Why is this needed?

This is a relatively simple change that would be a bit improvement on usability when creating longer-lived certificates such as for hosts and services, which typically want to live for 90 days or 1 year. Giving longer times in hours is confusing and error-prone.