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

feat: api key support, hello world example #387

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

gauravthadani
Copy link
Contributor

What was changed

replicated the hello world example, but authenticated with api key

Why?

Found myself needing a Temporal client with api key and didn't find an example here, so adding 1

Checklist

  1. Closes

  2. How was this tested:

Ran the Workflow against my namespace in Temporal Cloud

  1. Any docs updates needed?

Added relevant readme to the sample

@CLAassistant
Copy link

CLAassistant commented Feb 2, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Quinn-With-Two-Ns
Copy link
Contributor

Thanks for the sample! Can you please add this to the main readme as well

@gauravthadani
Copy link
Contributor Author

Thanks for the sample! Can you please add this to the main readme as well

added to README.md , thanks for checking @Quinn-With-Two-Ns

Comment on lines +69 to +82
DialOptions: []grpc.DialOption{
grpc.WithUnaryInterceptor(
func(ctx context.Context, method string, req any, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
return invoker(
metadata.AppendToOutgoingContext(ctx, "temporal-namespace", *namespace),
method,
req,
reply,
cc,
opts...,
)
},
),
},
Copy link
Member

@cretz cretz Feb 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, this shouldn't be necessary once temporalio/sdk-go#1467 is merged released (don't have to change anything now)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not merged, released

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, thanks @cretz and @Quinn-With-Two-Ns . merging this for now.

have a note to revisit once the new version is released 👌

@gauravthadani gauravthadani merged commit 887402f into main Feb 4, 2025
4 checks passed
@gauravthadani gauravthadani deleted the api_key_support_example branch February 4, 2025 20:24
gauravthadani added a commit that referenced this pull request Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants