Skip to content

feat: add browser and worker runtime compatibility checks for crypto … - #1801

Open
Timothy2025-20 wants to merge 2 commits into
Stellar-Mail:mainfrom
Timothy2025-20:feature/crypto-runtime-compat
Open

feat: add browser and worker runtime compatibility checks for crypto …#1801
Timothy2025-20 wants to merge 2 commits into
Stellar-Mail:mainfrom
Timothy2025-20:feature/crypto-runtime-compat

Conversation

@Timothy2025-20

Copy link
Copy Markdown

gh pr create
--title "feat: add browser and worker runtime compatibility checks for crypto primitives"
--body "## Description
This PR adds runtime compatibility checks for crypto primitives to ensure consistent behavior across browser, worker, and server environments.

Changes

  • Added runtime capability checking for crypto, btoa, TextEncoder, Web Crypto
  • Created CryptoAdapter with typed capability errors
  • Ensured production never falls back to insecure randomness
  • Added tests for browser-like, worker-like, and missing-capability environments
  • Updated documentation

Acceptance Criteria Met

  • Required primitives are checked before use
  • Unsupported runtimes return a typed capability error
  • Production never falls back to insecure randomness
  • Tests cover browser-like, worker-like, and missing-capability environments

Closes #1720

…primitives

- Add runtime capability checking for crypto, btoa, TextEncoder, Web Crypto
- Create CryptoAdapter with typed capability errors
- Ensure production never falls back to insecure randomness
- Add tests for browser-like, worker-like, and missing-capability environments
- Update documentation

Closes Stellar-Mail#1720
@kryputh

kryputh commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

@Timothy2025-20 fix CI

- Run Prettier on all files to fix code style issues
- All files now pass Prettier checks

Closes Stellar-Mail#1720
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.

Add browser and worker runtime compatibility checks for crypto primitives

2 participants