Skip to main content

attach_consumer

Function attach_consumer 

Source
pub fn attach_consumer(ctx: &mut Context, consumer: &Consumer, auth_type: &str)
Expand description

Attaches a matched consumer’s identity to the request.

Writes the context.message keys downstream nodes read — consumer.name, consumer.group (when set), consumer.labels, consumer.custom_id (from labels.custom_id), consumer.auth_type — and sets the upstream request headers X-Consumer-Username and X-Consumer-Custom-ID (APISIX’s upstream contract).