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

[Feature Request] API key client option #410

Closed
cretz opened this issue Mar 26, 2024 · 2 comments · Fixed by #418
Closed

[Feature Request] API key client option #410

cretz opened this issue Mar 26, 2024 · 2 comments · Fixed by #418
Assignees
Milestone

Comments

@cretz
Copy link
Member

cretz commented Mar 26, 2024

Describe the solution you'd like

See temporalio/features#426 and temporalio/sdk-go#1409 for the ideal approach

@roxblnfk
Copy link
Collaborator

roxblnfk commented Apr 10, 2024

Since PHP SDK 2.9.0 users can specify any metadata, including the Authorization header.

/** @var \Temporal\Client\WorkflowClient $workflowClient */

$workflowClient = $workflowClient->withMetadata(['Authorization', ['Bearer <api-key>']]);

// All the calls $workflow->* will be executed with the specified metadata.
$workflowClient->newWorkflowStub(MyWorkflow::class);

Do we really need to add extra sugar for this header?

@josh-berry
Copy link

I think it's a nice thing to have ergonomically, and it matches what the other SDKs do (or will do). So unless it's gonna cause some significant amount of ugliness, I personally think it's worth doing.

@roxblnfk roxblnfk added this to the 2.9.0 milestone Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants