crossbar.router.role

Classes

RouterRole

Base class for router roles.

RouterRoleDynamicAuth

A role on a router realm that is authorized by calling (via WAMP RPC)

RouterRoleLMDBAuth

A role on a router realm that is authorized from a node LMDB embedded database.

RouterRoleStaticAuth

A role on a router realm that is authorized using a static configuration.

RouterTrustedRole

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: object

Base class for router roles.

allow_by_default = False[source]
authorize(session, uri, action, options)[source]

Authorize a session connected under this role to perform the given action on the given URI.

Parameters:
Returns:

bool – Flag indicating whether session is authorized or not.

log[source]
router[source]
uri[source]
class RouterRoleDynamicAuth(router, uri, authorizer)[source]

Bases: RouterRole

A role on a router realm that is authorized by calling (via WAMP RPC) an authorizer function provided by the app.

_authorizer[source]
_session[source]
_uri[source]
authorize(session, uri, action, options)[source]

Authorize a session connected under this role to perform the given action on the given URI.

Parameters:
Returns:

bool – Flag indicating whether session is authorized or not.

class RouterRoleLMDBAuth(router, uri, store)[source]

Bases: RouterRole

A role on a router realm that is authorized from a node LMDB embedded database.

_store[source]
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:

dict

class RouterRoleStaticAuth(router, uri, permissions=None, default_permissions=None)[source]

Bases: RouterRole

A role on a router realm that is authorized using a static configuration.

_permissions[source]
_wild_permissions[source]
authorize(session, uri, action, options)[source]

Authorize a session connected under this role to perform the given action on the given URI.

Parameters:
Returns:

bool – Flag indicating whether session is authorized or not.

class RouterTrustedRole(router, uri, allow_by_default=False)[source]

Bases: RouterRole

A 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:
Returns:

bool – Flag indicating whether session is authorized or not.