Skip to content

DGS-21268 Add support for full payload encryption #347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rayokota
Copy link
Member

Please prefix all TypeScript pull-requests with [Typescript]

What

Add support for full payload encryption

Checklist

  • [Y] Contains customer facing changes? Including API/behavior changes
  • [Y] Did you add sufficient unit test and/or integration test coverage for this PR?
    • If not, please explain why it is not required

References

JIRA:

Test & Review

Open questions / Follow-ups

@Copilot Copilot AI review requested due to automatic review settings July 14, 2025 16:33
@rayokota rayokota requested review from a team as code owners July 14, 2025 16:33
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces full payload encryption support across Protobuf, JSON, and Avro serializers/deserializers by adding a new encoding phase, implementing a EncryptionExecutor, and updating tests to cover payload‐level encryption.

  • Introduce RulePhase.ENCODING and executeRulesWithPhase in core Serde to apply encoding‐phase rules
  • Implement EncryptionExecutor for payload encryption and refactor FieldEncryptionExecutor to delegate
  • Update serializers and deserializers to invoke encoding‐phase transforms and extend tests for payload encryption

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
schemaregistry/test/serde/protobuf.spec.ts Import EncryptionExecutor, switch to executor.client, add end‐to‐end payload encryption test
schemaregistry/test/serde/json.spec.ts Same changes for JSON: import EncryptionExecutor, add payload encryption test, adjust client assignment
schemaregistry/test/serde/avro.spec.ts Same changes for Avro, using registerWithClock and new payload encryption test
schemaregistry/serde/serde.ts Add RulePhase enum, executeRulesWithPhase method, and wiring for encoding rules
schemaregistry/serde/protobuf.ts Apply encoding‐phase rules around Protobuf payload before/after binary conversion
schemaregistry/serde/json.ts Apply encoding‐phase rules around JSON serialization/deserialization
schemaregistry/serde/avro.ts Apply encoding‐phase rules around Avro serialization/deserialization
schemaregistry/schemaregistry-client.ts Define RulePhase enum and add encodingRules to RuleSet
schemaregistry/rules/encryption/encrypt-executor.ts Implement EncryptionExecutor for full‐payload transform, refactor FieldEncryptionExecutor
Comments suppressed due to low confidence (6)

schemaregistry/rules/encryption/encrypt-executor.ts:1

  • The file uses FieldRuleExecutor, FieldTransform, FieldContext, and FieldType but does not import them. Add missing imports from '../../serde/serde'.
import {

schemaregistry/test/serde/protobuf.spec.ts:322

  • This payload decryption rule uses EncryptionExecutor (type 'ENCRYPT_PAYLOAD'), but the client is set on FieldEncryptionExecutor. It should configure the EncryptionExecutor instance instead.
    fieldEncryptionExecutor.executor.client = dekClient

schemaregistry/test/serde/json.spec.ts:551

  • This payload decryption rule uses EncryptionExecutor (type 'ENCRYPT_PAYLOAD'), but the client is set on FieldEncryptionExecutor. It should configure the EncryptionExecutor instance instead.
    fieldEncryptionExecutor.executor.client = dekClient

schemaregistry/test/serde/protobuf.spec.ts:29

  • [nitpick] After importing clearKmsClients, call clearKmsClients() before registering KMS drivers to ensure a clean KMS state for each test.
const encryptionExecutor = EncryptionExecutor.register()

schemaregistry/test/serde/json.spec.ts:29

  • [nitpick] After importing clearKmsClients, call clearKmsClients() before registering drivers to avoid leaking KMS state between tests.
const encryptionExecutor = EncryptionExecutor.register()

schemaregistry/test/serde/avro.spec.ts:321

  • [nitpick] After importing clearKmsClients, call clearKmsClients() before registering executors to reset KMS registry for test isolation.
const encryptionExecutor = EncryptionExecutor.registerWithClock(new FakeClock())

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