push_authorized_channels_only

The `push_authorized_channels_only` directive restricts subscribers to only receive messages from channels they are authorized to access.

Syntaxpush_authorized_channels_only on | off;
Defaultoff
Contexthttp, server, location
Arguments1

Description

The push_authorized_channels_only directive is a security feature within the NGINX Nchan module that limits access for subscribers based on their authorization status. When enabled, only channels that a subscriber has been explicitly authorized for will deliver messages. This is especially useful in scenarios where user-specific data is published to different channels, and you want to ensure that subscribers cannot listen to channels they do not have permission to access.

When configuring this directive, you can specify a boolean value: 'on' or 'off'. Setting the directive to 'on' will enforce the policy restrictions, while 'off' will revert to the default state where subscribers can access any channel. This directive can be utilized in different contexts such as http, server, and location, allowing developers flexibility in how they manage channel access throughout their NGINX configuration. It plays an integral role in enhancing the security of message delivery in pub/sub architectures by ensuring that sensitive information is not exposed to unauthorized subscribers.

Config Example

location /pubsub {
    push_authorized_channels_only on;
    nchan_pubsub;
}

Ensure you implement an appropriate authentication mechanism to manage user authorizations; otherwise, this directive will have no effect.

Using this directive without a proper authorization scheme may lead to confusing behavior for users expecting access to certain channels.

Carefully test configuration changes regarding this directive to ensure expected message flow and access control.

← Back to all directives