crossbar.router.role¶
Classes¶
Base class for router roles. |
|
A role on a router realm that is authorized by calling (via WAMP RPC) |
|
A role on a router realm that is authorized from a node LMDB embedded database. |
|
A role on a router realm that is authorized using a static configuration. |
|
A router role that is trusted to do anything. This is used e.g. for the |
Module Contents¶
- class RouterRole(router, uri, allow_by_default=False)[source]¶
Bases:
objectBase class for router roles.
- authorize(session, uri, action, options)[source]¶
Authorize a session connected under this role to perform the given action on the given URI.
- Parameters:
session (Instance of
autobahn.wamp.protocol.ApplicationSession) – The WAMP session that requests the action.uri (str) – The URI on which to perform the action.
action (str) – The action to be performed.
- Returns:
bool – Flag indicating whether session is authorized or not.
- class RouterRoleDynamicAuth(router, uri, authorizer)[source]¶
Bases:
RouterRoleA role on a router realm that is authorized by calling (via WAMP RPC) an authorizer function provided by the app.
- authorize(session, uri, action, options)[source]¶
Authorize a session connected under this role to perform the given action on the given URI.
- Parameters:
session (Instance of
autobahn.wamp.protocol.ApplicationSession) – The WAMP session that requests the action.uri (str) – The URI on which to perform the action.
action (str) – The action to be performed.
options
- Returns:
bool – Flag indicating whether session is authorized or not.
- class RouterRoleLMDBAuth(router, uri, store)[source]¶
Bases:
RouterRoleA role on a router realm that is authorized from a node LMDB embedded database.
- authorize(session, uri, action, options)[source]¶
Authorize a session connected under this role to perform the given action on the given URI.
- Parameters:
session (Instance of
autobahn.wamp.protocol.ApplicationSession) – The WAMP session that requests the action.uri (unicode) – The URI on which to perform the action.
action (unicode) – The action to be performed.
- Returns:
The authorization
- Return type:
- class RouterRoleStaticAuth(router, uri, permissions=None, default_permissions=None)[source]¶
Bases:
RouterRoleA role on a router realm that is authorized using a static configuration.
- authorize(session, uri, action, options)[source]¶
Authorize a session connected under this role to perform the given action on the given URI.
- Parameters:
session (Instance of
autobahn.wamp.protocol.ApplicationSession) – The WAMP session that requests the action.uri (str) – The URI on which to perform the action.
action (str) – The action to be performed.
- Returns:
bool – Flag indicating whether session is authorized or not.
- class RouterTrustedRole(router, uri, allow_by_default=False)[source]¶
Bases:
RouterRoleA router role that is trusted to do anything. This is used e.g. for the service session run internally run by a router.
- authorize(session, uri, action, options)[source]¶
Authorize a session connected under this role to perform the given action on the given URI.
- Parameters:
session (Instance of
autobahn.wamp.protocol.ApplicationSession) – The WAMP session that requests the action.uri (str) – The URI on which to perform the action.
action (str) – The action to be performed.
- Returns:
bool – Flag indicating whether session is authorized or not.