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

Feat: support personal API keys #616

Merged
merged 2 commits into from
Mar 7, 2023
Merged

Conversation

TomerHeber
Copy link
Collaborator

Issue & Steps to Reproduce / Feature Request

resolves #608

Solution

  1. Added to the provider an "organization_id" field. Is used only if there are multiple organization ids associated with the API key.
  2. Updated the unit tests.

// The test was "randomly" added here to test organizationId failure (when there are multiple organizations).
// Ideally should be tested in organization. Unfortunatly, organizationId is private and cannot be tested directly.
// (test package name varies from package name).
Describe("Failure - Multiple Organizations", func() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is no longer true.
This is tested in the organization test.

@@ -62,7 +89,7 @@ var _ = Describe("Organization", func() {

_, err = apiClient.Organization()
Expect(err).ShouldNot(BeNil())
Expect(err.Error()).Should(Equal("server responded with too many organizations"))
Expect(err.Error()).Should(Equal("the api key is not assigned to organization id: " + defaultOrganizationId))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the way unit tests are built... I could only test this use case.

@TomerHeber TomerHeber requested a review from yaronya March 3, 2023 04:34
@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels Mar 7, 2023
@TomerHeber TomerHeber merged commit 0757f83 into main Mar 7, 2023
@TomerHeber TomerHeber deleted the feat-support-personal-key-#608 branch March 7, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-client feature provider ready to merge PR approved - can be merged once the PR owner is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support personal API keys
2 participants