Skip to content

DGS-21268 Add support for full payload encryption #1452

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

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:32
@rayokota rayokota requested review from a team as code owners July 14, 2025 16:32
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

Adds full payload encryption support by introducing rule phases, integrating ExecuteRulesWithPhase into serializers/deserializers, and expanding test coverage for Protobuf, JSON Schema, and Avro payload encryption.

  • Introduce RulePhase enum and extend RuleSet.HasRules for migration, domain, and encoding phases
  • Update serializers and deserializers to call ExecuteRulesWithPhase before writing/after reading payloads
  • Add end-to-end tests for payload encryption in Protobuf, JSON Schema, and Avro

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
schemaregistry/serde/serde.go Added ExecuteRulesWithPhase and rule-phase logic
schemaregistry/serde/protobuf/protobuf.go Wrapped payload in encryption rules before serializing
schemaregistry/serde/protobuf/protobuf_test.go New test for Protobuf payload encryption
schemaregistry/serde/jsonschema/json_schema.go Wrapped payload in encryption rules before serializing
schemaregistry/serde/jsonschema/json_schema_test.go New test for JSON Schema payload encryption
schemaregistry/serde/avrov2/avro.go Wrapped payload in encryption rules before serializing
schemaregistry/serde/avrov2/avro_test.go New test for Avro payload encryption
schemaregistry/schemaregistry_client.go Added RulePhase constants and EncodingRules in RuleSet
schemaregistry/rules/encryption/* Refactored and added payload encryption executors and tests
Comments suppressed due to low confidence (3)

schemaregistry/serde/protobuf/protobuf.go:251

  • The variable subject is undefined in this scope; it should be topic or the appropriate subject string to avoid compilation errors.
	msg, err = s.ExecuteRulesWithPhase(subject, topic,

schemaregistry/serde/jsonschema/json_schema.go:151

  • The variable subject is undefined here; replace with topic or the correct subject identifier to fix the compilation error.
	msg, err = s.ExecuteRulesWithPhase(subject, topic,

schemaregistry/serde/avrov2/avro.go:146

  • Undefined variable subject used; substitute with topic, or correctly compute the subject, to resolve compilation errors.
	msg, err = s.ExecuteRulesWithPhase(subject, topic,

@sonarqube-confluent
Copy link

Failed

  • 44.60% Coverage on New Code (is less than 80.00%)

Analysis Details

48 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 48 Code Smells

Coverage and Duplications

  • Coverage 44.60% Coverage (55.40% Estimated after merge)
  • Duplications No duplication information (0.50% Estimated after merge)

Project ID: confluent-kafka-go

View in SonarQube

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