Skip to content

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 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 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

Copy link
Contributor

@Claimundefine Claimundefine left a comment

Choose a reason for hiding this comment

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

LGTM

@rayokota rayokota merged commit 2a197ce into master Jul 18, 2025
2 of 3 checks passed
@rayokota rayokota deleted the encrypt-payload branch July 18, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants