Authorization¶
The Northbound security API defines an AuthorizationEngine interface that can be implemented by Authorization providers. The authorization engine will be called for each session creation, giving a user description including the user name and the known groups the user belongs to. An authorization engine can provide two kinds of authorizers:
the PreAuthorizer, which will always be called outside of the gateway thread. Its purpose it to avoid running a task in the gateway thread while it is already known the user can’t access the associated resources. It is also called after a task returned, to filter out resources the user shouldn’t be able to see. The PreAuthorizer can indicate that an operation is allowed, denied or in an unknown state. The latter is useful when no explicit rule match the operation. In that case, the task will be given to the gateway thread.
the Authorizer, which is called in the gateway thread. Its implementation should be fast, in order to avoid slowing down the platform. Unlike the PreAuthorizer, the Authorizer must indicate if the operation is allowed or denied, even if no rule matches the operation. The choice of allowing or denying such operation is implementation specific.
It is possible to use the same object to implement both the PreAuthorizer and Authorizer.