Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to retrieve team and environment #183

Merged
merged 2 commits into from
Jul 13, 2022
Merged

Conversation

MikeGoldsmith
Copy link
Contributor

Which problem is this PR solving?

Adds support for retrieving a team name and associated environment given an API key. This is similar to the existing VerifyWriteKey and VerifyAPIKey functions, but also returns the environment. The library uses the 1/auth endpoint to retrieve this information.

Short description of the changes

  • Create shared func to retrieve team to use 1/auth endpoint and also retrieve environment
  • Update VerifyWriteKey and VerifyAPIKey to use new shared func
  • Add GetTeamAndEnvironment func that uses the new shared logic
  • Add unit tests to verify behaviour of all three functions

@MikeGoldsmith MikeGoldsmith added type: enhancement version: bump minor A PR that adds behavior, but is backwards-compatible. labels Jul 11, 2022
@MikeGoldsmith MikeGoldsmith requested a review from a team July 11, 2022 12:25
@MikeGoldsmith MikeGoldsmith self-assigned this Jul 11, 2022
libhoney.go Outdated Show resolved Hide resolved
Co-authored-by: Vera Reynolds <vreynolds@users.noreply.github.com>
@MikeGoldsmith MikeGoldsmith merged commit 8ec8aa7 into main Jul 13, 2022
@MikeGoldsmith MikeGoldsmith deleted the mike/get-team-env branch July 13, 2022 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement version: bump minor A PR that adds behavior, but is backwards-compatible.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants