コード例 #1
0
 def __init__(self, config, auth_map, cache):
     CompositeAuthorizer.__init__(self)
     self.cache = cache
     self.config = config
     self.auth_map = auth_map
     self.auth_cons_strategy = self.create_auth_strategy()
     self.register_default_authorizers()
コード例 #2
0
 def __init__(self, config, auth_map, cache, anyone_can_write_map=None):
     CompositeAuthorizer.__init__(self)
     self.cache = cache
     self.config = config
     self.auth_map = auth_map
     self.anyone_can_write = self.config.ANYONE_CAN_WRITE
     self.anyone_can_write_map = anyone_can_write_map
     self.auth_cons_strategy = self.create_auth_strategy()
     self.register_default_authorizers()
コード例 #3
0
def composite_authorizer(idr_cache):
    authorizer = CompositeAuthorizer()
    authorizer.register_authorizer(RolesAuthorizer(idr_cache))
    authorizer.register_authorizer(AndAuthorizer(),
                                   ConstraintsEnum.AND_CONSTRAINT_ID)
    authorizer.register_authorizer(OrAuthorizer(),
                                   ConstraintsEnum.OR_CONSTRAINT_ID)
    return authorizer
コード例 #4
0
    def __init__(self,
                 config,
                 auth_map: dict,
                 cache: IdrCache,
                 config_state: PruningState,
                 state_serializer: AbstractConstraintSerializer,
                 metrics: MetricsCollector = None):
        CompositeAuthorizer.__init__(self)
        self.config = config
        self.auth_map = auth_map
        self.cache = cache
        self.config_state = config_state
        self.state_serializer = state_serializer
        self.metrics = metrics

        self.auth_cons_strategy = self.create_auth_strategy()
        self.register_default_authorizers()
コード例 #5
0
    def __init__(self,
                 config,
                 auth_map: dict,
                 cache: IdrCache,
                 config_state: PruningState,
                 state_serializer: AbstractConstraintSerializer,
                 anyone_can_write_map=None):
        CompositeAuthorizer.__init__(self)
        self.config = config
        self.auth_map = auth_map
        self.cache = cache
        self.config_state = config_state
        self.state_serializer = state_serializer
        self.anyone_can_write_map = anyone_can_write_map

        self.anyone_can_write = self.config.ANYONE_CAN_WRITE
        self.auth_cons_strategy = self.create_auth_strategy()
        self.register_default_authorizers()