From efdc140bb63646772e294682f6e824fae947e95f Mon Sep 17 00:00:00 2001 From: Andre Kaplick Date: Fri, 3 Nov 2023 13:15:55 +0100 Subject: [PATCH] fix(specUpdate): update "ce_" header names to comply with the CloudEvent 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" --- .../de/otto/kafka/messaging/e2ee/KafkaEncryptionHelper.java | 6 +++--- .../kafka/messaging/e2ee/KafkaEncryptionHelperTest.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/otto/kafka/messaging/e2ee/KafkaEncryptionHelper.java b/src/main/java/de/otto/kafka/messaging/e2ee/KafkaEncryptionHelper.java index 9ebbfc5..1218876 100644 --- a/src/main/java/de/otto/kafka/messaging/e2ee/KafkaEncryptionHelper.java +++ b/src/main/java/de/otto/kafka/messaging/e2ee/KafkaEncryptionHelper.java @@ -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 @@ -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) { diff --git a/src/test/java/de/otto/kafka/messaging/e2ee/KafkaEncryptionHelperTest.java b/src/test/java/de/otto/kafka/messaging/e2ee/KafkaEncryptionHelperTest.java index 611bbf0..d6deab6 100644 --- a/src/test/java/de/otto/kafka/messaging/e2ee/KafkaEncryptionHelperTest.java +++ b/src/test/java/de/otto/kafka/messaging/e2ee/KafkaEncryptionHelperTest.java @@ -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