Page MenuHomePhabricator

[web] Add Flow types for WebCrypto / SubtleCrypto
AbandonedPublic

Authored by bartek on Thu, Mar 9, 10:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 25, 11:37 AM
Unknown Object (File)
Fri, Mar 24, 10:52 AM
Unknown Object (File)
Mon, Mar 20, 9:48 PM
Unknown Object (File)
Tue, Mar 14, 2:10 AM
Unknown Object (File)
Sat, Mar 11, 2:16 PM
Unknown Object (File)
Sat, Mar 11, 7:54 AM
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