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 API Key credentials factory function #14759

Closed
7 tasks done
dbolduc opened this issue Oct 3, 2024 · 0 comments · Fixed by #14788
Closed
7 tasks done

Add API Key credentials factory function #14759

dbolduc opened this issue Oct 3, 2024 · 0 comments · Fixed by #14788
Assignees
Labels
type: cleanup An internal cleanup or hygiene concern.

Comments

@dbolduc
Copy link
Member

dbolduc commented Oct 3, 2024

Background

In #14733, we added a public option ApiKeyOption. On second thought, we think we would rather have a credentials factory function:

std::shared_ptr<Credentials> MakeApiKeyCredentials(std::string api_key, Options o = {});

This disallows configurations where ApiKeyOption and UnifiedCredentialsOption are set simultaneously (which is good, because the configuration is invalid).

Work

We need to:

  • Update the sample to use other types (GrpcCredentialOption + CustomMetadataOption) than ApiKeyOption.
    • The existing sample is already published to cloud docs.
    • I do not want to remove it. That would be annoying.
  • Remove ApiKeyOption and all code downstream of it. Almost none of this is salvageable.
    • After this, we can say the release is unblocked.
  • Expand oauth2_internal::Credentials to allow for API keys.
    • This might look like a std::string ApiKey()
    • or it might look like a StatusOr<std::pair<std::string, std::string>> AuthHeader()
  • Add an ApiKeyConfig credential type and do a lot of plumbing.
    • Unified gRPC credentials
    • Unified REST credentials
  • Add MakeApiKeyCredentials(...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant