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

Use dynamic auth credentials #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anekkanti
Copy link
Member

What was changed

Moved to using dynamic auth credentials.
And other fixes and improvements.

func getNamespaceAPIKeyFromEnv(ctx context.Context) (string, error) {
v := os.Getenv(temporalCloudNamespaceAPIKeyEnvName)
if v == "" {
// fallback to using the control plane API key if no namespace specific API key is provided
Copy link
Member

Choose a reason for hiding this comment

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

is this comment relevant for public samples?

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe instead of "control plane" we should say "cloud ops"

if err != nil {
return "", fmt.Errorf("failed to get namespace %q: %w", namespace, err)
}
if resp.GetNamespace().GetEndpoints().GetGrpcAddress() == "" {
Copy link
Member

Choose a reason for hiding this comment

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

This is interesting that we're coupling this grpc address with the regional endpoint for api keys. Maybe we should add a comment here, since picking the right endpoint is a bit tricky.

Copy link
Member

@mattkim mattkim left a comment

Choose a reason for hiding this comment

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

If I'm correct it seems like this implementation relies on the api key to both have access to read the namespace info from cloud service and execute workflows.

While this is true today, it might be worth documenting it in case in the future we support keys that only talk to the data plane / control plane.

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.

2 participants