klinux commented on issue #12782:
URL: https://github.com/apache/apisix/issues/12782#issuecomment-3588777788

   Hi @Baoyuantop thank you for the reply.
   
   I followed the instructions here 
https://apisix.apache.org/docs/apisix/terminology/secret/, but I got the same 
error following this [this document 
](https://docs.api7.ai/apisix/how-to-guide/security/secrets-management/manage-secrets-in-gcp-secret-manager/)
 that you point.
   
   I'm using the ingress controller to configure my auth-key, here how I 
configured.
   
   Consumer
   ```
   apiVersion: apisix.apache.org/v1alpha1
   kind: Consumer
   metadata:
     name: backoffice-consumer
     namespace: default
   spec:
     gatewayRef:
       name: apisix
       namespace: apisix
     credentials:
       - type: key-auth
         name: backoffice-api-key
         config:
           key: $secret://gcp/1/backoffice-api-key
   ```
   
   Plugin configure
   ```
   apiVersion: apisix.apache.org/v1alpha1
   kind: PluginConfig
   metadata:
     name: api-key-validation
     namespace: default
   spec:
     plugins:
       - name: key-auth
         config:
           key: backoffice-api-key
   ```
   ```
   apiVersion: gateway.networking.k8s.io/v1
   kind: HTTPRoute
   metadata:
     name: backoffice-route
     namespace: default
   spec:
     parentRefs:
       - name: apisix
         namespace: apisix
         sectionName: https
     hostnames:
       - api.**********
     rules:
       - matches:
           - path:
               type: PathPrefix
               value: /svc/backoffice
         filters:
           - type: ExtensionRef
             extensionRef:
               group: apisix.apache.org
               kind: PluginConfig
               name: remove-context
           - type: ExtensionRef
             extensionRef:
               group: apisix.apache.org
               kind: PluginConfig
               name: api-key-validation
         backendRefs:
           - name: backoffice
             port: 80
   ```
   
   _Obs: If I set the **key** of consumer as a string, it works._
   
   
   


-- 
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]

Reply via email to