chanzuckerberg / happy

Happy Path Deployment Tool

Home Page:https://chanzuckerberg.github.io/happy/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

prompt TFE login when TFE token is expired

edulop91 opened this issue · comments

We currently error out when the TFE token is expired or dormant and should handle this more gracefully instead.

Need to figure out if:

  • terraform login. Required if there is a token that is now permanently unauthorized. Say you deleted the token from the TFE UI.
  • or "open browser to refresh token". Can do this when the token is "dormant"

I'm not sure if the client has enough information to distinguish between 2,3 scenarios so we might just have to pick one or the other.

edit:

  • terraform login. Required if the token does not exist. this is handled already

The two scenarios are different -

  • No token present means this user needs to run terraform login and install an api token
  • If there's a token present and the TF api keeps returning 401/403 response codes, we just assume their token needs to be refreshed

The two scenarios are different -

  • No token present means this user needs to run terraform login and install an api token
  • If there's a token present and the TF api keeps returning 401/403 response codes, we just assume their token needs to be refreshed

updated original. "No token present means this user needs to run terraform login and install an api token" is already handled in the code.

but the other two cases, I think, are indistinguishable from the client's perspective. I'll have to confirm that though.

The two other cases are indistinguishable. We've had support tickets open with TFE about this for ages -- might be worth checking up on that.