You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/05/10 02:42:31 UTC

[GitHub] [apisix-ingress-controller] AlinsRan opened a new pull request, #1011: feat:add wolf-rbac authorized method.

AlinsRan opened a new pull request, #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011

   <!-- Please answer these questions before submitting a pull request -->
   
   ### Type of change:
   
   <!-- Please delete options that are not relevant. -->
   
   - [ ] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   ### Pre-submission checklist:
   
   <!--
   Please follow the requirements:
   1. Use Draft if the PR is not ready to be reviewed
   2. Test is required for the feat/fix PR, unless you have a good reason
   3. Doc is required for the feat PR
   4. Use a new commit to resolve review instead of `push -f`
   5. Use "request review" to notify the reviewer once you have resolved the review
   -->
   
   * [ ] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix-ingress-controller#community) first**
   


-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] tao12345666333 commented on a diff in pull request #1011: feat: add wolf-rbac authorization method.

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on code in PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011#discussion_r874711177


##########
test/e2e/testdata/wolf-rbac/start.sh:
##########
@@ -0,0 +1,61 @@
+#!/bin/sh

Review Comment:
   I think we can run it with the easiest way since it's just a test dependency. 



-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] AlinsRan commented on a diff in pull request #1011: feat: add wolf-rbac authorization method.

Posted by GitBox <gi...@apache.org>.
AlinsRan commented on code in PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011#discussion_r874605435


##########
test/e2e/testdata/wolf-rbac/start.sh:
##########
@@ -0,0 +1,61 @@
+#!/bin/sh

Review Comment:
   Yes, but it will be troublesome. The database needs to be deployed and initialized, and there are many changes to be made.



-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] tao12345666333 merged pull request #1011: feat: add wolf-rbac authorization method.

Posted by GitBox <gi...@apache.org>.
tao12345666333 merged PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011


-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] tokers commented on a diff in pull request #1011: feat:add wolf-rbac authorization method.

Posted by GitBox <gi...@apache.org>.
tokers commented on code in PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011#discussion_r873527562


##########
pkg/kube/apisix/apis/config/v2/types.go:
##########
@@ -355,6 +356,19 @@ type ApisixConsumerKeyAuthValue struct {
 	Key string `json:"key" yaml:"key"`
 }
 
+// ApisixConsumerWolfRbac defines the configuration for the wolf-rbac auth.
+type ApisixConsumerWolfRbac struct {

Review Comment:
   ```suggestion
   type ApisixConsumerWolfRBAC struct {
   ```



##########
pkg/kube/translation/apisix_consumer.go:
##########
@@ -38,6 +38,12 @@ func (t *translator) TranslateApisixConsumer(ac *configv2beta3.ApisixConsumer) (
 			return nil, fmt.Errorf("invalid basic auth config: %s", err)
 		}
 		plugins["basic-auth"] = cfg
+	} else if ac.Spec.AuthParameter.WolfRbac != nil {
+		cfg, err := t.translateConsumerWolfRbacPlugin(ac.Namespace, ac.Spec.AuthParameter.WolfRbac)
+		if err != nil {
+			return nil, fmt.Errorf("iinvalid wolf brac config: %s", err)

Review Comment:
   ```suggestion
   			return nil, fmt.Errorf("invalid wolf rbac config: %s", err)
   ```



##########
samples/deploy/crd/v1/ApisixConsumer.yaml:
##########
@@ -49,6 +49,7 @@ spec:
                   oneOf:
                     - required: ["basicAuth"]
                     - required: ["keyAuth"]
+                    - required: ["wolfRbac"]

Review Comment:
   ```suggestion
                       - required: ["wolfRBAC"]
   ```



-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] codecov-commenter commented on pull request #1011: feat:add wolf-rbac authorized method.

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011#issuecomment-1121828148

   # [Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1011?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 [#1011](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1011?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (20593f0) into [master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/92b89b37d2f63eab6f5c6deb6e3d2a5ccae975aa?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (92b89b3) will **increase** coverage by `0.13%`.
   > The diff coverage is `63.63%`.
   
   > :exclamation: Current head 20593f0 differs from pull request most recent head d291cd6. Consider uploading reports for the commit d291cd6 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1011      +/-   ##
   ==========================================
   + Coverage   31.91%   32.04%   +0.13%     
   ==========================================
     Files          73       73              
     Lines        7953     7986      +33     
   ==========================================
   + Hits         2538     2559      +21     
   - Misses       5139     5150      +11     
   - Partials      276      277       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1011?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [pkg/kube/translation/apisix\_route.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL2t1YmUvdHJhbnNsYXRpb24vYXBpc2l4X3JvdXRlLmdv) | `21.07% <0.00%> (-0.36%)` | :arrow_down: |
   | [pkg/kube/translation/apisix\_consumer.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL2t1YmUvdHJhbnNsYXRpb24vYXBpc2l4X2NvbnN1bWVyLmdv) | `71.42% <60.00%> (-3.58%)` | :arrow_down: |
   | [pkg/kube/translation/plugin.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1011/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL2t1YmUvdHJhbnNsYXRpb24vcGx1Z2luLmdv) | `100.00% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1011?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/apisix-ingress-controller/pull/1011?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 [795be22...d291cd6](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1011?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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] AlinsRan commented on a diff in pull request #1011: feat:add wolf-rbac authorized method.

Posted by GitBox <gi...@apache.org>.
AlinsRan commented on code in PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011#discussion_r872149700


##########
test/e2e/testdata/wolf-rbac/start.sh:
##########
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+#
+# 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.
+#
+
+cd testdata/wolf-rbac/
+
+wget https://raw.githubusercontent.com/iGeeky/wolf/master/server/script/db-psql.sql

Review Comment:
   OK.



-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] AlinsRan commented on a diff in pull request #1011: feat: add wolf-rbac authorization method.

Posted by GitBox <gi...@apache.org>.
AlinsRan commented on code in PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011#discussion_r874600849


##########
samples/deploy/crd/v1/ApisixConsumer.yaml:
##########
@@ -108,6 +109,12 @@ spec:
                         value:
                           type: object
                           properties:
+                            server:

Review Comment:
   Sorry, Didn't pay attention when resolving the conflict.



-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] tao12345666333 commented on a diff in pull request #1011: feat:add wolf-rbac authorized method.

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on code in PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011#discussion_r871512738


##########
pkg/kube/apisix/apis/config/v2/types.go:
##########
@@ -355,6 +356,19 @@ type ApisixConsumerKeyAuthValue struct {
 	Key string `json:"key" yaml:"key"`
 }
 
+// ApisixConsumerWolfRbac defines the configuration for the rbac auth.

Review Comment:
   ```suggestion
   // ApisixConsumerWolfRbac defines the configuration for the wolf-rbac auth.
   ```



##########
pkg/kube/apisix/apis/config/v2/types.go:
##########
@@ -355,6 +356,19 @@ type ApisixConsumerKeyAuthValue struct {
 	Key string `json:"key" yaml:"key"`
 }
 
+// ApisixConsumerWolfRbac defines the configuration for the rbac auth.
+type ApisixConsumerWolfRbac struct {
+	SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
+	Value     *ApisixConsumerWolfRbacValue `json:"value,omitempty" yaml:"value,omitempty"`
+}
+
+// ApisixConsumerWolfRbac defines the in-place server and appid and header_prefix configuration for rbac auth.

Review Comment:
   ```suggestion
   // ApisixConsumerWolfRbac defines the in-place server and appid and header_prefix configuration for wolf-rbac auth.
   ```



##########
pkg/kube/apisix/apis/config/v2beta3/types.go:
##########
@@ -356,6 +357,19 @@ type ApisixConsumerKeyAuthValue struct {
 	Key string `json:"key" yaml:"key"`
 }
 
+// ApisixConsumerWolfRbac defines the configuration for the rbac auth.
+type ApisixConsumerWolfRbac struct {
+	SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
+	Value     *ApisixConsumerWolfRbacValue `json:"value,omitempty" yaml:"value,omitempty"`
+}
+
+// ApisixConsumerWolfRbac defines the in-place server and appid and header_prefix  configuration for rbac auth.

Review Comment:
   ditto



##########
test/e2e/testdata/wolf-rbac/docker-compose.yaml:
##########
@@ -0,0 +1,60 @@
+version: '3'

Review Comment:
   Please add Apache License header



##########
test/e2e/testdata/wolf-rbac/db-psql.sql:
##########
@@ -0,0 +1,223 @@
+

Review Comment:
   Please add Apache License header



##########
test/e2e/testdata/wolf-rbac/stop.sh:
##########
@@ -0,0 +1,2 @@
+cd testdata/wolf-rbac/
+docker-compose -f 'docker-compose.yaml'  -p 'wolf-rbac' down

Review Comment:
   add EOL



##########
test/e2e/testdata/wolf-rbac/start.sh:
##########
@@ -0,0 +1,44 @@
+#!/bin/sh

Review Comment:
   Please add Apache License header



##########
test/e2e/testdata/wolf-rbac/stop.sh:
##########
@@ -0,0 +1,2 @@
+cd testdata/wolf-rbac/

Review Comment:
   Please add Apache License header



##########
test/e2e/testdata/wolf-rbac/db-psql.sql:
##########
@@ -0,0 +1,223 @@
+
+-- you can change the password on initial the database.
+/**
+CREATE USER wolfroot WITH PASSWORD '123456';
+CREATE DATABASE wolf with owner=wolfroot ENCODING='UTF8';
+GRANT ALL PRIVILEGES ON DATABASE wolf to wolfroot;
+*/
+
+\c wolf;

Review Comment:
   As an extra, was this file written by you, or copied the content of other projects? I just want to confirm the correctness of the license



##########
test/e2e/scaffold/wolf-rbac.go:
##########
@@ -0,0 +1,49 @@
+// 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 scaffold
+
+import (
+	"fmt"
+	"os/exec"
+)
+
+func (s *Scaffold) WolfRbacSvrStarting() {
+	cmd := exec.Command("sh", "testdata/wolf-rbac/start.sh")
+	_ = cmd.Run()

Review Comment:
   Should we check if it ran successfully?



##########
pkg/kube/translation/apisix_route.go:
##########
@@ -144,6 +144,8 @@ func (t *translator) translateHTTPRouteV2beta2(ctx *TranslateContext, ar *config
 				pluginMap["key-auth"] = part.Authentication.KeyAuth
 			case "basicAuth":
 				pluginMap["basic-auth"] = make(map[string]interface{})
+			case "wolfRbac":
+				pluginMap["wolf-rbac"] = make(map[string]interface{})

Review Comment:
   `v2beta2` has been deprecated, we will not add any new features to it.
   
   Please remove this.



##########
test/e2e/testdata/wolf-rbac/ip.sh:
##########
@@ -0,0 +1 @@
+echo -n `docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' wolf-server`

Review Comment:
   Please add Apache License header



##########
pkg/kube/apisix/apis/config/v2beta3/types.go:
##########
@@ -356,6 +357,19 @@ type ApisixConsumerKeyAuthValue struct {
 	Key string `json:"key" yaml:"key"`
 }
 
+// ApisixConsumerWolfRbac defines the configuration for the rbac auth.

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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] AlinsRan commented on a diff in pull request #1011: feat:add wolf-rbac authorized method.

Posted by GitBox <gi...@apache.org>.
AlinsRan commented on code in PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011#discussion_r871921916


##########
test/e2e/testdata/wolf-rbac/db-psql.sql:
##########
@@ -0,0 +1,223 @@
+
+-- you can change the password on initial the database.
+/**
+CREATE USER wolfroot WITH PASSWORD '123456';
+CREATE DATABASE wolf with owner=wolfroot ENCODING='UTF8';
+GRANT ALL PRIVILEGES ON DATABASE wolf to wolfroot;
+*/
+
+\c wolf;

Review Comment:
   This is the content of `wolf-rbac` projects. It is used to initialize the database. The `wolf-server` cannot work normally without this.



-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] AlinsRan commented on pull request #1011: feat:add wolf-rbac authorized method.

Posted by GitBox <gi...@apache.org>.
AlinsRan commented on PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011#issuecomment-1126932269

   doc: #1018 


-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] tokers commented on a diff in pull request #1011: feat: add wolf-rbac authorization method.

Posted by GitBox <gi...@apache.org>.
tokers commented on code in PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011#discussion_r874591222


##########
samples/deploy/crd/v1/ApisixConsumer.yaml:
##########
@@ -108,6 +109,12 @@ spec:
                         value:
                           type: object
                           properties:
+                            server:

Review Comment:
   Why update here?



##########
test/e2e/scaffold/wolf-rbac.go:
##########
@@ -0,0 +1,49 @@
+// 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 scaffold
+
+import (
+	"fmt"
+	"os/exec"
+)
+
+func (s *Scaffold) WolfRBACSvrStarting() error {
+	cmd := exec.Command("sh", "testdata/wolf-rbac/start.sh")
+	return cmd.Run()
+}
+
+func (s *Scaffold) WolfRBACSvrStartedURL() (string, error) {

Review Comment:
   ```suggestion
   func (s *Scaffold) GetWolfRBACServerURL() (string, error) {
   ```



##########
test/e2e/scaffold/wolf-rbac.go:
##########
@@ -0,0 +1,49 @@
+// 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 scaffold
+
+import (
+	"fmt"
+	"os/exec"
+)
+
+func (s *Scaffold) WolfRBACSvrStarting() error {

Review Comment:
   ```suggestion
   func (s *Scaffold) StartWolfRBACServer() error {
   ```



##########
test/e2e/scaffold/wolf-rbac.go:
##########
@@ -0,0 +1,49 @@
+// 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 scaffold
+
+import (
+	"fmt"
+	"os/exec"
+)
+
+func (s *Scaffold) WolfRBACSvrStarting() error {
+	cmd := exec.Command("sh", "testdata/wolf-rbac/start.sh")
+	return cmd.Run()
+}
+
+func (s *Scaffold) WolfRBACSvrStartedURL() (string, error) {
+	_ = s.WolfRBACSvrStarting()
+
+	cmd := exec.Command("sh", "testdata/wolf-rbac/ip.sh")
+	ip, err := cmd.Output()
+	if err != nil {
+		return "", err
+	}
+	if len(ip) == 0 {
+		return "", fmt.Errorf("wolf-server start failed")
+	}
+	httpsvc := fmt.Sprintf("http://%s:12180", string(ip))
+	return httpsvc, nil
+}
+
+func (s *Scaffold) StopWolfRBACSvr() error {

Review Comment:
   ```suggestion
   func (s *Scaffold) StopWolfRBACServer() error {
   ```



##########
test/e2e/testdata/wolf-rbac/start.sh:
##########
@@ -0,0 +1,61 @@
+#!/bin/sh

Review Comment:
   Can we run the wolf rbac server on kubernetes?



-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] tokers commented on a diff in pull request #1011: feat: add wolf-rbac authorization method.

Posted by GitBox <gi...@apache.org>.
tokers commented on code in PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011#discussion_r875673567


##########
test/e2e/testdata/wolf-rbac/start.sh:
##########
@@ -0,0 +1,61 @@
+#!/bin/sh

Review Comment:
   OK, just an advice.



-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix-ingress-controller] tao12345666333 commented on a diff in pull request #1011: feat:add wolf-rbac authorized method.

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on code in PR #1011:
URL: https://github.com/apache/apisix-ingress-controller/pull/1011#discussion_r872115225


##########
test/e2e/testdata/wolf-rbac/start.sh:
##########
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+#
+# 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.
+#
+
+cd testdata/wolf-rbac/
+
+wget https://raw.githubusercontent.com/iGeeky/wolf/master/server/script/db-psql.sql

Review Comment:
   You should point to a specific version of the file, using this link, the content may change
   



##########
test/e2e/testdata/wolf-rbac/start.sh:
##########
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+#
+# 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.
+#
+
+cd testdata/wolf-rbac/
+
+wget https://raw.githubusercontent.com/iGeeky/wolf/master/server/script/db-psql.sql

Review Comment:
   e.g. https://raw.githubusercontent.com/iGeeky/wolf/f6ddeb75a37bff90406f0f0a2b7ae5d16f6f3bd4/server/script/db-psql.sql



-- 
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: notifications-unsubscribe@apisix.apache.org

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