clever-tools icon indicating copy to clipboard operation
clever-tools copied to clipboard

Auth expiration

Open miton18 opened this issue 1 year ago • 5 comments

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

miton18 avatar Jan 30 '24 10:01 miton18

Could also be great to be able to renew auth before expiration. About expiration message, maybe plan first messages weeks before not only days.

davlgd avatar Jan 30 '24 10:01 davlgd

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
  • Maybe use a mechanism similar to update notifier to check when to notify user

davlgd avatar Feb 26 '24 18:02 davlgd

I propose to do this in several steps (and maybe split issues):

  1. date in clever profile, not sure about clever diag for now
  2. notification system "a la update notifier"
  3. 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.

hsablonniere avatar Mar 26 '24 17:03 hsablonniere

1 is easy and usefull for 2 and 3, I'm not sure, is some other CLI doing that ?

miton18 avatar Mar 26 '24 17:03 miton18

I propose to do this in several steps (and maybe split issues):

  1. date in clever profile, not sure about clever diag for 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

davlgd avatar Mar 26 '24 17:03 davlgd