<s> from __future__ import absolute_import <EOL> import json <EOL> from autobahn import util <EOL> from autobahn . wamp . exception import ProtocolError <EOL> __all__ = ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> class RoleFeatures ( util . EqualityMixin ) : <EOL> """<STR_LIT>""" <EOL> ROLE = None <EOL> def __str__ ( self ) : <EOL> return json . dumps ( self . __dict__ ) <EOL> def __repr__ ( self ) : <EOL> configured_options = { } <EOL> for k , v in self . __dict__ . items ( ) : <EOL> if v is not None : <EOL> configured_options [ k ] = v <EOL> return "<STR_LIT>" . format ( self . ROLE , "<STR_LIT:U+002CU+0020>" . join ( [ k + '<STR_LIT:=>' + str ( v ) <EOL> for k , v in configured_options . items ( ) ] ) ) <EOL> def _check_all_bool ( self ) : <EOL> for k in self . __dict__ : <EOL> if not k . startswith ( '<STR_LIT:_>' ) and k != '<STR_LIT>' : <EOL> if getattr ( self , k ) is not None and type ( getattr ( self , k ) ) != bool : <EOL> raise ProtocolError ( "<STR_LIT>" . format ( getattr ( self , k ) , k , self . ROLE ) ) <EOL> class RoleBrokerFeatures ( RoleFeatures ) : <EOL> """<STR_LIT>""" <EOL> ROLE = u'<STR_LIT>' <EOL> def __init__ ( self , <EOL> publisher_identification = None , <EOL> publication_trustlevels = None , <EOL> pattern_based_subscription = None , <EOL> session_meta_api = None , <EOL> subscription_meta_api = None , <EOL> subscriber_blackwhite_listing = None , <EOL> publisher_exclusion = None , <EOL> subscription_revocation = None , <EOL> event_history = None , <EOL> payload_transparency = None , <EOL> payload_encryption_cryptobox = None , <EOL> ** kwargs ) : <EOL> self . publisher_identification = publisher_identification <EOL> self . publication_trustlevels = publication_trustlevels <EOL> self . pattern_based_subscription = pattern_based_subscription <EOL> self . session_meta_api = session_meta_api <EOL> self . subscription_meta_api = subscription_meta_api <EOL> self . subscriber_blackwhite_listing = subscriber_blackwhite_listing <EOL> self . publisher_exclusion = publisher_exclusion <EOL> self . subscription_revocation = subscription_revocation <EOL> self . event_history = event_history <EOL> self . payload_transparency = payload_transparency <EOL> self . payload_encryption_cryptobox = payload_encryption_cryptobox <EOL> self . _check_all_bool ( ) <EOL> class RoleSubscriberFeatures ( RoleFeatures ) : <EOL> """<STR_LIT>""" <EOL> ROLE = u'<STR_LIT>' <EOL> def __init__ ( self , <EOL> publisher_identification = None , <EOL> publication_trustlevels = None , <EOL> pattern_based_subscription = None , <EOL> subscription_revocation = None , <EOL> event_history = None , <EOL> payload_transparency = None , <EOL> payload_encryption_cryptobox = None , <EOL> ** kwargs ) : <EOL> self . publisher_identification = publisher_identification <EOL> self . publication_trustlevels = publication_trustlevels <EOL> self . pattern_based_subscription = pattern_based_subscription <EOL> self . subscription_revocation = subscription_revocation <EOL> self . event_history = event_history <EOL> self . payload_transparency = payload_transparency <EOL> self . payload_encryption_cryptobox = payload_encryption_cryptobox <EOL> self . _check_all_bool ( ) <EOL> class RolePublisherFeatures ( RoleFeatures ) : <EOL> """<STR_LIT>""" <EOL> ROLE = u'<STR_LIT>' <EOL> def __init__ ( self , <EOL> publisher_identification = None , <EOL> subscriber_blackwhite_listing = None , <EOL> publisher_exclusion = None , <EOL> payload_transparency = None , <EOL> payload_encryption_cryptobox = None , <EOL> ** kwargs ) : <EOL> self . publisher_identification = publisher_identification <EOL> self . subscriber_blackwhite_listing = subscriber_blackwhite_listing <EOL> self . publisher_exclusion = publisher_exclusion <EOL> self . payload_transparency = payload_transparency <EOL> self . payload_encryption_cryptobox = payload_encryption_cryptobox <EOL> self . _check_all_bool ( ) <EOL> class RoleDealerFeatures ( RoleFeatures ) : <EOL> """<STR_LIT>""" <EOL> ROLE = u'<STR_LIT>' <EOL> def __init__ ( self , <EOL> caller_identification = None , <EOL> call_trustlevels = None , <EOL> pattern_based_registration = None , <EOL> session_meta_api = None , <EOL> registration_meta_api = None , <EOL> shared_registration = None , <EOL> call_timeout = None , <EOL> call_canceling = None , <EOL> progressive_call_results = None , <EOL> registration_revocation = None , <EOL> payload_transparency = None , <EOL> payload_encryption_cryptobox = None , <EOL> ** kwargs ) : <EOL> self . caller_identification = caller_identification <EOL> self . call_trustlevels = call_trustlevels <EOL> self . pattern_based_registration = pattern_based_registration <EOL> self . session_meta_api = session_meta_api <EOL> self . registration_meta_api = registration_meta_api <EOL> self . shared_registration = shared_registration <EOL> self . call_timeout = call_timeout <EOL> self . call_canceling = call_canceling <EOL> self . progressive_call_results = progressive_call_results <EOL> self . registration_revocation = registration_revocation <EOL> self . payload_transparency = payload_transparency <EOL> self . payload_encryption_cryptobox = payload_encryption_cryptobox <EOL> self . _check_all_bool ( ) <EOL> class RoleCallerFeatures ( RoleFeatures ) : <EOL> """<STR_LIT>""" <EOL> ROLE = u'<STR_LIT>' <EOL> def __init__ ( self , <EOL> caller_identification = None , <EOL> call_timeout = None , <EOL> call_canceling = None , <EOL> progressive_call_results = None , <EOL> payload_transparency = None , <EOL> payload_encryption_cryptobox = None , <EOL> ** kwargs ) : <EOL> self . caller_identification = caller_identification <EOL> self . call_timeout = call_timeout <EOL> self . call_canceling = call_canceling <EOL> self . progressive_call_results = progressive_call_results <EOL> self . payload_transparency = payload_transparency <EOL> self . payload_encryption_cryptobox = payload_encryption_cryptobox <EOL> self . _check_all_bool ( ) <EOL> class RoleCalleeFeatures ( RoleFeatures ) : <EOL> """<STR_LIT>""" <EOL> ROLE = u'<STR_LIT>' <EOL> def __init__ ( self , <EOL> caller_identification = None , <EOL> call_trustlevels = None , <EOL> pattern_based_registration = None , <EOL> shared_registration = None , <EOL> call_timeout = None , <EOL> call_canceling = None , <EOL> progressive_call_results = None , <EOL> registration_revocation = None , <EOL> payload_transparency = None , <EOL> payload_encryption_cryptobox = None , <EOL> ** kwargs ) : <EOL> self . caller_identification = caller_identification <EOL> self . call_trustlevels = call_trustlevels <EOL> self . pattern_based_registration = pattern_based_registration <EOL> self . shared_registration = shared_registration <EOL> self . call_timeout = call_timeout <EOL> self . call_canceling = call_canceling <EOL> self . progressive_call_results = progressive_call_results <EOL> self . registration_revocation = registration_revocation <EOL> self . payload_transparency = payload_transparency <EOL> self . payload_encryption_cryptobox = payload_encryption_cryptobox <EOL> self . _check_all_bool ( ) <EOL> ROLE_NAME_TO_CLASS = { <EOL> u'<STR_LIT>' : RoleBrokerFeatures , <EOL> u'<STR_LIT>' : RoleSubscriberFeatures , <EOL> u'<STR_LIT>' : RolePublisherFeatures , <EOL> u'<STR_LIT>' : RoleDealerFeatures , <EOL> u'<STR_LIT>' : RoleCallerFeatures , <EOL> u'<STR_LIT>' : RoleCalleeFeatures , <EOL> } <EOL> DEFAULT_CLIENT_ROLES = { <EOL> u'<STR_LIT>' : RoleSubscriberFeatures ( publisher_identification = True , pattern_based_subscription = True , subscription_revocation = True , payload_transparency = True , payload_encryption_cryptobox = True ) , <EOL> u'<STR_LIT>' : RolePublisherFeatures ( publisher_identification = True , subscriber_blackwhite_listing = True , publisher_exclusion = True , payload_transparency = True , payload_encryption_cryptobox = True ) , <EOL> u'<STR_LIT>' : RoleCallerFeatures ( caller_identification = True , progressive_call_results = True , payload_transparency = True , payload_encryption_cryptobox = True ) , <EOL> u'<STR_LIT>' : RoleCalleeFeatures ( caller_identification = True , pattern_based_registration = True , shared_registration = True , progressive_call_results = True , registration_revocation = True , payload_transparency = True , payload_encryption_cryptobox = True ) , <EOL> } </s>
