You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add a Token struct to allow the CLI to differentiate between Bearer and APIKey tokens (#66)
This PR adds a `Token` struct to allow the CLI to differentiate between the auth methods.
The CLI will have a different download flow depending on if the auth is using a bearer token vs an API key. For the bearer token the `team_name` is configured using the `cloudquery switch` command. For the API key, the key is associated with a team name already.
return"", fmt.Errorf("failed to read refresh token: %w. Hint: You may need to run `cloudquery login` or set %s", err, EnvVarCloudQueryAPIKey)
75
+
returnUndefinedToken, fmt.Errorf("failed to read refresh token: %w. Hint: You may need to run `cloudquery login` or set %s", err, EnvVarCloudQueryAPIKey)
61
76
}
62
77
ifrefreshToken=="" {
63
-
return"", fmt.Errorf("authentication token not found. Hint: You may need to run `cloudquery login` or set %s", EnvVarCloudQueryAPIKey)
78
+
returnUndefinedToken, fmt.Errorf("authentication token not found. Hint: You may need to run `cloudquery login` or set %s", EnvVarCloudQueryAPIKey)
0 commit comments