Skip to content

Commit

Permalink
fix(specUpdate): update "ce_" header names to comply with the CloudEv…
Browse files Browse the repository at this point in the history
…ent specification.

See: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#attribute-naming-convention
Old header names starts with "ce_encryption.ref.". The new header names starts with "ce_e2ee"
  • Loading branch information
andrekaplick5678 committed Nov 3, 2023
1 parent d03d8d4 commit efdc140
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface KafkaEncryptionHelper {
/**
* Name of Kafka CloudEvent Header for the initialization vector for the payload (or value)
*/
String KAFKA_CE_HEADER_IV_VALUE = "ce_encryption.ref.iv";
String KAFKA_CE_HEADER_IV_VALUE = "ce_e2eeiv";

/**
* Name of Kafka Header for the cipher metadata for the partition key
Expand All @@ -36,11 +36,11 @@ public interface KafkaEncryptionHelper {
/**
* Name of Kafka CloudEvent Header for the cipher version for the payload (or value)
*/
String KAFKA_CE_HEADER_CIPHER_VERSION_VALUE = "ce_encryption.ref.cipher.version";
String KAFKA_CE_HEADER_CIPHER_VERSION_VALUE = "ce_e2eekeyversion";
/**
* Name of Kafka CloudEvent Header for the cipher name for the payload (or value)
*/
String KAFKA_CE_HEADER_CIPHER_NAME_VALUE = "ce_encryption.ref.cipher.name";
String KAFKA_CE_HEADER_CIPHER_NAME_VALUE = "ce_e2eekeyname";

static String headerNameIv(boolean isForKey) {
if (isForKey) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ void shouldCreateAesEncryptedPayloadForValue() {
// then: all expected kafka headers should have been set
assertThat(kafkaHeaders.keySet())
.containsExactlyInAnyOrder("encryption/iv", "encryption/ciphers",
"ce_encryption.ref.iv", "ce_encryption.ref.cipher.version",
"ce_encryption.ref.cipher.name");
"ce_e2eeiv", "ce_e2eekeyversion",
"ce_e2eekeyname");
}

@Test
Expand Down

0 comments on commit efdc140

Please sign in to comment.