Closed cretz closed 6 months ago
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);
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.
Describe the solution you'd like
See https://github.com/temporalio/features/issues/426