def _register_domain_req_handlers(self): # Read handlers get_nym_handler = GetNymHandler(database_manager=self.node.db_manager) get_attribute_handler = GetAttributeHandler( database_manager=self.node.db_manager) get_schema_handler = GetSchemaHandler( database_manager=self.node.db_manager) get_claim_def_handler = GetClaimDefHandler( database_manager=self.node.db_manager) get_revoc_reg_def_handler = GetRevocRegDefHandler( database_manager=self.node.db_manager) get_revoc_reg_handler = GetRevocRegHandler( database_manager=self.node.db_manager) get_revoc_reg_delta_handler = GetRevocRegDeltaHandler( database_manager=self.node.db_manager, get_revocation_strategy=RevocRegDefHandler.get_revocation_strategy) # Write handlers nym_handler = NymHandler( config=self.node.config, database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) attrib_handler = AttributeHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) schema_handler = SchemaHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) claim_def_handler = ClaimDefHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) revoc_reg_def_handler = RevocRegDefHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) revoc_reg_entry_handler = RevocRegEntryHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator, get_revocation_strategy=RevocRegDefHandler.get_revocation_strategy) # Register write handlers self.node.write_manager.register_req_handler(nym_handler) self.node.write_manager.register_req_handler(attrib_handler) self.node.write_manager.register_req_handler(schema_handler) self.node.write_manager.register_req_handler(claim_def_handler) self.node.write_manager.register_req_handler(revoc_reg_def_handler) self.node.write_manager.register_req_handler(revoc_reg_entry_handler) # Additional handler for idCache self.register_idr_cache_nym_handler() # Register read handlers self.node.read_manager.register_req_handler(get_nym_handler) self.node.read_manager.register_req_handler(get_attribute_handler) self.node.read_manager.register_req_handler(get_schema_handler) self.node.read_manager.register_req_handler(get_claim_def_handler) self.node.read_manager.register_req_handler(get_revoc_reg_def_handler) self.node.read_manager.register_req_handler(get_revoc_reg_handler) self.node.read_manager.register_req_handler( get_revoc_reg_delta_handler)
def claim_def_handler(db_manager, write_auth_req_validator): return ClaimDefHandler(db_manager, write_auth_req_validator)
def _register_domain_req_handlers(self): # Read handlers get_nym_handler = GetNymHandler(database_manager=self.node.db_manager) get_attribute_handler = GetAttributeHandler( database_manager=self.node.db_manager) get_schema_handler = GetSchemaHandler( database_manager=self.node.db_manager) get_claim_def_handler = GetClaimDefHandler( database_manager=self.node.db_manager) get_revoc_reg_def_handler = GetRevocRegDefHandler( database_manager=self.node.db_manager) get_revoc_reg_handler = GetRevocRegHandler( database_manager=self.node.db_manager) get_revoc_reg_delta_handler = GetRevocRegDeltaHandler( database_manager=self.node.db_manager, get_revocation_strategy=RevocRegDefHandler.get_revocation_strategy) # Write handlers nym_handler = NymHandler( config=self.node.config, database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) attrib_handler = AttributeHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) schema_handler = SchemaHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) claim_def_handler = ClaimDefHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) revoc_reg_def_handler = RevocRegDefHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) revoc_reg_entry_handler = RevocRegEntryHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator, get_revocation_strategy=RevocRegDefHandler.get_revocation_strategy) json_ld_context_handler = JsonLdContextHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) rich_schema_handler = RichSchemaHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) rich_schema_encoding_handler = RichSchemaEncodingHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) rich_schema_mapping_handler = RichSchemaMappingHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) rich_schema_cred_def_handler = RichSchemaCredDefHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) rich_schema_pres_def_handler = RichSchemaPresDefHandler( database_manager=self.node.db_manager, write_req_validator=self.node.write_req_validator) get_rich_schema_obj_by_id_handler = GetRichSchemaObjectByIdHandler( database_manager=self.node.db_manager) get_rich_schema_obj_by_metadata_handler = GetRichSchemaObjectByMetadataHandler( database_manager=self.node.db_manager) # Register write handlers self.node.write_manager.register_req_handler(nym_handler) self.node.write_manager.register_req_handler(attrib_handler) self.node.write_manager.register_req_handler(schema_handler) self.node.write_manager.register_req_handler(claim_def_handler) self.node.write_manager.register_req_handler(revoc_reg_def_handler) self.node.write_manager.register_req_handler(revoc_reg_entry_handler) self.node.write_manager.register_req_handler(json_ld_context_handler) self.node.write_manager.register_req_handler(rich_schema_handler) self.node.write_manager.register_req_handler( rich_schema_encoding_handler) self.node.write_manager.register_req_handler( rich_schema_mapping_handler) self.node.write_manager.register_req_handler( rich_schema_cred_def_handler) self.node.write_manager.register_req_handler( rich_schema_pres_def_handler) # Additional handler for idCache self.register_idr_cache_nym_handler() # Register read handlers self.node.read_manager.register_req_handler(get_nym_handler) self.node.read_manager.register_req_handler(get_attribute_handler) self.node.read_manager.register_req_handler(get_schema_handler) self.node.read_manager.register_req_handler(get_claim_def_handler) self.node.read_manager.register_req_handler(get_revoc_reg_def_handler) self.node.read_manager.register_req_handler(get_revoc_reg_handler) self.node.read_manager.register_req_handler( get_revoc_reg_delta_handler) self.node.read_manager.register_req_handler( get_rich_schema_obj_by_id_handler) self.node.read_manager.register_req_handler( get_rich_schema_obj_by_metadata_handler)
def claim_def_handler(db_manager): f = FakeSomething() f.validate = lambda request, action_list: True return ClaimDefHandler(db_manager, f)