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

Open
#1,084 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@JAG-UK is already working on this.

Since Nov 6, 2026.

  • #1083 by @JAG-UK — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
32/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

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.

Written by the indexing model from the issue text.

Description

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).

Dominant language
TypeScript
Stars
27
Forks
35
Avg merge
1d 13h
Merged PRs (30d)
38

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FilOzone/synapse-sdk

All issues in FilOzone/synapse-sdk

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.