ref(types): Introduce ObjectKey with RFC 3986 percent-encoding#320
Draft
ref(types): Introduce ObjectKey with RFC 3986 percent-encoding#320
Conversation
Replace the plain `String` key type with a validated `ObjectKey` newtype
that enforces RFC 3986 percent-encoding rules. Only unreserved characters
(A-Z a-z 0-9 - . _ ~) appear literally; everything else is
percent-encoded with uppercase hex digits.
Key changes:
- New `ObjectKey` type in objectstore-types with validation, normalization,
and encoding/decoding
- Server route changed from `{*key}` (wildcard) to `{key}` (single segment)
since `/` is always percent-encoded as `%2F`
- Rust client uses `.push(key)` instead of `.extend(key.split("/"))`
- Python client uses `urllib.parse.quote(key, safe="-._~")`
- PUT/POST responses return normalized percent-encoded keys
- Both SDKs decode percent-encoded keys from server responses
- Batch header encoding changed from base64 to percent-encoding
- Storage paths use decoded form for backward compatibility with existing
stored objects
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the plain
Stringkey type with a validatedObjectKeynewtype that enforces RFC 3986 percent-encoding rules. Only unreserved characters (A-Z a-z 0-9 - . _ ~) appear literally; everything else is percent-encoded with uppercase hex digits.Key changes:
ObjectKeytype in objectstore-types with validation, normalization, and encoding/decoding{*key}(wildcard) to{key}(single segment) since/is always percent-encoded as%2F.push(key)instead of.extend(key.split("/"))urllib.parse.quote(key, safe="-._~")