Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

mnorbury
Copy link
Contributor

Retreive the team associated with an API key to allow usage tracking against a team name

fixes: https://github.com/cloudquery/cloudquery-issues/issues/893

@github-actions github-actions bot added the fix label Nov 16, 2023
@mnorbury mnorbury force-pushed the fix/use-team-for-api-key branch from 4f3edab to 3a57e6e Compare November 16, 2023 15:31
Copy link

github-actions bot commented Nov 16, 2023

⏱️ Benchmark results

  • Glob-8 ns/op: 86.15

@mnorbury mnorbury marked this pull request as ready for review November 16, 2023 15:39
}
return teamName, nil
case auth.APIKey:
resp, err := u.apiClient.ListTeamsWithResponse(context.Background(), &cqapi.ListTeamsParams{})
Copy link
Member

@disq disq Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of context.Background() isn't very nice here, but then it's in a constructor (NewUsageClient) so the constructor would have to get a ctx otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but considered it better than changing the constructor in this case.

Co-authored-by: Herman Schaaf <[email protected]>
@kodiakhq kodiakhq bot merged commit 940d87f into main Nov 17, 2023
@kodiakhq kodiakhq bot deleted the fix/use-team-for-api-key branch November 17, 2023 10:29
kodiakhq bot pushed a commit that referenced this pull request Nov 17, 2023
🤖 I have created a release *beep* *boop*
---


## [4.18.3](v4.18.2...v4.18.3) (2023-11-17)


### Bug Fixes

* Retrieve team for api key ([#1372](#1372)) ([940d87f](940d87f))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants