Skip to content

fix(cdc): restore unbiasedByteModulo helper dropped in AES-GCM rewrite#86

Merged
khuepm merged 2 commits into
mainfrom
fix/access-cli-ci-diagnostics
Jun 12, 2026
Merged

fix(cdc): restore unbiasedByteModulo helper dropped in AES-GCM rewrite#86
khuepm merged 2 commits into
mainfrom
fix/access-cli-ci-diagnostics

Conversation

@khuepm

@khuepm khuepm commented Jun 12, 2026

Copy link
Copy Markdown
Owner

What changed

Restores the unbiasedByteModulo helper in apps/cms/src/modules/cdc/registry/encryption.ts, copied verbatim from the legacy XOR encryptor (commit 2b439ba).

Why

Main's CI is red: tsc fails with TS2304: Cannot find name 'unbiasedByteModulo' at encryption.ts:137. The AES-256-GCM rewrite kept decryptLegacyXor (read-only support for pre-AES rows via decryptCompat) but dropped the helper it calls.

Reviewer notes

  • The helper must match the legacy encryptor byte-for-byte — any change to the mapping breaks decryption of existing encrypted rows. It was restored verbatim.
  • Verified: pnpm -F @lumibase/cms typecheck passes; all 31 CDC registry tests pass (including legacy round-trip).

khuepm added 2 commits June 13, 2026 03:39
decryptLegacyXor still calls it for pre-AES rows, but the helper
definition was lost when the registry moved to AES-256-GCM, breaking
typecheck on main. Restored verbatim from the legacy encryptor —
changing the mapping would break decryption of existing rows.
@khuepm khuepm merged commit c2589a2 into main Jun 12, 2026
5 checks passed
@khuepm khuepm deleted the fix/access-cli-ci-diagnostics branch June 12, 2026 20:46
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.

1 participant