Skip to content

request help: The plugins that act on the specified consumer do not take effect #6405

Description

@tzssangglass

Issue description

origin mail: https://lists.apache.org/thread/o0zh8pddh50ytcf99g8jr5wnxbf9p9t3

User Description:

And when I use the same config :

\"proxy-rewrite\": {
      \"headers\": {
        \"X-USER-ID\": \"USER1-ID\"
      }
    }

In the route config it works :

curl --location --request PUT
"http://$APISIX_URL:$APISIX_PORT/apisix/admin/routes/api-v1" \
--header "X-API-KEY: $APISIX_API_ADMIN_KEY" \
--header "Content-Type: application/json" \
--data-raw "{
  \"uri\": \"/v1/*\",
  \"host\": \"$APISIX_HOST\",
  \"plugins\": {
    \"key-auth\": {},
    \"consumer-restriction\": {
        \"whitelist\": [
            \"user1\",
            \"user2\"
        ]
    },
    \"proxy-rewrite\": {
      \"headers\": {
        \"X-USER-ID\": \"USER1-ID\"
      }
    }
  },
  \"service_id\": \"api-v1\"
}"

and

I mean that when I configure the plugin proxy-rewrite on the routes I have
the header X-USER-ID set with the value USER1-ID (everything is fine) and
when I configure it on the consumer user1 and I call the endpoint with the
apikey of user1, the header X-USER-ID does not exist.

Environment

  • apisix version (cmd: apisix version):
  • OS (cmd: uname -a):
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V):
  • etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API):
  • apisix-dashboard version, if have:
  • the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
  • luarocks version, if the issue is about installation (cmd: luarocks --version):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions