Skip to content

Add shareable links via URL fragment#15

Merged
kellenmurphy merged 3 commits into
mainfrom
feat/shareable-links
May 15, 2026
Merged

Add shareable links via URL fragment#15
kellenmurphy merged 3 commits into
mainfrom
feat/shareable-links

Conversation

@kellenmurphy

@kellenmurphy kellenmurphy commented May 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Copy link button appears in the heading row whenever the decoder has results (SAML, JWT, or generic); encodes the current input as base64url into `window.location.hash` and copies the full URL to the clipboard
  • On mount, if a hash is present, decodes it and pre-populates the textarea — any shared link opens directly into a decoded view
  • Payload never leaves the browser; the URL fragment is stripped before any HTTP request
  • `encodePayload`/`decodePayload` extracted to `src/lib/hash.ts` for testability; 13 tests covering all substitution paths (`+→-`, `/→_`, `=` stripping) and Unicode round-trips
  • 100% coverage maintained (380 statements, 219 branches, 48 functions)
  • README roadmap updated with full near/medium/long-term feature list

Test plan

  • Paste a JWT or SAML assertion — "Copy link" button appears in the top-right of the heading
  • Click "Copy link" — button shows "Copied!" briefly, clipboard contains a URL with a # fragment
  • Open the copied URL in a new tab — textarea pre-populates and decodes automatically
  • Clear the textarea — "Copy link" button disappears
  • Paste a Unicode-containing value — round-trips correctly through the hash
  • Navigate to the base URL with no hash — page loads normally with empty input
  • CI passes

Encode the current input as base64url into window.location.hash on
'Copy link'. On mount, if a hash is present, decode and pre-populate
the textarea so any shared link opens directly into a decoded view.
Payload never leaves the browser — the fragment is not sent to the server.

Update README roadmap to reflect current project state.
Encode the current input as base64url into window.location.hash on
'Copy link'. On mount, if a hash is present, decode and pre-populate
the textarea so any shared link opens directly into a decoded view.
Payload never leaves the browser — the fragment is not sent to the server.

encodePayload/decodePayload extracted to src/lib/hash.ts for testability.
100% coverage maintained (380 statements, 219 branches, 48 functions).

Update README roadmap with full near/medium/long-term feature list.
npm audit fix resolves:
- devalue 5.6.3-5.8.0 (high) — DoS via sparse array deserialization
- svelte <=5.55.6 (moderate) — SSR XSS via spread attributes, Promise
  serialization, DOM clobbering, and ReDoS in svelte:element validation

Remaining: cookie <0.7.0 (3x low) via @sveltejs/kit — the only available
fix downgrades SvelteKit to 0.0.30, which is a breaking change. CI uses
--audit-level=high so this does not block the build.
@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kellenmurphy
kellenmurphy merged commit 83d310e into main May 15, 2026
3 checks passed
kellenmurphy added a commit that referenced this pull request Jun 3, 2026
Scorecard Token-Permissions (code-scanning alert #15) flagged the deploy
job's job-level `deployments: write`. No step uses GitHub's Deployments
API — the `environment: production` record is created by GitHub itself,
and wrangler-action deploys to Cloudflare Pages without touching it. The
remaining id-token/attestations writes are required by attest-build-provenance.
@kellenmurphy
kellenmurphy deleted the feat/shareable-links branch July 3, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant