Skip to content

Commit 470142a

Browse files
Update NewAdminClientParams to support AccessToken (#122)
## Problem While implementing admin API functionality in the CLI through the Go SDK, I realized we need a way to provide an `AccessToken` directly rather than strictly `ClientId` and `ClientSecret`. In cases where the user has authenticated through the browser and OAuth, they already have the token and may not have provided `ClientId` and `ClientSecret`. Additionally, I noticed a few things with our generated Go documentation that needed to be cleaned up. The interfaces for `ProjectClient`, `OrganizationClient`, and `ApiKeyClient` are somewhat buried in our generated documentation. Here's an example of `ProjectClient`: https://pkg.go.dev/github.com/pinecone-io/go-pinecone/v4/pinecone#ProjectClient. The concrete implementations of the interfaces that all the methods are attached to need to be properly exported. ## Solution - Update `NewAdminClientWithContext`, and `NewAdminClientParams` to support passing `AccessToken` instead of `ClientId` and `ClientSecret`, add new unit tests to cover `NewAdminClientParams` functionality. - Update `ProjectClient`, `OrganizationClient`, and `ApiKeyClient` interfaces and concrete implementations to export things properly to correct documentation issues. Move detailed doc comments to the specific methods rather than having them in the interfaces. - Un-export IntegrationTests and AdminIntegrationTests. - Add unit tests for `NewAdminClientWithContext`. ## Type of Change - [ ] Bug fix (non-breaking change which fixes an issue) - [X] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update - [ ] Infrastructure change (CI configs, etc) - [ ] Non-code change (docs, etc) - [ ] None of the above: (explain here) ## Test Plan CI - integration & unit tests
1 parent ab58298 commit 470142a

File tree

6 files changed

+449
-333
lines changed

6 files changed

+449
-333
lines changed

0 commit comments

Comments
 (0)