-
-
Notifications
You must be signed in to change notification settings - Fork 8
Authorizer
An Authorizer is an interface that specifies an Authorize
function.
To define an Authorizer, implement this interface and provide an instance in
the realm config when configuring the router.
The Authorizer function is called for each message that a client tries to send, allowing the router to intercept each message before it is routed to its recipient(s). This allows the router to make per-message decisions by looking at the sending session and the message.
For example, if only sessions with specific authid
values are allowed to publish messages with a special attribute,
the the authorizer can enforce this restriction. The authorizer would look at PUBLISH message attributes to see
if the special attribute is present, and if so then the authorizer would look at the session to check for the
necessary authid
value, and decide whether or not to send the message.
Since the Authorizer accesses both the sending session and the message through a pointer, the authorizer can alter the content of both the sending session and the message. This allows the authorizer to also work as an interceptor of messages that can change their content and/or change the sending session based on the intercepted message.
This functionality may be used to set values in the session upon encountering certain messages sent by that session.
- Home
- Introduction
- Developer Reference Guide
- Operational Information
- System Design
- Additional Information