Skip to content

Conversation

@seefeldb
Copy link
Contributor

@seefeldb seefeldb commented Oct 1, 2025

Deno 2.5.2 has stricter type checking for WebCrypto and Web APIs. Uint8Array now has a buffer property typed as ArrayBufferLike (ArrayBuffer | SharedArrayBuffer), but WebCrypto APIs require the stricter BufferSource type with ArrayBuffer specifically.

Added explicit type casts to satisfy the stricter type requirements:

  • crypto.subtle.sign/verify/digest/importKey now require BufferSource casts
  • WebAuthn credential creation requires BufferSource casts for challenge and user.id
  • Response constructor requires BodyInit cast for Uint8Array bodies

🤖 Generated with Claude Code


Summary by cubic

Align WebCrypto, WebAuthn, and Response usage with Deno 2.5.2’s stricter types to fix TypeScript errors and restore builds.

  • Bug Fixes

    • Cast Uint8Array to BufferSource for crypto.subtle sign, verify, digest, and importKey.
    • Cast WebAuthn challenge and user.id to BufferSource in creation and assertion flows.
    • Cast Uint8Array to BodyInit when constructing Response.
    • Update hashing/ETag helpers to pass BufferSource to crypto.subtle.digest.
  • Dependencies

    • Require Deno 2.5.2 in tasks/check.sh.
    • Add --allow-write to deno test in packages/charm/deno.json.

Deno 2.5.2 has stricter type checking for WebCrypto and Web APIs.
Uint8Array now has a buffer property typed as ArrayBufferLike
(ArrayBuffer | SharedArrayBuffer), but WebCrypto APIs require the
stricter BufferSource type with ArrayBuffer specifically.

Added explicit type casts to satisfy the stricter type requirements:
- crypto.subtle.sign/verify/digest/importKey now require BufferSource casts
- WebAuthn credential creation requires BufferSource casts for challenge and user.id
- Response constructor requires BodyInit cast for Uint8Array bodies

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@seefeldb seefeldb requested a review from jsantell October 1, 2025 23:31
@seefeldb
Copy link
Contributor Author

seefeldb commented Oct 1, 2025

I'm not sure casing in so many places it the right thing, but it also didn't feel obviously right to move that cast higher up.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Copy link
Collaborator

@jsantell jsantell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@seefeldb seefeldb merged commit 0122c79 into main Oct 2, 2025
7 checks passed
@seefeldb seefeldb deleted the chore/upgrade-deno-to-2-5-2 branch October 2, 2025 18:12
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.

3 participants