getgort / gort

Gort is a chatbot framework designed from the ground up for chatops.

Home Page:https://guide.getgort.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Perfectly valid? tokens sometimes become invalid

clockworksoul opened this issue · comments

This happens within a few minutes after bootstrapping an instance.

The current time is: 11:56am EST.

$ gort bundle install bundle.yml
Error: Unauthorized

The text of the token is:

{
   "Token":"<redacted>",
   "User":"admin",
   "ValidFrom":"2021-11-19T16:53:09.4766392Z",
   "ValidUntil":"2021-11-19T17:03:09.4766392Z"
}

Indicates the token should have a lifetime of ten minutes, and should still be valid.

However, the database has:

valid_from: "2021-11-19 16:53:14.863744+00"
valid_to: "2021-11-19 16:53:24.863744+00"

So, ten SECONDS instead of ten minutes.

To fix

  1. Make the token file and database agree
  2. Make client try to refresh an invalid token

Workaround

Deleting the token and trying again causes the token to be refreshed, and everything works fine.