Skip to content

feat(envconfig): add extension support - #652

Draft
johanngan wants to merge 2 commits into
mainfrom
johanngan/envconfig-extensions
Draft

johanngan wants to merge 2 commits into
mainfrom
johanngan/envconfig-extensions

Conversation

@johanngan

@johanngan johanngan commented Nov 3, 2026 •

Copy link
Copy Markdown

What was changed

Add support for envconfig extensions. These allow separate packages to extend envconfig with their own TOML keys and environment variables by including the ClientConfigExtension module. An extension operates on a config profile as input and outputs a plugin to be attached to the client created from envconfig output.

A TOML file with an extension looks as follows:

[profile.default.ext.my_extension]
some_field = "value"

An envconfig consumer specifies a list of extensions to use when loading connection options via ClientConfig.load_client_connect_options(extensions: [...]). Returned plugins are Client::Plugin instances set under the :plugins key of the resulting keyword arguments, so they are applied when the result is passed to Client.connect(*args, **kwargs). For now, extensions are not supported in other contexts.

Why?

It's useful for external packages to be able to extend the envconfig format without needing to modify the envconfig package itself. The first use-case for this will be integrating with AWS Secrets Manager to specify client secrets via Secrets Manager ID.

Also see the Go implementation in temporalio/sdk-go#2771. Also see the Rust core change in temporalio/sdk-rust#1736.

Checklist

  1. How was this tested:
  • Added new unit tests.
  • Manual end-to-end check (performed by Claude): a small standalone script loaded a real temporal.toml (via TEMPORAL_CONFIG_FILE) with an [profile.default.ext.e2e] table, using real process env vars (TEMPORAL_NAMESPACE, TEMPORAL_EXT_E2E_SUFFIX). An extension passed to ClientConfig.load_client_connect_options read its TOML table and env var and returned a plugin. The script confirmed that the extension saw the env-overridden profile, and that the returned connect arguments had the expected address and namespace and exactly one plugin carrying the expected values.
  1. Any docs updates needed?
    The associated in-repo docs are updated. I don't think we need other public docs for now, as right now this is primarily just an implementation detail for the Lambda worker integration with Secrets Manager.

johanngan and others added 2 commits November 3, 2026 16:02
Temporarily pin sdk-core to the unmerged envconfig extension commit
from temporalio/sdk-rust's johanngan/envconfig-extensions branch, and
import the Core changelog entries for c8d9191..a9626f6d. The pin will
be moved to the merged commit before this lands. Regenerated protos and
Cargo.lock pick up Core's changes in that range.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add support for envconfig extensions. These allow separate packages to
extend envconfig with their own TOML keys and environment variables by
including the ClientConfigExtension module. An extension operates on a
config profile as input and outputs a plugin to be attached to the
client created from envconfig output.

A TOML file with an extension looks as follows:

```
[profile.default.ext.my_extension]
some_field = "value"
```

An envconfig consumer specifies a list of extensions to use when
loading connection options via
ClientConfig.load_client_connect_options(extensions: [...]). Returned
plugins are Client::Plugin instances set under the :plugins key of the
resulting keyword arguments, so they are applied when the result is
passed to Client.connect(*args, **kwargs). For now, extensions are not
supported in other contexts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@johanngan
johanngan requested a review from THardy98 November 3, 2026 22:53
@johanngan
johanngan requested a review from a team as a code owner November 3, 2026 22:53
Comment thread temporalio/ext/sdk-core

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Note: Not yet a merged submodule ref, this PR can't be merged until temporalio/sdk-rust#1736 is, and the submodule hash and auto-generated changelog entries will need to be updated again.

@johanngan
johanngan marked this pull request as draft November 3, 2026 23:47

This branch has not been deployed

No deployments
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