GetTokenConfig returns deployment options related to token management
(ctx context.Context, userID string)
| 192 | |
| 193 | // GetTokenConfig returns deployment options related to token management |
| 194 | func (c *Client) GetTokenConfig(ctx context.Context, userID string) (TokenConfig, error) { |
| 195 | res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/users/%s/keys/tokens/tokenconfig", userID), nil) |
| 196 | if err != nil { |
| 197 | return TokenConfig{}, err |
| 198 | } |
| 199 | defer res.Body.Close() |
| 200 | if res.StatusCode > http.StatusOK { |
| 201 | return TokenConfig{}, ReadBodyAsError(res) |
| 202 | } |
| 203 | tokenConfig := TokenConfig{} |
| 204 | return tokenConfig, json.NewDecoder(res.Body).Decode(&tokenConfig) |
| 205 | } |
no test coverage detected