You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/01/30 15:55:16 UTC

[GitHub] [rocketmq-dashboard] xxd763795151 opened a new pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

xxd763795151 opened a new pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71


   ## What is the purpose of the change
    The rocketmq-dashboard supports ACL configuration, such as following: 
   ![image](https://user-images.githubusercontent.com/19887530/151706043-89065aa9-12bb-47d6-9759-6dffa8250a4d.png)
   Or
   ![image](https://user-images.githubusercontent.com/19887530/151706240-f52b6ffe-7575-42ba-836a-c470686f8751.png)
   
   Feature descirbe: 
   * the 'CRUD operation' of topic permission for an accessKey
   * the 'CRUD operation' of group permission for an accessKey
   * add/delete host white list
   * the acl info can be synchronized in the cluster from a broker to all broker when it is inconsistent(Why it may be inconsistent? For example, the acl info is add by manual in all brokers, one broker config error or forget to config; when we config acl, one broker is down in the cluster.)
   
   **Note: the Acl menu only appears when the accessKey and secretKey is not empty in the application.yml. **
   
   By the way, the last topic or group permission can not be deleted  if there is only one topic or group permission for an access key because of the rocketmq`s implemention. 
   
   ## Brief changelog
   
   XXXX
   
   ## Verifying this change
   
   XXXX
   
   Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.
   
   - [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. 
   - [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test).
   - [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test`  to make sure integration-test pass.
   - [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
   


-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] codecov-commenter edited a comment on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1042648255


   # [Codecov](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@6da21f4`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71/graphs/tree.svg?width=650&height=150&src=pr&token=48087JB59S&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master      #71   +/-   ##
   =========================================
     Coverage          ?   76.94%           
     Complexity        ?      821           
   =========================================
     Files             ?       91           
     Lines             ?     2837           
     Branches          ?      278           
   =========================================
     Hits              ?     2183           
     Misses            ?      500           
     Partials          ?      154           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [6da21f4...b1d436c](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] codecov-commenter edited a comment on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1042648255


   # [Codecov](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@6da21f4`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71/graphs/tree.svg?width=650&height=150&src=pr&token=48087JB59S&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master      #71   +/-   ##
   =========================================
     Coverage          ?   76.94%           
     Complexity        ?      821           
   =========================================
     Files             ?       91           
     Lines             ?     2837           
     Branches          ?      278           
   =========================================
     Hits              ?     2183           
     Misses            ?      500           
     Partials          ?      154           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [6da21f4...5ed049c](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] xxd763795151 commented on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
xxd763795151 commented on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1042652051


   Now, when enable login controle, different roles are treated differently, as following:
   the admin role:
   <img width="1706" alt="image" src="https://user-images.githubusercontent.com/19887530/154426516-12cec11c-d0c5-4630-a73e-331122865902.png">
   <img width="1614" alt="image" src="https://user-images.githubusercontent.com/19887530/154426569-ad27694b-ba18-4930-b365-562c2c7644a2.png">
   
   the normal role:
   <img width="1767" alt="image" src="https://user-images.githubusercontent.com/19887530/154426781-a1a6a880-33a5-41b5-8d7f-70c27be82bfa.png">
   <img width="1739" alt="image" src="https://user-images.githubusercontent.com/19887530/154426827-3918907e-550d-4273-b24e-74bba85260a3.png">
   
   
   @zhangjidi2016 @vongosling 
   Please review code again, thanks.


-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] xxd763795151 commented on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
xxd763795151 commented on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1025177604


   Sorry, I forget unit tests. I need  spend a little time to add some unit tests.  


-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] codecov-commenter commented on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1042648255


   # [Codecov](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@6da21f4`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71/graphs/tree.svg?width=650&height=150&src=pr&token=48087JB59S&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master      #71   +/-   ##
   =========================================
     Coverage          ?   76.94%           
     Complexity        ?      821           
   =========================================
     Files             ?       91           
     Lines             ?     2837           
     Branches          ?      278           
   =========================================
     Hits              ?     2183           
     Misses            ?      500           
     Partials          ?      154           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [6da21f4...b1d436c](https://codecov.io/gh/apache/rocketmq-dashboard/pull/71?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] zhangjidi2016 commented on a change in pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
zhangjidi2016 commented on a change in pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#discussion_r805537884



##########
File path: src/main/java/org/apache/rocketmq/dashboard/controller/AclController.java
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.rocketmq.dashboard.controller;
+
+import com.google.common.base.Preconditions;
+import java.util.List;
+import org.apache.rocketmq.common.AclConfig;
+import org.apache.rocketmq.common.PlainAccessConfig;
+import org.apache.rocketmq.dashboard.config.RMQConfigure;
+import org.apache.rocketmq.dashboard.model.request.AclRequest;
+import org.apache.rocketmq.dashboard.service.AclService;
+import org.apache.rocketmq.dashboard.support.JsonResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/acl")
+public class AclController {
+
+    @Autowired
+    private AclService aclService;
+
+    @Autowired
+    private RMQConfigure configure;
+
+    @GetMapping("/enable.query")
+    public Object isEnableAcl() {
+        return new JsonResult<>(configure.isACLEnabled());
+    }
+
+    @GetMapping("/config.query")
+    public AclConfig getAclConfig() {
+        return aclService.getAclConfig();
+    }
+
+    @PostMapping("/add.do")
+    public Object addAclConfig(@RequestBody PlainAccessConfig config) {
+        Preconditions.checkArgument(config.getAccessKey() != null && !config.getAccessKey().isEmpty(), "accessKey is null");

Review comment:
       Use StringUtils.isNotEmpty(config.getAccessKey()) instead




-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] xxd763795151 commented on a change in pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
xxd763795151 commented on a change in pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#discussion_r805572056



##########
File path: src/main/java/org/apache/rocketmq/dashboard/controller/AclController.java
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.rocketmq.dashboard.controller;
+
+import com.google.common.base.Preconditions;
+import java.util.List;
+import org.apache.rocketmq.common.AclConfig;
+import org.apache.rocketmq.common.PlainAccessConfig;
+import org.apache.rocketmq.dashboard.config.RMQConfigure;
+import org.apache.rocketmq.dashboard.model.request.AclRequest;
+import org.apache.rocketmq.dashboard.service.AclService;
+import org.apache.rocketmq.dashboard.support.JsonResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/acl")
+public class AclController {

Review comment:
       Oh, oh, okay. I will make some adjustments according to your suggestions later.
   @zhangjidi2016 




-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] xxd763795151 commented on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
xxd763795151 commented on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1038760632


   > 
   
   
   
   > Security key should be hidden by asterisks :-)
   
   About this, I hope you could think it about more. If it is necessary, I will adjust later.  Such as , it will show '********' , that hidden by asterisks, and there is a button on the side, click visible. Or hide this column , and add a 'Secret key ' button.


-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] xxd763795151 commented on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
xxd763795151 commented on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1044118336


   > > > 
   > > 
   > > 
   > > > Security key should be hidden by asterisks :-)
   > > 
   > > 
   > > About this, I hope you could think it about more. If it is necessary, I will adjust later. Such as , it will show '********' , that hidden by asterisks, and there is a button on the side, click visible. Or hide this column, and add a 'Secret key ' button.
   > 
   > As I said, Open Source projects also consider the common safety problem. Do you really see the downside of displaying security keys in clear text by default?
   
   @vongosling Yeah, u are right.  I just made some adjustments for it. Such as following: 
   ![image](https://user-images.githubusercontent.com/19887530/154643771-191b1d68-7916-42f2-bf0a-a369ca61c1e6.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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] StyleTang commented on a change in pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
StyleTang commented on a change in pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#discussion_r810600432



##########
File path: src/main/java/org/apache/rocketmq/dashboard/model/request/AclRequest.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.rocketmq.dashboard.model.request;
+
+import org.apache.rocketmq.common.PlainAccessConfig;
+

Review comment:
       Instead of adding getters/setters/toString manually, Lombok `@Data` can be used.
   ~public PlainAccessConfig getConfig() {~
   ~return config;~
   ~}~
   ```java
   @Data
   public class AclRequest {
   
   ```

##########
File path: src/main/java/org/apache/rocketmq/dashboard/controller/AclController.java
##########
@@ -0,0 +1,146 @@
+/*
+ * 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.rocketmq.dashboard.controller;
+
+import com.google.common.base.Preconditions;
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.rocketmq.common.AclConfig;
+import org.apache.rocketmq.common.PlainAccessConfig;
+import org.apache.rocketmq.dashboard.config.RMQConfigure;
+import org.apache.rocketmq.dashboard.model.User;
+import org.apache.rocketmq.dashboard.model.UserInfo;
+import org.apache.rocketmq.dashboard.model.request.AclRequest;
+import org.apache.rocketmq.dashboard.permisssion.Permission;
+import org.apache.rocketmq.dashboard.service.AclService;
+import org.apache.rocketmq.dashboard.support.JsonResult;
+import org.apache.rocketmq.dashboard.util.WebUtil;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/acl")
+@Permission
+public class AclController {
+
+    @Resource
+    private AclService aclService;
+
+    @Resource
+    private RMQConfigure configure;
+
+    @GetMapping("/enable.query")
+    public Object isEnableAcl() {
+        return new JsonResult<>(configure.isACLEnabled());
+    }
+
+    @GetMapping("/config.query")
+    public AclConfig getAclConfig(HttpServletRequest request) {
+        if (!configure.isLoginRequired()) {
+            return aclService.getAclConfig(false);
+        }
+        UserInfo userInfo = (UserInfo) WebUtil.getValueFromSession(request, WebUtil.USER_INFO);
+        // if user info is null but reach here, must exclude secret key for safety.
+        return aclService.getAclConfig(userInfo == null || userInfo.getUser().getType() != User.ADMIN);
+    }
+
+    @PostMapping("/add.do")
+    public Object addAclConfig(@RequestBody PlainAccessConfig config) {
+        Preconditions.checkArgument(StringUtils.isNotEmpty(config.getAccessKey()), "accessKey is null");
+        Preconditions.checkArgument(StringUtils.isNotEmpty(config.getSecretKey()), "secretKey is null");
+        aclService.addAclConfig(config);
+        return new JsonResult(0, "");

Review comment:
       We can just return true.
   ```java
   return true;
   ```

##########
File path: src/main/java/org/apache/rocketmq/dashboard/service/impl/AclServiceImpl.java
##########
@@ -0,0 +1,360 @@
+/*
+ * 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.rocketmq.dashboard.service.impl;
+
+import com.google.common.base.Throwables;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.rocketmq.client.exception.MQBrokerException;
+import org.apache.rocketmq.client.exception.MQClientException;
+import org.apache.rocketmq.common.AclConfig;
+import org.apache.rocketmq.common.MixAll;
+import org.apache.rocketmq.common.PlainAccessConfig;
+import org.apache.rocketmq.common.protocol.body.ClusterInfo;
+import org.apache.rocketmq.common.protocol.route.BrokerData;
+import org.apache.rocketmq.dashboard.model.request.AclRequest;
+import org.apache.rocketmq.dashboard.service.AbstractCommonService;
+import org.apache.rocketmq.dashboard.service.AclService;
+import org.apache.rocketmq.remoting.exception.RemotingConnectException;
+import org.apache.rocketmq.remoting.exception.RemotingException;
+import org.apache.rocketmq.remoting.exception.RemotingSendRequestException;
+import org.apache.rocketmq.remoting.exception.RemotingTimeoutException;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+public class AclServiceImpl extends AbstractCommonService implements AclService {
+
+    @Override
+    public AclConfig getAclConfig(boolean excludeSecretKey) {
+        try {
+            Optional<String> addr = getMasterSet().stream().findFirst();
+            if (addr.isPresent()) {
+                if (!excludeSecretKey) {
+                    return mqAdminExt.examineBrokerClusterAclConfig(addr.get());
+                } else {
+                    AclConfig aclConfig = mqAdminExt.examineBrokerClusterAclConfig(addr.get());
+                    if (CollectionUtils.isNotEmpty(aclConfig.getPlainAccessConfigs())) {
+                        aclConfig.getPlainAccessConfigs().forEach(pac -> pac.setSecretKey(null));
+                    }
+                    return aclConfig;
+                }
+            }
+        } catch (Exception e) {
+            log.error("getAclConfig error.", e);
+            throw Throwables.propagate(e);
+        }
+        AclConfig aclConfig = new AclConfig();
+        aclConfig.setGlobalWhiteAddrs(Collections.emptyList());
+        aclConfig.setPlainAccessConfigs(Collections.emptyList());
+        return aclConfig;
+    }
+
+    @Override
+    public void addAclConfig(PlainAccessConfig config) {
+        try {
+            Set<String> masterSet = getMasterSet();
+
+            if (masterSet.isEmpty()) {
+                throw new IllegalStateException("broker addr list is empty");
+            }
+            // check to see if account is exists
+            for (String addr :
+                masterSet) {

Review comment:
       can be on the same line.

##########
File path: src/main/java/org/apache/rocketmq/dashboard/controller/AclController.java
##########
@@ -0,0 +1,146 @@
+/*
+ * 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.rocketmq.dashboard.controller;
+
+import com.google.common.base.Preconditions;
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.rocketmq.common.AclConfig;
+import org.apache.rocketmq.common.PlainAccessConfig;
+import org.apache.rocketmq.dashboard.config.RMQConfigure;
+import org.apache.rocketmq.dashboard.model.User;
+import org.apache.rocketmq.dashboard.model.UserInfo;
+import org.apache.rocketmq.dashboard.model.request.AclRequest;
+import org.apache.rocketmq.dashboard.permisssion.Permission;
+import org.apache.rocketmq.dashboard.service.AclService;
+import org.apache.rocketmq.dashboard.support.JsonResult;
+import org.apache.rocketmq.dashboard.util.WebUtil;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/acl")
+@Permission
+public class AclController {
+
+    @Resource
+    private AclService aclService;
+
+    @Resource
+    private RMQConfigure configure;
+
+    @GetMapping("/enable.query")
+    public Object isEnableAcl() {
+        return new JsonResult<>(configure.isACLEnabled());
+    }
+
+    @GetMapping("/config.query")
+    public AclConfig getAclConfig(HttpServletRequest request) {
+        if (!configure.isLoginRequired()) {
+            return aclService.getAclConfig(false);
+        }
+        UserInfo userInfo = (UserInfo) WebUtil.getValueFromSession(request, WebUtil.USER_INFO);
+        // if user info is null but reach here, must exclude secret key for safety.
+        return aclService.getAclConfig(userInfo == null || userInfo.getUser().getType() != User.ADMIN);
+    }
+
+    @PostMapping("/add.do")
+    public Object addAclConfig(@RequestBody PlainAccessConfig config) {
+        Preconditions.checkArgument(StringUtils.isNotEmpty(config.getAccessKey()), "accessKey is null");
+        Preconditions.checkArgument(StringUtils.isNotEmpty(config.getSecretKey()), "secretKey is null");
+        aclService.addAclConfig(config);
+        return new JsonResult(0, "");
+    }
+
+    @PostMapping("/delete.do")
+    public Object deleteAclConfig(@RequestBody PlainAccessConfig config) {
+        Preconditions.checkArgument(StringUtils.isNotEmpty(config.getAccessKey()), "accessKey is null");
+        aclService.deleteAclConfig(config);
+        return new JsonResult(0, "");

Review comment:
       ditto




-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] xxd763795151 commented on a change in pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
xxd763795151 commented on a change in pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#discussion_r810634094



##########
File path: src/main/java/org/apache/rocketmq/dashboard/model/request/AclRequest.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.rocketmq.dashboard.model.request;
+
+import org.apache.rocketmq.common.PlainAccessConfig;
+

Review comment:
       Oh oh, Nice,   because I wrote these code in the year before last, I forgot whether it had import lombok on that time, so these code maybe not  elegant or simple.  I will adjust later again.




-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] vongosling commented on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
vongosling commented on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1038517045


   NIce job ~~~ I'd like to add another reviewer @zhangjidi2016 for this feature :-)


-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] vongosling commented on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
vongosling commented on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1043714595


   > > 
   > 
   > > Security key should be hidden by asterisks :-)
   > 
   > About this, I hope you could think it about more. If it is necessary, I will adjust later. Such as , it will show '********' , that hidden by asterisks, and there is a button on the side, click visible. Or hide this column, and add a 'Secret key ' button.
   
   As I said, Open Source projects also consider the common safety problem. Do you really see the downside of displaying security keys in clear text by default?  


-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] xxd763795151 commented on a change in pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
xxd763795151 commented on a change in pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#discussion_r810635557



##########
File path: src/main/java/org/apache/rocketmq/dashboard/controller/AclController.java
##########
@@ -0,0 +1,146 @@
+/*
+ * 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.rocketmq.dashboard.controller;
+
+import com.google.common.base.Preconditions;
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.rocketmq.common.AclConfig;
+import org.apache.rocketmq.common.PlainAccessConfig;
+import org.apache.rocketmq.dashboard.config.RMQConfigure;
+import org.apache.rocketmq.dashboard.model.User;
+import org.apache.rocketmq.dashboard.model.UserInfo;
+import org.apache.rocketmq.dashboard.model.request.AclRequest;
+import org.apache.rocketmq.dashboard.permisssion.Permission;
+import org.apache.rocketmq.dashboard.service.AclService;
+import org.apache.rocketmq.dashboard.support.JsonResult;
+import org.apache.rocketmq.dashboard.util.WebUtil;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/acl")
+@Permission
+public class AclController {
+
+    @Resource
+    private AclService aclService;
+
+    @Resource
+    private RMQConfigure configure;
+
+    @GetMapping("/enable.query")
+    public Object isEnableAcl() {
+        return new JsonResult<>(configure.isACLEnabled());
+    }
+
+    @GetMapping("/config.query")
+    public AclConfig getAclConfig(HttpServletRequest request) {
+        if (!configure.isLoginRequired()) {
+            return aclService.getAclConfig(false);
+        }
+        UserInfo userInfo = (UserInfo) WebUtil.getValueFromSession(request, WebUtil.USER_INFO);
+        // if user info is null but reach here, must exclude secret key for safety.
+        return aclService.getAclConfig(userInfo == null || userInfo.getUser().getType() != User.ADMIN);
+    }
+
+    @PostMapping("/add.do")
+    public Object addAclConfig(@RequestBody PlainAccessConfig config) {
+        Preconditions.checkArgument(StringUtils.isNotEmpty(config.getAccessKey()), "accessKey is null");
+        Preconditions.checkArgument(StringUtils.isNotEmpty(config.getSecretKey()), "secretKey is null");
+        aclService.addAclConfig(config);
+        return new JsonResult(0, "");

Review comment:
       I will adjust it later.   When I optimize code first time, I try return true, but it occur json error.  So I use this style as return value. But using this style, it doesn't seem to be a problem right now, I will optimize these code again.




-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] StyleTang commented on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
StyleTang commented on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1037696870


   @xxd763795151 
   Thanks for your contribution, I have some urgent things to do recently, will review your PR later.


-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] vongosling commented on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
vongosling commented on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1038510807


   Security key should be hidden by asterisks :-)


-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] zhangjidi2016 commented on a change in pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
zhangjidi2016 commented on a change in pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#discussion_r805545181



##########
File path: src/main/java/org/apache/rocketmq/dashboard/controller/AclController.java
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.rocketmq.dashboard.controller;
+
+import com.google.common.base.Preconditions;
+import java.util.List;
+import org.apache.rocketmq.common.AclConfig;
+import org.apache.rocketmq.common.PlainAccessConfig;
+import org.apache.rocketmq.dashboard.config.RMQConfigure;
+import org.apache.rocketmq.dashboard.model.request.AclRequest;
+import org.apache.rocketmq.dashboard.service.AclService;
+import org.apache.rocketmq.dashboard.support.JsonResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/acl")
+public class AclController {

Review comment:
       Add permission control for ACL-related operation interfaces for different login role

##########
File path: src/main/resources/static/view/pages/acl.html
##########
@@ -0,0 +1,468 @@
+<!--
+  ~ 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.
+  -->
+<div class="container-fluid" id="deployHistoryList">
+    <div class="modal-body">
+        <div ng-cloak="" class="tabsdemoDynamicHeight">
+            <md-content>
+                <md-tabs md-dynamic-height="" md-border-bottom="">
+                    <md-tab label="Account Info">
+                        <md-content class="md-padding" style="min-height:600px">
+                            <form class="form-inline pull-left col-sm-12">
+                                <div class="form-group">
+                                    <label>Access Key:</label>
+                                    <input class="form-control" style="width: 450px" type="text" ng-model="filterStr"/>
+                                </div>
+
+                                <button class="btn btn-raised btn-sm btn-primary" type="button"
+                                        ng-click="openAddDialog()">{{'ADD' |
+                                translate}}
+                                </button>
+                            </form>
+                            <table class="table table-bordered">
+                                <tr>
+                                    <th class="text-center">Access Key</th>
+                                    <th class="text-center">Secret Key</th>
+                                    <th class="text-center">{{'IS_ADMIN' | translate}}</th>
+                                    <th class="text-center">{{'DEFAULT_TOPIC_PERM' | translate}}</th>
+                                    <th class="text-center">{{'DEFAULT_GROUP_PERM' | translate}}</th>
+                                    <th class="text-center">{{'TOPIC_PERM' | translate}}</th>
+                                    <th class="text-center">{{'GROUP_PERM' | translate}}</th>
+                                    <th class="text-center">{{'OPERATION' | translate}}</th>
+                                </tr>
+                                <tr ng-repeat="item in plainAccessConfigs">
+                                    <td class="text-center">{{item.accessKey}}</td>
+                                    <td class="text-center">{{item.secretKey}}</td>
+                                    <td class="text-center">{{item.admin}}</td>
+                                    <td class="text-center">{{item.defaultTopicPerm}}</td>
+                                    <td class="text-center">{{item.defaultGroupPerm}}</td>
+                                    <td class="text-center">
+                                        <table ng-repeat="topic in item.topicPerms" class="perm-table">
+                                            <tr>
+                                                <td class="perm-tg">{{topic}}</td>
+                                                <td class="center"><a href="javascript:;"
+                                                                      ng-click="openUpdateTopicDialog(item, topic)">
+                                                    {{'UPDATE' | translate}}</a></td>
+                                                <td><a href="javascript:;"
+                                                       ng-confirm-click="Are you sure to delete {{topic}}?"
+                                                       confirmed-click="deletePermConfig(item, topic, 'topic')">{{'DELETE' | translate}}</a>
+                                                </td>
+                                            </tr>
+                                        </table>
+                                    </td>
+                                    <td class="text-center">
+                                        <table ng-repeat="group in item.groupPerms" class="perm-table">
+                                            <tr>
+                                                <td class="perm-tg">{{group}}</td>
+                                                <td class="center"><a href="javascript:;"
+                                                                      ng-click="openUpdateGroupDialog(item, group)">
+                                                    {{'UPDATE' | translate}}</a></td>
+                                                <td><a href="javascript:;"
+                                                       ng-confirm-click="Are you sure to delete {{group}}?"
+                                                       confirmed-click="deletePermConfig(item, group, 'group')">{{'DELETE' | translate}}</a>
+                                                </td>
+                                            </tr>
+                                        </table>
+                                    </td>
+                                    <td class="text-center">
+                                        <button class="btn btn-raised btn-sm btn-primary" type="button"
+                                                ng-click="openAddTopicDialog(item)">
+                                            {{'ADD' | translate}}topic
+                                        </button>
+                                        <button class="btn btn-raised btn-sm btn-primary" type="button"
+                                                ng-click="openAddGroupDialog(item)">
+                                            {{'ADD' | translate}}group
+                                        </button>
+                                        <button class="btn btn-raised btn-sm btn-primary" type="button"
+                                                ng-click="openUpdateDialog(item)">
+                                            {{'UPDATE' | translate}}
+                                        </button>
+                                        <button class="btn btn-raised btn-sm btn-danger" type="button"
+                                                ng-confirm-click="Are you sure to delete {{item.accessKey}}?"
+                                                confirmed-click="deleteAclConfig(item.accessKey)">{{'DELETE' | translate}}
+                                        </button>
+                                        <button class="btn btn-raised btn-sm btn-danger" type="button"
+                                                ng-click="synchronizeData(item)">{{'SYNCHRONIZE' | translate}}

Review comment:
       Hide action buttons based on login roles




-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] vongosling commented on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
vongosling commented on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1038510807






-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] StyleTang commented on pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
StyleTang commented on pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#issuecomment-1037696870


   @xxd763795151 
   Thanks for your contribution, I have some urgent things to do recently, will review your PR later.


-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] zhangjidi2016 commented on a change in pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
zhangjidi2016 commented on a change in pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71#discussion_r805539589



##########
File path: src/main/java/org/apache/rocketmq/dashboard/service/client/MQAdminExtImpl.java
##########
@@ -93,17 +93,17 @@ public void createAndUpdateTopicConfig(String addr, TopicConfig config)
 
     @Override public void createAndUpdatePlainAccessConfig(String addr,

Review comment:
       Annotations are placed on the line above the method




-- 
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@rocketmq.apache.org

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



[GitHub] [rocketmq-dashboard] StyleTang merged pull request #71: [ISSUE #70] The rocketmq-dashboard supports ACL configuration

Posted by GitBox <gi...@apache.org>.
StyleTang merged pull request #71:
URL: https://github.com/apache/rocketmq-dashboard/pull/71


   


-- 
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@rocketmq.apache.org

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