AlinsRan commented on code in PR #2761:
URL:
https://github.com/apache/apisix-ingress-controller/pull/2761#discussion_r3231160890
##########
internal/adc/translator/apisixconsumer.go:
##########
@@ -55,42 +55,54 @@ const (
func (t *Translator) TranslateApisixConsumer(tctx *provider.TranslateContext,
ac *v2.ApisixConsumer) (*TranslateResult, error) {
result := &TranslateResult{}
plugins := make(adctypes.Plugins)
- if ac.Spec.AuthParameter.KeyAuth != nil {
- cfg, err := t.translateConsumerKeyAuthPlugin(tctx,
ac.Namespace, ac.Spec.AuthParameter.KeyAuth)
- if err != nil {
- return nil, fmt.Errorf("invalid key auth config: %s",
err)
+ if ap := ac.Spec.AuthParameter; ap != nil {
+ if ap.KeyAuth != nil {
+ cfg, err := t.translateConsumerKeyAuthPlugin(tctx,
ac.Namespace, ap.KeyAuth)
+ if err != nil {
+ return nil, fmt.Errorf("invalid key auth
config: %s", err)
+ }
+ plugins["key-auth"] = cfg
+ } else if ap.BasicAuth != nil {
Review Comment:
The purpose of this PR is to support plugins.
`multi-auth` can still be configured through plugins.
--
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]