-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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() == "" { |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
What was changed
Moved to using dynamic auth credentials.
And other fixes and improvements.