Uri cannot preserve percent-encoded path segments, breaking AWS SigV4 in aws-spi-pekko-http
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- aws, scala
- Ambito
- networking
Direzione di ricerca
Inizia da UriParser e Uri.scala, in particolare da renderPath e encode, per tracciare dove i segmenti del percorso codificati in percentuale vengono decodificati o ricodificati. Poi esamina il renderer di HttpRequest e l’uso di SdkHttpRequest da parte di aws-spi-pekko-http. Il lavoro è completo quando encodedPath dell’SDK può raggiungere il wire in modo byte-identico, inclusi i caratteri pchar codificati e i segni di percentuale letterali.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Uri cannot round-trip a percent-encoded path. Parsing decodes %XX triplets in path segments (UriParser), and UriRendering.renderPath re-encodes segments with the pchar-base keep-set ("pchar without percent"). Two consequences:
- A percent-encoded pchar character can never be rendered back in encoded form:
%2Bbecomes+,%3Dbecomes=, etc. (sub-delims,:and@are kept raw by the renderer). - A literal
%in aPathsegment is always re-encoded to%25, so constructingUri.Pathfrom the still-encoded string does not work either.
Uri("https://b.s3.amazonaws.com/a%2Bb%20c%3Dx/d?x=%2B7&y=a+b").toString
// https://b.s3.amazonaws.com/a+b%20c=x/d?x=%2B7&y=a+b
The query is preserved verbatim via rawQueryString; the path is not. There is no raw-path escape hatch in the Uri model or the client request renderer, so no downstream construction can produce a byte-identical request target.
Why it matters
pekko-connectors aws-spi-pekko-http implements the AWS SDK async HTTP client SPI with Http().singleRequest. The SDK signs the request (SigV4) with the URI-encoded path it built, e.g. /a%2Bb for S3 object key a+b; the transport must send that path byte-identically. After the Uri round trip the wire path is /a+b, and S3 — which verifies the signature against the path as received, without normalization — rejects the request with SignatureDoesNotMatch. Any S3 object key containing sub-delims characters (+ = ! ( ) , ; ' & $ @ : *) is affected. The same applies to any proxy/pass-through use case that must not alter the request target.
Proposal
Add a way to send a request whose path renders exactly as provided. Options, roughly in order of preference:
- A raw
Uri.Pathrepresentation (e.g. a segment/path variant flagged as already-encoded) thatrenderPathemits verbatim. - An
HttpRequestattribute carrying a pre-rendered request target that the client renderer honors (analogous in spirit to the server-sideraw-request-uri-header).
With either, aws-spi-pekko-http can pass SdkHttpRequest.encodedPath() through untouched.
References
UriParserpercent-decodes matched strings when a%was seen.Uri.scalarenderPath/encode: keep-set ispchar-base(excludes%), so encoded pchars are irrecoverable and literal%double-encodes.
- Lingua principale
- Scala
- Stelle
- 196
- Fork
- 56
- Merge medio
- 1g 18h
- PR unite (30g)
- 43
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/pekko-http
-
dependencies
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
apache/pekko-http#1354 ·
I maintainer di solito rispondono entro 1 giorno
-
HTTP/2 client ALPN fallback needs a handshake-complete signal that the TLS stage does not emitAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
apache/pekko-http#1249 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
apache/pekko-http#1248 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
apache/pekko-http#1180 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
apache/pekko-http#1112 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/pekko-http
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 91/100
com-vitthalmirji/toon4s#117 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
zio/zio-blocks#1780 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
digital-asset/participant-query-store#168 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
propensive/soundness#2294 ·
I maintainer di solito rispondono entro 1 giorno