Page MenuHomePhabricator

[web] Add Flow types for WebCrypto / SubtleCrypto
AbandonedPublic

Authored by bartek on Mar 9 2023, 10:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 4, 11:38 PM
Unknown Object (File)
Wed, Apr 3, 7:40 AM
Unknown Object (File)
Wed, Apr 3, 7:39 AM
Unknown Object (File)
Wed, Apr 3, 7:32 AM
Unknown Object (File)
Feb 21 2024, 2:50 AM
Unknown Object (File)
Feb 21 2024, 2:50 AM
Unknown Object (File)
Feb 13 2024, 12:13 AM
Unknown Object (File)
Feb 12 2024, 10:30 PM
Subscribers

Details

Summary

The WebCrypto APIs are missing in Flow - see this GH issue: https://github.com/facebook/flow/issues/5019
There was a PR adding them but it was closed: https://github.com/facebook/flow/pull/7714

I copied the code from that PR and slightly modified it by removing TODO types
that were breaking type checks on valid code. Also made small adjustments for this
to fit types described on MDN: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto

Test Plan

Flow doesn't complain. Tested this along with my code adding AES encryption.

Diff Detail

Repository
rCOMM Comm
Branch
barthap/aes-web
Lint
No Lint Coverage
Unit
No Test Coverage