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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]