Querystring handling incorrect for signature generation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- aws, javascript
- Ambito
- authentication, cloud, security
Direzione di ricerca
Inizia in src/functions/auth/auth.mjs intorno alle righe 40-48 e confronta la costruzione attuale di HttpRequest con la documentazione sulla canonicalizzazione di AWS Signature Version 4. Esegui la funzione auth con una Lambda function URL contenente parametri di query, assicurandoti che i valori URI e query vengano passati separatamente. Il lavoro è completato quando le requests con query strings producono firme valide.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Came across the Protecting an AWS Lambda function URL with Amazon CloudFront and Lambda@Edge blog post. As I attempted to leverage the auth function in a more generalized solution, I encountered issues where the signature was invalid (example: The request signature we calculated does not match the signature you provided). After debugging and reviewing signature generation documentation, my issues were related to function url calls with querystring values. Specifically here:
Based on the signature generation documentation, it's important for the uri and querystrings to be handled separately for canonicalization. In order for valid signatures to be generated, I needed to change the above to something along the lines of the following where querystrings are provided to the request as a QueryParameterBag:
const query = {};
for (const qs of request.querystring.split('&')) {
const pieces = qs.split('=');
query[pieces[0]] = pieces[1];
}
// build the request to sign
const req = new HttpRequest({
hostname,
path: request.uri,
query: query,
body: (request.body && request.body.data) ? Buffer.from(request.body.data, request.body.encoding) : undefined,
method: request.method,
});
- Lingua principale
- TypeScript
- Stelle
- 27
- Fork
- 7
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri 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 aws-samples/aws-lambda-function-url-secured
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 42/100
-
Docker alpine dependency? Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
aws-samples/aws-lambda-function-url-secured#9 · 1 commento ·
Tutte le issue di aws-samples/aws-lambda-function-url-secured
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
copse-dev/agent-pane#2953 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Apertabug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
calcite-components needs triage refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Esri/calcite-design-system#15203 ·