fix(ts): some types polyshing, shorten filenames in web package dist/worker folder#1015
fix(ts): some types polyshing, shorten filenames in web package dist/worker folder#1015delagen wants to merge 1 commit into
Conversation
|
simolus3
left a comment
There was a problem hiding this comment.
While the logger type changes look reasonable to me, we're also working on a new major version of the SDK on the v2 branch that removes js-logger entirely. We're aiming to at least have a dev release for that out soon. So I'm not sure if it still makes sense to merge this.
| const escapedKey = this.options.encryptionKey.replace(/"/g, `""`); | ||
| await this.executeRaw(`PRAGMA key = "${escapedKey}"`); |
There was a problem hiding this comment.
Why would we use double quotes here? It should be a string literal, which uses single quotes. We don't currently support hexkeys, doing that would also require a new option to not break existing users.
There was a problem hiding this comment.
See the SQLCipher docs https://www.zetetic.net/sqlcipher/sqlcipher-api/#PRAGMA_key docs https://utelle.github.io/SQLite3MultipleCiphers/docs/configuration/config_sql_pragmas/#pragma-key--hexkey:
-- Example of a raw key for the SQLCipher scheme
PRAGMA key = "x'54686973206973206D792076657279207365637265742070617373776F72642E'";
Note that there is a difference between providing a raw key like that without key derivation, and providing a "passphrase" in hex to support binary data, using PRAGMA hexkey.
I'm not sure it's a good idea to let the user specify it in the above formats directly, but it could be nice to accept a Uint8Array key and/or raw key and do this conversion automatically.
Regardless, the current replace("'", "''") is a bug, since it would only replace the first quote.
There was a problem hiding this comment.
Yes, current is bugged, and doesn't accept other key types.
I thought about UInt8Array, but I didn't decide to change API, cause it doesn't solve other types, as Raw for example.
Introducing additional option may require additional validation to prevent provide both option at once.
There was a problem hiding this comment.
Reverted quotes back to literal, currently prefer using 'raw:hex' value. Also forced to using chacha20 cipher stated in docs, because seems it's not default
6ff37fe to
ec7b21f
Compare
…worker folder, shorten worker chunks names in dist folder
Fixed errors with skipLibCheck:false
Multiple errors as
Allow to use HEX key for encryption as stated in https://utelle.github.io/SQLite3MultipleCiphers/docs/configuration/config_sql_pragmas/#pragma-key--hexkey
by replacing quotes and forcefully set ChaCha20 as cipher, because under hood it's seems not default as stated in docs