Docs

Consumer Restriction Configuration

Configuration reference for the Consumer Restriction plugin (`consumer-restriction`): the parameters, each attribute with its type, whether it is required, its default and its accepted values.

Parameters

See plugin common configurations (opens in Apache APISIX docs) for configuration options available to all plugins.

type — string · optional · default: consumer_name · since APISIX 2.0 · API7 Gateway 3.8.9

Valid values: consumer_name, consumer_group_id, service_id, or route_id

Key type to restrict by.

whitelist — array[string] · optional · since APISIX 1.4 · API7 Gateway 3.8.9

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.

blacklist — array[string] · optional · since APISIX 1.4 · API7 Gateway 3.8.9

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_methods — array[object] · optional · since APISIX 2.5 · API7 Gateway 3.8.9

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.

user — string · optional · since APISIX 2.5 · API7 Gateway 3.8.9

Consumer username.

methods — array[string] · optional · since APISIX 2.5 · API7 Gateway 3.8.9

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_code — integer · optional · default: 403 · since APISIX 2.0 · API7 Gateway 3.8.9

Valid values: greater than or equal to 200

HTTP status code to return when the request is rejected.

rejected_msg — string · optional · since APISIX 2.12.0 · API7 Gateway 3.8.9

Error message to return when the request is rejected.