Skip to content

Fix ISealOptions TypeScript type to include skipEncryption#64

Open
rubenhensen wants to merge 1 commit intomainfrom
fix/pg-wasm-seal-options-types
Open

Fix ISealOptions TypeScript type to include skipEncryption#64
rubenhensen wants to merge 1 commit intomainfrom
fix/pg-wasm-seal-options-types

Conversation

@rubenhensen
Copy link
Contributor

@rubenhensen rubenhensen commented Mar 4, 2026

Summary

Re-applies the changes from the unmerged skip-encryption branch (commit 0944abe by @Iso5786) which were lost when commit b01170b was merged without including them. The npm package @e4a/pg-wasm@0.3.7 was published from a build that included these changes, but main never got them — causing a mismatch between the published types/binary and the source code.

Changes:

  • Add skipEncryption?: boolean to the TypeScript ISealOptions interface
  • Make policy optional in both TS type and Rust struct (Option<EncryptionPolicy>)
  • Add skip_encryption: Option<bool> to SealOptions Rust struct
  • Implement default policy logic in js_seal and js_stream_seal — when skipEncryption is true, uses a default policy so anyone can decrypt (sign-only mode)
  • Update existing tests for new SealOptions fields
  • Add test_seal_unseal_web_to_rust_skip_enc streaming test

The origin/skip-encryption branch can be deleted after this is merged.

Closes #63

Test plan

  • Verify sealStream() works without skipEncryption (defaults to false)
  • Verify sealStream() works with skipEncryption: true (uses default policy)
  • Run WASM tests (wasm-pack test)

Re-apply the changes from the unmerged `skip-encryption` branch
(commit 0944abe) which were lost when commit b01170b was merged
without including them.

When `skipEncryption` is true, a default policy is used so that
anyone can decrypt (sign-only mode).

Changes:
- Add `skipEncryption?: boolean` to the TS type definition
- Make `policy` optional in both TS type and Rust struct
- Add `skip_encryption: Option<bool>` to SealOptions
- Implement default policy logic in js_seal and js_stream_seal
- Update existing tests for new SealOptions fields
- Add skip encryption streaming test

Closes #63
@rubenhensen rubenhensen force-pushed the fix/pg-wasm-seal-options-types branch from 83b74b9 to f276b5a Compare March 4, 2026 13:58
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.

pg-wasm: ISealOptions TypeScript type missing skipEncryption field

1 participant