jetstack / jetstack/terraform-provider-tlspc
[FEATURE] Report back if token expired or incorrect
- Dominant language
- Go
- Stars
- 3
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
When running a plan action it's not entirely obvious what's wrong from the terraform error:
```log
│ Error: Error retrieving user
│
│ with data.tlspc_user.team_owner,
│ on main.tf line 22, in data "tlspc_user" "team_owner":
│ 22: data "tlspc_user" "team_owner" {
│
│ Error retrieving user: Error decoding response:
╵
Error: one or more commands failed
```
In my case I had miss-configured [terramate](https://terramate.io/) withe the variable for the token.
I think you get the same error if the token has expired, or deleted.
From the event log in TLSPC it is apparent is token is invalid or expired:
**Describe the solution you'd like**
1) Report back if the input doesn't look like a token.
1) Make it apparent there is an auth issue, as opposed to something else.
**Describe alternatives you've considered**
Could pre-check the token myself... but I'm lazy.
I think I seen a customer hit a similar issue, I expect more people might hti this as API tokens are 180 days by default.
**Additional context**
Add any other context or screenshots about the feature request here.
---
**Message from the maintainers**:
If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.
Contributor guide
Research direction
Start by tracing the Terraform plan action's API-token handling and the error path that currently reports only response decoding failures. Confirm how invalid, expired, and deleted tokens are represented by the TLSPC API, then make completion mean that plan output clearly identifies an authentication problem and run the relevant provider tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, terraform
- Domain
- authentication, cloud, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100