Skip to content

feat(envconfig): add extension support - #652

Merged
johanngan merged 1 commit into
mainfrom
johanngan/envconfig-extensions
Nov 6, 2026
Merged

johanngan merged 1 commit into
mainfrom
johanngan/envconfig-extensions

Conversation

@johanngan

@johanngan johanngan commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

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
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 Resolved
@johanngan
johanngan marked this pull request as draft November 3, 2026 23:47
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 <[email protected]>
@johanngan
johanngan force-pushed the johanngan/envconfig-extensions branch from e36afb8 to 7c0c488 Compare November 6, 2026 16:01
@johanngan
johanngan marked this pull request as ready for review November 6, 2026 16:01
@johanngan
johanngan enabled auto-merge (squash) November 6, 2026 16:03
@johanngan
johanngan merged commit 7757c0f into main Nov 6, 2026
11 of 12 checks passed
@johanngan
johanngan deleted the johanngan/envconfig-extensions branch November 6, 2026 16:19
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