Disabling Consumer

Can I disable kong consumer?

I do not believe there is a disable. There is a delete though for permanent wipe out. I could see a disable feature being useful though to help quickly revoke a users access to all his Kong resources temporarily :slight_smile: !

May not be exactly what you’re looking for, but the request-termination plugin added to a consumer will prevent any calls to the upstream service as that consumer. It can terminate the request with a 401, which is what would happen with an authentication plugin if the consumer didn’t exist (and the anonymous field is left unset)

curl -X POST http://localhost:8001/plugins \
    -d "name=request-termination" \
    -d "consumer_id=${CONSUMER_ID}"  \
    -d "config.status_code=401" \
    -d "config.message=Unauthorized"

Docs: https://docs.konghq.com/hub/kong-inc/request-termination/

The plugin has a low priority, so it will run after most plugins.

1 Like

You will need ACL plugin to achieve disable consumers. ACL plugin allows to group consumer based on their accesses. You can whitelist groups on some services and blacklist on other.

Thank you for your answers. I marked jeremyjpj0916’s post to answer. Yes, @code2design and @alexashley your solutinons may solve but I expected more fluent solution but I doesn’t see any box in solution.

1 Like