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/16 09:44:16 UTC

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

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