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] Support TEMPORAL_GRPC_META_<whatever> environment variable #699

Open
cretz opened this issue Oct 24, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@cretz
Copy link
Member

cretz commented Oct 24, 2024

Describe the solution you'd like

We have described how we can accept gRPC metadata (i.e. HTTP headers) via environment variables at temporalio/proposals#95. But this doesn't need to wait on that to be implemented here like the other environment variables that are already here.

Quoting the proposal:

  • For gRPC metadata (i.e. HTTP headers), the environment variable format is TEMPORAL_GRPC_META_<name>.
    • <name> is canonicalized into HTTP header format (gRPC libraries do this for you).
    • Like all HTTP headers, comma-delimited values are supported for multi-headers.
    • This does require that environment variable lists be scanned for prefixes. This is deemed an acceptable tradeoff.
    • 💭 Why not TEMPORAL_GRPC_META as a single var that accepts some kind of structured format?
      • There isn't really a good structured format. Comma-delimited key=value would require users to escape commas in the
        value (common in HTTP values), there's not a good delimiter for other-delimited key=value, and requiring a JSON
        object as the env var value is a bit hard to use.
    • 💭 Why not TEMPORAL_GRPC_META_<index> as key: value?
      • Scanning has to happen anyways.
      • TEMPORAL_GRPC_META_AUTHORIZATION as Bearer my-token is cleaner than TEMPORAL_GRPC_META_0 as
        Authorization: Bearer my-token.
      • Users shouldn't have to keep up with indexes.
    • 💭 Why not TEMPORAL_GRPC_META as a multiline set of headers?
      • This can be added later if wanted.
      • People want to be able to set individual headers.
      • If we use traditional header format, requires HTTP header parsing which is not as trivial as it may seem (and
        parsers may not be present/accessible in every standard library). Granted we could accept our own multiline format
        or only support a simple subset of the header format.
@cretz cretz added the enhancement New feature or request label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant