keysmith: authorizationHeader takes now and refuses expired chains (after #1041)

Aperta
#1,084 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@JAG-UK ci sta già lavorando.

Dal 6/11/2026.

  • #1083 di @JAG-UK — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
32/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Read the authorizationHeader implementation, its tests, and the README API row, then compare its behavior with signRequest after #1041 lands. Add optional now handling and pass it through; keep the completed expiry check, test, and README updates in mind when checking the branch. Done means the header uses the fixed time and refuses expired chains consistently with signRequest.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Follow-up to #1083, once #1041 has merged.

#1083's authorizationHeader is built on master's signRequest, which takes no now and doesn't check the chain's expiry. #1041 adds both to signRequest: an optional now, a refusal for an expired chain ("get a new grant to …"), and a refusal for an expires outside the gate's window.

Once both are merged:

  • Add now? to authorizationHeader's input, compute expires from it, and pass it through to signRequest.
  • Drop the helper's own expiresIn bound check, since signRequest then refuses the same window. Keep its error message, or match signRequest's.
  • Tests: the header is refused for an expired chain, and is built at a fixed now. This replaces the Date.now()-based assertions.
  • README API row: authorizationHeader(signer, chain, { pieceCid, expiresIn?, now? }), which "refuses as signRequest does".

A reference version stacked on #1041 is on JAG-UK:feat/keysmith-authorization-header (76358ec).

Lingua principale
TypeScript
Stelle
27
Fork
35
Merge medio
1g 13h
PR unite (30g)
38

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FilOzone/synapse-sdk

Tutte le issue di FilOzone/synapse-sdk

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.