Skip to content

Update extstore s3 driver key percent encoding to be consistent with other SDKs and S3's safe character guidelines.#1637

Merged
cconstable merged 1 commit into
mainfrom
extstore/consistent-s3-keys
Jul 13, 2026
Merged

Update extstore s3 driver key percent encoding to be consistent with other SDKs and S3's safe character guidelines.#1637
cconstable merged 1 commit into
mainfrom
extstore/consistent-s3-keys

Conversation

@cconstable

@cconstable cconstable commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What was changed

Update extstore s3 driver key percent encoding to be consistent with other SDKs and S3's safe character guidelines.

Why?

Adhere to https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html

Checklist

Added tests

@cconstable cconstable requested a review from a team as a code owner July 10, 2026 16:15
…other SDKs and S3's safe character guidelines.
@cconstable cconstable force-pushed the extstore/consistent-s3-keys branch from 910ddd5 to a42337d Compare July 10, 2026 17:55
_S3_SAFE_CHARS = frozenset(string.ascii_letters + string.digits + "!-_.*'()")


def _percent_encode(val: str | None) -> str | None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: _encode_key or _escape_key. It's not just percent encoding.

_S3_SAFE_CHARS = frozenset(string.ascii_letters + string.digits + "!-_.*'()")


def _percent_encode(val: str | None) -> str | None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TypeScript is doing slightly different things here: https://github.com/temporalio/sdk-typescript/blob/main/contrib/external-storage-s3/src/driver.ts#L57C10-L57C28
Probably should update TS to have the same algorithm.
Java seems to agree with the Python update.

@cconstable cconstable merged commit a854453 into main Jul 13, 2026
15 checks passed
@cconstable cconstable deleted the extstore/consistent-s3-keys branch July 13, 2026 19:00
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