Skip to content

feat: implement CloudFront signed-cookie minting - #168

Merged
hweej merged 3 commits into
mainfrom
cloudfront-signing
Jul 7, 2026
Merged

feat: implement CloudFront signed-cookie minting#168
hweej merged 3 commits into
mainfrom
cloudfront-signing

Conversation

@hweej

@hweej hweej commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Implement real _mint_cloudfront signing (Piece 1 of auth: implement CloudFront signed-cookie minting for ambient Zarr access #166) — build a CloudFront custom policy (Resource: "{url}/*" per-dataset scope, DateLessThan = TTL epoch), RSA-SHA1 sign it with the PEM key, apply CloudFront's URL-safe base64. Replaces the "TODO" placeholders.
  • Declare cryptography explicitly (was only transitive via pyjwt[crypto]).
  • Return contract unchanged; HTTP_TOKEN path and mint_credentials dispatch untouched.

Test Plan

  • test_credentials.py (9 passed) — the happy-path test RSA-SHA1-verifies the signature against the public key, proving CloudFront would accept it; plus policy-shape, expiry-range, and missing/invalid-key error tests
  • full api suite: 288 passed

Piece 1 of #166 (signing only). Ambient Set-Cookie delivery (.cbioportal.org), frontend credentials: 'include', and the CloudFront key-group/distribution infra are separate follow-ups — this does not change prod behavior on its own.

@hweej hweej self-assigned this Jul 7, 2026
@hweej hweej added the enhancement New feature or request label Jul 7, 2026
@hweej
hweej merged commit 9d592e4 into main Jul 7, 2026
3 checks passed
@hweej
hweej deleted the cloudfront-signing branch July 7, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant