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

API key client option #1997

Open
cretz opened this issue Feb 27, 2024 · 2 comments · May be fixed by #2052
Open

API key client option #1997

cretz opened this issue Feb 27, 2024 · 2 comments · May be fixed by #2052
Labels
enhancement User experience

Comments

@cretz
Copy link
Member

cretz commented Feb 27, 2024

Describe the solution you'd like

See temporalio/features#426

@Quinn-With-Two-Ns
Copy link
Contributor

Is AuthorizationGrpcMetadataProvider sufficient or do we need to add another way to set the API key?

example:

    // Create the Workflow service stub.
    WorkflowServiceStubsOptions.Builder stubOptions =
        WorkflowServiceStubsOptions.newBuilder()
            .setChannelInitializer(
                (channel) -> {
                  channel.overrideAuthority(SERVER_NAME);
                  channel.intercept(MetadataUtils.newAttachHeadersInterceptor(metadata));
                })
            .addGrpcMetadataProvider(
                new AuthorizationGrpcMetadataProvider(() -> "Bearer " + API_KEY))
            .setTarget(ENDPOINT);

@cretz
Copy link
Member Author

cretz commented May 3, 2024

I was hoping to have a literal setApiKey even if it's sugar, but can be convinced otherwise if we don't think it's needed here. I do think there may be a time soon where setCloudApiKey would default the target too, but that's for later.

@Quinn-With-Two-Ns Quinn-With-Two-Ns linked a pull request May 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement User experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants