API7 Docs

Consumer Restriction Configuration

Parameters

See plugin common configurations for configuration options available to all plugins.

  • typestring · optional · default: consumer_name

    Valid values: consumer_name, consumer_group_id, service_id, or route_id

    Key type to restrict by.

  • whitelistarray[string] · optional

    List of objects to whitelist.

    At least one of whitelist, blacklist, and allowed_by_methods should be configured. If all are configured, the precedence is blacklist > whitelist > allowed_by_methods.

  • blacklistarray[string] · optional

    List of objects to blacklist.

    At least one of whitelist, blacklist, and allowed_by_methods should be configured. If all are configured, the precedence is blacklist > whitelist > allowed_by_methods.

  • allowed_by_methodsarray[object] · optional

    List of key-value pairs of consumer name and their corresponding HTTP methods allowed.

    At least one of whitelist, blacklist, and allowed_by_methods should be configured. If all are configured, the precedence is blacklist > whitelist > allowed_by_methods.

    • userstring · optional

      Consumer username.

    • methodsarray[string] · optional

      Valid values: Any combination of the GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, CONNECT, TRACE, PURGE methods

      List of allowed HTTP methods for the consumer.

  • rejected_codeinteger · optional · default: 403

    Valid values: greater than or equal to 200

    HTTP status code to return when the request is rejected.

  • rejected_msgstring · optional

    Error message to return when the request is rejected.