From commits-return-66135-archive-asf-public=cust-asf.ponee.io@pulsar.apache.org Tue Nov 3 14:08:11 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mailroute1-lw-us.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 758FF18064E for ; Tue, 3 Nov 2020 15:08:11 +0100 (CET) Received: from mail.apache.org (localhost [127.0.0.1]) by mailroute1-lw-us.apache.org (ASF Mail Server at mailroute1-lw-us.apache.org) with SMTP id ACE91121572 for ; Tue, 3 Nov 2020 14:08:10 +0000 (UTC) Received: (qmail 57908 invoked by uid 500); 3 Nov 2020 14:08:10 -0000 Mailing-List: contact commits-help@pulsar.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pulsar.apache.org Delivered-To: mailing list commits@pulsar.apache.org Received: (qmail 57896 invoked by uid 99); 3 Nov 2020 14:08:10 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Nov 2020 14:08:10 +0000 From: =?utf-8?q?GitBox?= To: commits@pulsar.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bpulsar=5D_wolfstudy_commented_on_a_change_in_pull_?= =?utf-8?q?request_=238432=3A_=5BIssue_8382=5D=5BPulsar_Function=5D_Enable_e?= =?utf-8?q?2e_encryption_for_Pulsar_Function?= Message-ID: <160441249037.15632.9404865489516101070.asfpy@gitbox.apache.org> Date: Tue, 03 Nov 2020 14:08:10 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit References: In-Reply-To: wolfstudy commented on a change in pull request #8432: URL: https://github.com/apache/pulsar/pull/8432#discussion_r516382652 ########## File path: pulsar-functions/proto/src/main/proto/Function.proto ########## @@ -100,12 +100,38 @@ message ConsumerSpec { ReceiverQueueSize receiverQueueSize = 4; map schemaProperties = 5; map consumerProperties = 6; + CryptoSpec cryptoSpec = 7; } message ProducerSpec { int32 maxPendingMessages = 1; int32 maxPendingMessagesAcrossPartitions = 2; bool useThreadLocalProducers = 3; + CryptoSpec cryptoSpec = 4; +} + +message CryptoSpec { + enum FailureAction { + FAIL = 0; + + DISCARD = 1; + CONSUME = 2; + + SEND = 10; Review comment: Why the `SEND` command value is `10`, Is there any special meaning here? We still reserve the middle value? ########## File path: pulsar-common/src/main/java/org/apache/pulsar/common/functions/CryptoConfig.java ########## @@ -0,0 +1,30 @@ +package org.apache.pulsar.common.functions; Review comment: Please add license header for new file. ########## File path: pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/CryptoUtils.java ########## @@ -0,0 +1,135 @@ +package org.apache.pulsar.functions.utils; Review comment: Please add license header fr new file. ########## File path: pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/RawFileKeyReader.java ########## @@ -0,0 +1,51 @@ +package org.apache.pulsar.functions.api.examples; + +import lombok.Data; +import org.apache.pulsar.client.api.CryptoKeyReader; +import org.apache.pulsar.client.api.EncryptionKeyInfo; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Map; + +@Data Review comment: Maybe we need to add comments to the newly created class, otherwise the check of ci may fail. ########## File path: pulsar-functions/java-examples/src/main/java/org/apache/pulsar/functions/api/examples/RawFileKeyReader.java ########## @@ -0,0 +1,51 @@ +package org.apache.pulsar.functions.api.examples; Review comment: Please add the license header for new file. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org