clever-tools
clever-tools copied to clipboard
Auth expiration
Tokens crafted for the CLI will soon have a life time of 12 months. Maybe we can take care of it and:
- Store the expiration date in
.clever-tool.json - Print a warning messages some days before the expiration
- Check if an errored call to the API result in a unretryable action
Could also be great to be able to renew auth before expiration. About expiration message, maybe plan first messages weeks before not only days.
As discussed internally, on this matter we should:
- Show the expiry of the used token somewhere (
clever profile,clever diag, both?) - Maybe tell the user when a token is expiring soon (days, weeks ?)
- Explain how to renew before expiry date (
clever login) - Beware of JSON modes
- Explain how to renew before expiry date (
- Maybe use a mechanism similar to update notifier to check when to notify user
I propose to do this in several steps (and maybe split issues):
- date in
clever profile, not sure aboutclever diagfor now - notification system "a la update notifier"
- About
Maybe tell the user when a token is expiring soon (days, weeks ?), I'm not sold on this one for now but let's discuss it
Note: you can use the CLI with env vars and thus without a clever login, we should not rely on what the login phase provides to get the date.
1 is easy and usefull for 2 and 3, I'm not sure, is some other CLI doing that ?
I propose to do this in several steps (and maybe split issues):
- date in
clever profile, not sure aboutclever diagfor now
clever profile LGTM, as it's where we tell the user about the account linked by the token.
Answer could look like:
You're currently logged in as:
User id ID
Name NAME
Email EMAIL
Token expiry DATE
Two factor auth yes/no