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 2021/04/07 10:23:40 UTC

[GitHub] [apisix] riskgod opened a new issue #4001: request help: {"error_msg":"failed to check the configuration of plugin key-auth err: additional properties forbidden, found key"}

riskgod opened a new issue #4001:
URL: https://github.com/apache/apisix/issues/4001


   ### Issue description
   Hey, I have enable one consumer named jack_auth.
   #### This is the consumer
   ```
   $ curl http://127.0.0.1:9180/apisix/admin/consumers/jack_auth -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
   ```
   ```
   {
      "action":"get",
      "node":{
         "value":{
            "update_time":1617788738,
            "create_time":1617788738,
            "username":"jack_auth",
            "plugins":{
               "key-auth":{
                  "key":"auth-jack",
                  "disable":false
               },
               "limit-req":{
                  "key":"consumer_name",
                  "rejected_code":403,
                  "disable":false,
                  "rate":1,
                  "burst":1
               }
            },
            "id":"jack_auth"
         },
         "key":"\/apisix\/consumers\/jack_auth"
      },
      "count":"1"
   }
   ```
   
   #### Enable in one router
   ```
   $ curl http://127.0.0.1:9180/apisix/admin/routes/112 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   ```
   ```
   {
       "methods": ["GET"],
       "uri": "/testgrpc8",
       "plugins": {
           "grpc-transcode": {
               "proto_id": "1",
               "service": "helloworld.Greeter",
               "method": "SayHello"
           },
           "key-auth": {
               "key": "auth_jack"
           }
       },
       "upstream": {
           "scheme": "grpc",
           "type": "roundrobin",
           "nodes": {
               "taie-address-service.taie.svc.cluster.local:8081": 1
           }
       }
   }'
   
   ```
   
   #### But it failed
   
   ```
   {"error_msg":"failed to check the configuration of plugin key-auth err: additional properties forbidden, found key"}
   ```
   ### Environment
   
   * apisix version (cmd: `apisix version`): 2.5
   * OS (cmd: `uname -a`): k8s
   
   


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

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



[GitHub] [apisix] riskgod commented on issue #4001: request help: {"error_msg":"failed to check the configuration of plugin key-auth err: additional properties forbidden, found key"}

Posted by GitBox <gi...@apache.org>.
riskgod commented on issue #4001:
URL: https://github.com/apache/apisix/issues/4001#issuecomment-814821064


   > > {"message":"Missing related consumer"}
   > 
   > This is probably caused by the fact that the `key-auth` plugin is not configured on the `consumer`. You need to confirm again whether the `consumer` is configured with the `key-auth` plugin.
   
   But, I can get the consumer in my desc


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

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



[GitHub] [apisix] riskgod commented on issue #4001: request help: {"error_msg":"failed to check the configuration of plugin key-auth err: additional properties forbidden, found key"}

Posted by GitBox <gi...@apache.org>.
riskgod commented on issue #4001:
URL: https://github.com/apache/apisix/issues/4001#issuecomment-814864921


   > @riskgod Hi, what's your consumer configuration?
   
   ```
   {
      "action":"get",
      "node":{
         "value":{
            "update_time":1617788738,
            "create_time":1617788738,
            "username":"jack_auth",
            "plugins":{
               "key-auth":{
                  "key":"auth-jack",
                  "disable":false
               },
               "limit-req":{
                  "key":"consumer_name",
                  "rejected_code":403,
                  "disable":false,
                  "rate":1,
                  "burst":1
               }
            },
            "id":"jack_auth"
         },
         "key":"\/apisix\/consumers\/jack_auth"
      },
      "count":"1"
   }
   ```
   


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

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



[GitHub] [apisix] riskgod closed issue #4001: request help: {"error_msg":"failed to check the configuration of plugin key-auth err: additional properties forbidden, found key"}

Posted by GitBox <gi...@apache.org>.
riskgod closed issue #4001:
URL: https://github.com/apache/apisix/issues/4001


   


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

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



[GitHub] [apisix] Firstsawyou commented on issue #4001: request help: {"error_msg":"failed to check the configuration of plugin key-auth err: additional properties forbidden, found key"}

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #4001:
URL: https://github.com/apache/apisix/issues/4001#issuecomment-814817647


   > {"message":"Missing related consumer"}
   
   This is probably caused by the fact that the `key-auth` plugin is not configured on the `consumer`. You need to confirm again whether the `consume`r is configured with the `key-auth` plugin.


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

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



[GitHub] [apisix] tokers commented on issue #4001: request help: {"error_msg":"failed to check the configuration of plugin key-auth err: additional properties forbidden, found key"}

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #4001:
URL: https://github.com/apache/apisix/issues/4001#issuecomment-814851616


   @riskgod Hi, what's your consumer configuration?


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

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



[GitHub] [apisix] Firstsawyou commented on issue #4001: request help: {"error_msg":"failed to check the configuration of plugin key-auth err: additional properties forbidden, found key"}

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #4001:
URL: https://github.com/apache/apisix/issues/4001#issuecomment-814799845


   Enabling the key-auth plugin in the route does not require configuration data, you just need to do as follows:
   
   ```json
   {
       "methods": ["GET"],
       "uri": "/testgrpc8",
       "plugins": {
           "grpc-transcode": {
               "proto_id": "1",
               "service": "helloworld.Greeter",
               "method": "SayHello"
           },
           "key-auth": {         
           }
       },
       "upstream": {
           "scheme": "grpc",
           "type": "roundrobin",
           "nodes": {
               "taie-address-service.taie.svc.cluster.local:8081": 1
           }
       }
   }'
   ```


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

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



[GitHub] [apisix] Firstsawyou edited a comment on issue #4001: request help: {"error_msg":"failed to check the configuration of plugin key-auth err: additional properties forbidden, found key"}

Posted by GitBox <gi...@apache.org>.
Firstsawyou edited a comment on issue #4001:
URL: https://github.com/apache/apisix/issues/4001#issuecomment-814799845


   Enabling the key-auth plugin in the route does not require configuration data, you need to configure it like the following:
   
   ```json
   {
       "methods": ["GET"],
       "uri": "/testgrpc8",
       "plugins": {
           "grpc-transcode": {
               "proto_id": "1",
               "service": "helloworld.Greeter",
               "method": "SayHello"
           },
           "key-auth": {         
           }
       },
       "upstream": {
           "scheme": "grpc",
           "type": "roundrobin",
           "nodes": {
               "taie-address-service.taie.svc.cluster.local:8081": 1
           }
       }
   }'
   ```


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

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



[GitHub] [apisix] riskgod commented on issue #4001: request help: {"error_msg":"failed to check the configuration of plugin key-auth err: additional properties forbidden, found key"}

Posted by GitBox <gi...@apache.org>.
riskgod commented on issue #4001:
URL: https://github.com/apache/apisix/issues/4001#issuecomment-814808322


   ### Hey, the setting is success, but when I call it use the key "auth-jack", it failed, please help me check again, Thank you 
   
   ```
   $ bash-5.0# curl -i http://127.0.0.1:9080/testgrpc8?name=world -H 'apikey: auth-jack' -i
   ```
   
   ```
   HTTP/1.1 401 Unauthorized
   Date: Wed, 07 Apr 2021 10:39:32 GMT
   Content-Type: text/plain; charset=utf-8
   Transfer-Encoding: chunked
   Connection: keep-alive
   Server: APISIX/2.5
   
   {"message":"Missing related consumer"}
   ```


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

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