a6-plugin-consumer-restriction

Configure APISIX consumer-restriction plugin via a6 CLI for access control.

1|2|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/api7/a6 --skill a6-plugin-consumer-restriction-api7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: a6-plugin-consumer-restriction
Source: https://github.com/api7/a6/tree/main/skills/a6-plugin-consumer-restriction
Command: npx skills add https://github.com/api7/a6 --skill a6-plugin-consumer-restriction-api7

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables configuring the Apache APISIX consumer-restriction plugin via the a6 CLI to enforce access controls based on consumer identity. It supports restricting access by consumer name, consumer group, service, or route using whitelist/blacklist modes and per-consumer HTTP method restrictions.

Core Features & Use Cases

  • Restrict routes or services by consumer identity (name or group) and by specific route/service.
  • Support restriction types: consumer_name, consumer_group_id, service_id, and route_id with blacklist, whitelist, and allowed_by_methods.
  • Combine with a6 commands such as route create, route update, consumer create, consumer update, and config sync to implement end-to-end access control.

Quick Start

Create a test route with a consumer-restriction plugin and a whitelist that includes a sample consumer.

Frequently Asked Questions about a6-plugin-consumer-restriction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure APISIX consumer-restriction to enforce access control?

Configure APISIX consumer-restriction by using the a6 CLI to apply whitelist or blacklist rules to routes and services. This enforces access control based on authenticated consumer identity, including consumer name, group, or specific route.

What is the difference between whitelist and blacklist modes in APISIX consumer restriction?

Whitelist mode permits access only to specified consumers, while blacklist mode explicitly denies access to listed consumers. Both modes can restrict traffic by consumer name, consumer group, service, or route.

Can I restrict specific HTTP methods per consumer in APISIX?

Yes, configure allowed_by_methods in the consumer-restriction plugin to restrict specific HTTP methods per consumer. This allows granular access control by limiting which HTTP verbs a consumer can use on a route.

How do I apply consumer restriction rules to a specific route using a6?

Use a6 commands route create or route update to attach the consumer-restriction plugin to your target route. Then execute config sync to deploy the access control rules to your APISIX instance.

Does the APISIX consumer-restriction plugin require creating consumers first?

Yes, you must create authenticated consumers using a6 consumer create or consumer update before applying restrictions. The plugin enforces access control by validating requests against these configured consumer identities.

What types of consumer identities can I target with APISIX access control?

APISIX access control targets four restriction types: consumer_name, consumer_group_id, service_id, and route_id. This allows you to restrict access by individual consumer, consumer groups, or specific API endpoints.