You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by "slowpao (via GitHub)" <gi...@apache.org> on 2023/03/01 00:59:36 UTC

[GitHub] [incubator-eventmesh] slowpao opened a new pull request, #3303: [ISSUE #3141] add producer acl authentication

slowpao opened a new pull request, #3303:
URL: https://github.com/apache/incubator-eventmesh/pull/3303

   <!--
   ### Contribution Checklist
   
     - Name the pull request in the form "[ISSUE #XXXX] Title of the pull request", 
       where *XXXX* should be replaced by the actual issue number.
       Skip *[ISSUE #XXXX]* if there is no associated github issue for this pull request.
   
     - Fill out the template below to describe the changes contributed by the pull request. 
       That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue. 
       Please do not mix up code from multiple issues.
     
     - Each commit in the pull request should have a meaningful commit message.
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, 
       leaving only the filled out template below.
   
   (The sections below can be removed for hotfixes of typos)
   -->
   
   <!--
   (If this PR fixes a GitHub issue, please add `Fixes #<XXX>` or `Closes #<XXX>`.)
   -->
   
   Fixes #<XXXX>.
   
   ### Motivation
   
   *Explain the content here.*
   *Explain why you want to make the changes and what problem you're trying to solve.*
   
   
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   
   
   ### Documentation
   
   - Does this pull request introduce a new feature? (yes / no)
   - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
   - If a feature is not applicable for documentation, explain why?
   - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


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

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] mytang0 commented on a diff in pull request #3303: [ISSUE #3141] add producer acl authentication

Posted by "mytang0 (via GitHub)" <gi...@apache.org>.
mytang0 commented on code in PR #3303:
URL: https://github.com/apache/incubator-eventmesh/pull/3303#discussion_r1123058876


##########
eventmesh-common/src/test/java/org/apache/eventmesh/common/file/WatchFileManagerTest.java:
##########
@@ -33,29 +36,36 @@
 public class WatchFileManagerTest {
 
     @Test
-    public void testWatchFile() throws IOException, InterruptedException {
-        String file = WatchFileManagerTest.class.getResource("/configuration.properties").getFile();
-        File f = new File(file);
+    public void testWatchFile() {
+        String resourceUrl = WatchFileManagerTest.class.getResource("/configuration.properties").getFile();
+        File file = new File(resourceUrl);
         final FileChangeListener fileChangeListener = new FileChangeListener() {
             @Override
             public void onChanged(FileChangeContext changeContext) {
-                Assert.assertEquals(f.getName(), changeContext.getFileName());
-                Assert.assertEquals(f.getParent(), changeContext.getDirectoryPath());
+                Assert.assertEquals(file.getName(), changeContext.getFileName());
+                Assert.assertEquals(file.getParent(), changeContext.getDirectoryPath());
             }
 
             @Override
             public boolean support(FileChangeContext changeContext) {
-                return changeContext.getWatchEvent().context().toString().contains(f.getName());
+                return changeContext.getWatchEvent().context().toString().contains(file.getName());
             }
         };
-        WatchFileManager.registerFileChangeListener(f.getParent(), fileChangeListener);
+        WatchFileManager.registerFileChangeListener(file.getParent(), fileChangeListener);
 
+        Path path = Paths.get(resourceUrl);
         Properties properties = new Properties();
-        properties.load(new BufferedReader(new FileReader(file)));
+        try (BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8)) {
+            properties.load(reader);
+        } catch (IOException e) {
+            Assert.fail("Test failed to load from file");
+        }
         properties.setProperty("eventMesh.server.newAdd", "newAdd");
-        FileWriter fw = new FileWriter(file);
-        properties.store(fw, "newAdd");
-
+        try (BufferedWriter writer = Files.newBufferedWriter(path, StandardCharsets.UTF_8)) {

Review Comment:
   Please replace 'StandardCharsets.UTF_8' with the definition from the common package.



##########
eventmesh-registry-plugin/eventmesh-registry-api/src/main/java/org/apache/eventmesh/api/registry/bo/EventMeshServicePubTopicInfo.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.api.registry.bo;
+
+import java.util.Set;
+
+public class EventMeshServicePubTopicInfo {
+
+    String service;
+    Set<String> topics;
+    String token;
+
+    public String getService() {
+        return service;
+    }
+
+    public void setService(String service) {
+        this.service = service;
+    }
+
+    public Set<String> getTopics() {
+        return topics;
+    }
+
+    public void setTopics(Set<String> topics) {
+        this.topics = topics;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    @Override
+    public String toString() {
+        return "EventMeshServicePubTopicInfo{"
+            + "service='" + service + '\''
+            + ", topics=" + topics
+            + '}';
+    }
+}

Review Comment:
   It is recommended to add code comments



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

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] xwm1992 merged pull request #3303: [ISSUE #3141] add producer acl authentication

Posted by "xwm1992 (via GitHub)" <gi...@apache.org>.
xwm1992 merged PR #3303:
URL: https://github.com/apache/incubator-eventmesh/pull/3303


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

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] slowpao commented on a diff in pull request #3303: [ISSUE #3141] add producer acl authentication

Posted by "slowpao (via GitHub)" <gi...@apache.org>.
slowpao commented on code in PR #3303:
URL: https://github.com/apache/incubator-eventmesh/pull/3303#discussion_r1123257561


##########
eventmesh-common/src/test/java/org/apache/eventmesh/common/file/WatchFileManagerTest.java:
##########
@@ -33,29 +36,36 @@
 public class WatchFileManagerTest {
 
     @Test
-    public void testWatchFile() throws IOException, InterruptedException {
-        String file = WatchFileManagerTest.class.getResource("/configuration.properties").getFile();
-        File f = new File(file);
+    public void testWatchFile() {
+        String resourceUrl = WatchFileManagerTest.class.getResource("/configuration.properties").getFile();
+        File file = new File(resourceUrl);
         final FileChangeListener fileChangeListener = new FileChangeListener() {
             @Override
             public void onChanged(FileChangeContext changeContext) {
-                Assert.assertEquals(f.getName(), changeContext.getFileName());
-                Assert.assertEquals(f.getParent(), changeContext.getDirectoryPath());
+                Assert.assertEquals(file.getName(), changeContext.getFileName());
+                Assert.assertEquals(file.getParent(), changeContext.getDirectoryPath());
             }
 
             @Override
             public boolean support(FileChangeContext changeContext) {
-                return changeContext.getWatchEvent().context().toString().contains(f.getName());
+                return changeContext.getWatchEvent().context().toString().contains(file.getName());
             }
         };
-        WatchFileManager.registerFileChangeListener(f.getParent(), fileChangeListener);
+        WatchFileManager.registerFileChangeListener(file.getParent(), fileChangeListener);
 
+        Path path = Paths.get(resourceUrl);
         Properties properties = new Properties();
-        properties.load(new BufferedReader(new FileReader(file)));
+        try (BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8)) {
+            properties.load(reader);
+        } catch (IOException e) {
+            Assert.fail("Test failed to load from file");
+        }
         properties.setProperty("eventMesh.server.newAdd", "newAdd");
-        FileWriter fw = new FileWriter(file);
-        properties.store(fw, "newAdd");
-
+        try (BufferedWriter writer = Files.newBufferedWriter(path, StandardCharsets.UTF_8)) {

Review Comment:
   OK, I will fix it next time I submit



##########
eventmesh-registry-plugin/eventmesh-registry-api/src/main/java/org/apache/eventmesh/api/registry/bo/EventMeshServicePubTopicInfo.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.api.registry.bo;
+
+import java.util.Set;
+
+public class EventMeshServicePubTopicInfo {
+
+    String service;
+    Set<String> topics;
+    String token;
+
+    public String getService() {
+        return service;
+    }
+
+    public void setService(String service) {
+        this.service = service;
+    }
+
+    public Set<String> getTopics() {
+        return topics;
+    }
+
+    public void setTopics(Set<String> topics) {
+        this.topics = topics;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    @Override
+    public String toString() {
+        return "EventMeshServicePubTopicInfo{"
+            + "service='" + service + '\''
+            + ", topics=" + topics
+            + '}';
+    }
+}

Review Comment:
   OK, I will fix it next time I submit



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

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] mytang0 commented on pull request #3303: [ISSUE #3141] add producer acl authentication

Posted by "mytang0 (via GitHub)" <gi...@apache.org>.
mytang0 commented on PR #3303:
URL: https://github.com/apache/incubator-eventmesh/pull/3303#issuecomment-1451821442

   Please fix the license check error
   <img width="623" alt="image" src="https://user-images.githubusercontent.com/29346818/222433844-b5369926-09f2-40dd-a229-e30140af4e09.png">
   


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

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] codecov[bot] commented on pull request #3303: [ISSUE #3141] add producer acl authentication

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #3303:
URL: https://github.com/apache/incubator-eventmesh/pull/3303#issuecomment-1449191158

   # [Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#3303](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e696729) into [master](https://codecov.io/gh/apache/incubator-eventmesh/commit/8a014d4d2d003d58f612cea0d086ede7208b6f4a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8a014d4) will **decrease** coverage by `0.05%`.
   > The diff coverage is `1.76%`.
   
   > :exclamation: Current head e696729 differs from pull request most recent head 1b5313a. Consider uploading reports for the commit 1b5313a to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3303      +/-   ##
   ============================================
   - Coverage     13.08%   13.04%   -0.05%     
     Complexity     1159     1159              
   ============================================
     Files           550      552       +2     
     Lines         28715    28813      +98     
     Branches       2852     2851       -1     
   ============================================
   + Hits           3757     3758       +1     
   - Misses        24632    24732     +100     
   + Partials        326      323       -3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...in/java/org/apache/eventmesh/common/Constants.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL2NvbW1vbi9Db25zdGFudHMuamF2YQ==) | `85.71% <ø> (ø)` | |
   | [...tmesh/common/protocol/http/common/ProtocolKey.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL2NvbW1vbi9wcm90b2NvbC9odHRwL2NvbW1vbi9Qcm90b2NvbEtleS5qYXZh) | `0.00% <ø> (ø)` | |
   | [...h/connector/pulsar/client/PulsarClientWrapper.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLWNvbm5lY3Rvci1wbHVnaW4vZXZlbnRtZXNoLWNvbm5lY3Rvci1wdWxzYXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9jb25uZWN0b3IvcHVsc2FyL2NsaWVudC9QdWxzYXJDbGllbnRXcmFwcGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...ntmesh/connector/pulsar/producer/ProducerImpl.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLWNvbm5lY3Rvci1wbHVnaW4vZXZlbnRtZXNoLWNvbm5lY3Rvci1wdWxzYXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9jb25uZWN0b3IvcHVsc2FyL3Byb2R1Y2VyL1Byb2R1Y2VySW1wbC5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...registry/consul/service/ConsulRegistryService.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJlZ2lzdHJ5LXBsdWdpbi9ldmVudG1lc2gtcmVnaXN0cnktY29uc3VsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvcmVnaXN0cnkvY29uc3VsL3NlcnZpY2UvQ29uc3VsUmVnaXN0cnlTZXJ2aWNlLmphdmE=) | `44.44% <0.00%> (-0.72%)` | :arrow_down: |
   | [...tmesh/registry/etcd/service/EtcdCustomService.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJlZ2lzdHJ5LXBsdWdpbi9ldmVudG1lc2gtcmVnaXN0cnktZXRjZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL3JlZ2lzdHJ5L2V0Y2Qvc2VydmljZS9FdGNkQ3VzdG9tU2VydmljZS5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...esh/registry/etcd/service/EtcdRegistryService.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJlZ2lzdHJ5LXBsdWdpbi9ldmVudG1lc2gtcmVnaXN0cnktZXRjZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL3JlZ2lzdHJ5L2V0Y2Qvc2VydmljZS9FdGNkUmVnaXN0cnlTZXJ2aWNlLmphdmE=) | `21.60% <0.00%> (-0.18%)` | :arrow_down: |
   | [...h/registry/nacos/service/NacosRegistryService.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJlZ2lzdHJ5LXBsdWdpbi9ldmVudG1lc2gtcmVnaXN0cnktbmFjb3Mvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9yZWdpc3RyeS9uYWNvcy9zZXJ2aWNlL05hY29zUmVnaXN0cnlTZXJ2aWNlLmphdmE=) | `38.63% <0.00%> (-0.30%)` | :arrow_down: |
   | [...ry/zookeeper/service/ZookeeperRegistryService.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJlZ2lzdHJ5LXBsdWdpbi9ldmVudG1lc2gtcmVnaXN0cnktem9va2VlcGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvcmVnaXN0cnkvem9va2VlcGVyL3NlcnZpY2UvWm9va2VlcGVyUmVnaXN0cnlTZXJ2aWNlLmphdmE=) | `77.27% <0.00%> (-0.51%)` | :arrow_down: |
   | [...ain/java/org/apache/eventmesh/runtime/acl/Acl.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FjbC9BY2wuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | ... and [19 more](https://codecov.io/gh/apache/incubator-eventmesh/pull/3303?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


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

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org