Skip to content

fix: encode object keys in ingress client URLs - #245

Draft
Kayvan-Zahiri wants to merge 1 commit into
restatedev:mainfrom
Kayvan-Zahiri:codex/encode-ingress-object-keys
Draft

Kayvan-Zahiri wants to merge 1 commit into
restatedev:mainfrom
Kayvan-Zahiri:codex/encode-ingress-object-keys

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

Object keys are interpolated directly into ingress URLs. A key such as customer/123 becomes two path segments; ? starts the query, # moves the handler into a fragment, and a literal %2F is interpreted as an escape instead of remaining part of the key.

Percent-encode the object key as one path segment in both scoped and ordinary ingress routes. Existing service/handler routing and delayed-send query construction remain unchanged.

Added 28 in-memory HTTPX transport cases through Client.generic_call and Client.generic_send: slash, question mark, fragment marker, literal percent escape, space, plain key, and Unicode, each with scoped/unscoped call/send variants. Before the fix, 16 fail and 12 controls pass. All 28 pass afterward, with request paths, fragments, delayed-send queries, payloads, and returned values checked.

Validation on Python 3.12.12 with unchanged uv.lock and all locked extras installed:

  • Built the native extension from this checkout using the installed Rust 1.98.0 toolchain.
  • 51 local unit tests pass; three Docker-dependent cases deselected. tests/harness.py, tests/ext.py, and tests/servercontext.py also require Docker and were not run. The Docker daemon is unavailable, so full runtime/conformance results are not claimed.
  • Full Ruff lint and formatting pass (84 files).
  • The repository's Mypy commands pass for SDK, examples, and tests: 48, 10, and 11 files respectively.
  • Pyright passes for SDK, examples, tests, and test-services, using the task virtual environment's Python interpreter.
  • Source distribution and CPython 3.12 wheel build successfully. The wheel contains the tested restate/client.py and compiled native extension.
  • git diff --check passes.

No hosted Restate account or live ingress requests were used; request regressions use httpx.MockTransport. This change addresses reserved characters in object keys; it does not change scope-name handling or empty/dot-segment keys.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Kayvan-Zahiri

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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