Skip to content

Commit 69ac648

Browse files
alukachclaude
andcommitted
docs(extending): note the encoded signing-path requirement in integration examples
The custom-backend and custom-resolver "Wiring Into the Gateway" snippets build `RequestInfo::new(..., None)` for a custom runtime — the no-signing-path form that assumes `path` is the raw encoded wire path. A custom runtime that decodes the path for routing would hit SignatureDoesNotMatch on keys with escaped characters. Call out that `path` must be percent-encoded, or the encoded path must be passed via `with_signing_path`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 189c679 commit 69ac648

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

docs/extending/custom-backend.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,12 @@ let backend = MyBackend::new(http_client);
156156
let gateway = ProxyGateway::new(backend, bucket_registry, cred_registry, domain)
157157
.with_router(router);
158158

159-
// In your request handler, use handle_request for a two-variant match:
159+
// In your request handler, use handle_request for a two-variant match.
160+
// `path` must be the raw, percent-encoded request path (the form the client
161+
// signed) — SigV4 verification canonicalizes over it. If you decode the path
162+
// for routing, pass the encoded path separately via `.with_signing_path()`,
163+
// or keys containing escaped characters (e.g. a space → `%20`) fail with
164+
// SignatureDoesNotMatch.
160165
let req_info = RequestInfo::new(&method, &path, query.as_deref(), &headers, None);
161166
match gateway.handle_request(&req_info, body, |b| to_bytes(b)).await {
162167
GatewayResponse::Response(result) => {

docs/extending/custom-resolver.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ let registry = MyRegistry::new(api_client);
102102
let cred_registry = MyCredentialRegistry::new(/* ... */);
103103
let gateway = ProxyGateway::new(backend, registry, cred_registry, domain);
104104

105-
// In your request handler:
105+
// In your request handler. `path` must be the raw, percent-encoded request
106+
// path (the form the client signed); if you decode it for routing, pass the
107+
// encoded path separately via `.with_signing_path()` — otherwise keys with
108+
// escaped characters (e.g. a space → `%20`) fail with SignatureDoesNotMatch.
106109
let req_info = RequestInfo::new(&method, &path, query.as_deref(), &headers, None);
107110
match gateway.handle_request(&req_info, body, |b| to_bytes(b)).await {
108111
GatewayResponse::Response(result) => { /* return response */ }

0 commit comments

Comments
 (0)