Skip to content

Comments

ref(types): Introduce ObjectKey with RFC 3986 percent-encoding#320

Draft
lcian wants to merge 1 commit intomainfrom
lcian/ref/key
Draft

ref(types): Introduce ObjectKey with RFC 3986 percent-encoding#320
lcian wants to merge 1 commit intomainfrom
lcian/ref/key

Conversation

@lcian
Copy link
Member

@lcian lcian commented Feb 20, 2026

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

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
@github-actions
Copy link

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Internal Changes 🔧

  • (types) Introduce ObjectKey with RFC 3986 percent-encoding by lcian in #320

🤖 This preview updates automatically when you update the PR.

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.

1 participant