def token_list(self, config):
     ss_api_conf_tuple = list(
         zip(
             config["security_server"],
             map(lambda ss: self.create_api_config(ss, config),
                 config["security_server"])))
     for security_server in config["security_server"]:
         ss_api_config = self.create_api_config(security_server, config)
         self.remote_token_list(ss_api_config)
     BaseController.log_keyless_servers(ss_api_conf_tuple)
示例#2
0
    def update_client(self, config):
        ss_api_conf_tuple = list(zip(config["security_server"], map(lambda ss: self.create_api_config(ss, config), config["security_server"])))

        for security_server in config["security_server"]:
            ss_api_config = self.create_api_config(security_server, config)
            BaseController.log_debug('Starting client registrations for security server: ' + security_server['name'])
            if "clients" in security_server:
                for client in security_server["clients"]:
                    self.remote_update_client(ss_api_config, security_server, client)

        BaseController.log_keyless_servers(ss_api_conf_tuple)
示例#3
0
    def add_client(self, config):
        ss_api_conf_tuple = list(zip(config["security_server"], map(lambda ss: self.create_api_config(ss, config), config["security_server"])))

        for security_server in config["security_server"]:
            ss_api_config = self.create_api_config(security_server, config)
            BaseController.log_debug('Starting client add process for security server: ' + security_server['name'])
            if "clients" in security_server:  # Guards both against empty section (->None) & complete lack of section
                for client in security_server["clients"]:
                    self.remote_add_client(ss_api_config, client)

        BaseController.log_keyless_servers(ss_api_conf_tuple)
示例#4
0
    def enable_service_description(self, config):
        ss_api_conf_tuple = list(zip(config["security_server"], map(lambda ss: self.create_api_config(ss, config), config["security_server"])))

        for security_server in config["security_server"]:
            ss_api_config = self.create_api_config(security_server, config)
            BaseController.log_debug('Starting service description enabling process for security server: ' + security_server['name'])
            if "clients" in security_server:
                for client in security_server["clients"]:
                    if client.get("service_descriptions"):
                        for service_description in client["service_descriptions"]:
                            self.remote_enable_service_description(ss_api_config, security_server, client, service_description)

        BaseController.log_keyless_servers(ss_api_conf_tuple)
    def add_endpoint_access(self, config):
        ss_api_conf_tuple = list(
            zip(
                config["security_server"],
                map(lambda ss: self.create_api_config(ss, config),
                    config["security_server"])))
        for service_description_dic in self.get_services_description(config):
            self.remote_add_endpoints_access(
                service_description_dic["ss_api_config"],
                service_description_dic["security_server"],
                service_description_dic["client"],
                service_description_dic["service_description"])

        BaseController.log_keyless_servers(ss_api_conf_tuple)
    def token_login(self, config):
        ss_api_conf_tuple = list(
            zip(
                config["security_server"],
                map(lambda ss: self.create_api_config(ss, config),
                    config["security_server"])))

        for security_server in config["security_server"]:
            ss_api_config = self.create_api_config(security_server, config)
            BaseController.log_debug(
                'Starting token login process for security server: ' +
                security_server['name'])
            self.remote_token_login(ss_api_config, security_server)

        BaseController.log_keyless_servers(ss_api_conf_tuple)
    def activate_certificate(self, config):
        ss_api_conf_tuple = list(
            zip(
                config["security_server"],
                map(lambda ss: self.create_api_config(ss, config),
                    config["security_server"])))

        for security_server in config["security_server"]:
            ss_api_config = self.create_api_config(security_server, config)
            BaseController.log_debug(
                'Starting certificate activation for security server: ' +
                security_server['name'])
            self.remote_activate_certificate(ss_api_config, security_server)

        BaseController.log_keyless_servers(ss_api_conf_tuple)
    def initialize_server(self, config):
        ss_api_conf_tuple = list(zip(config["security_server"], map(lambda ss: self.create_api_config(ss, config), config["security_server"])))

        for security_server in config["security_server"]:
            ss_api_config = self.create_api_config(security_server, config)
            self.log_debug('Starting initialization process for security server: ' + security_server['name'])
            configuration_check = self.check_init_status(ss_api_config)
            if configuration_check.is_anchor_imported:
                self.log_info('Configuration anchor for \"' + security_server['name'] + '\" already imported')
            else:
                self.upload_anchor(ss_api_config, security_server)
            if configuration_check.is_server_code_initialized:
                self.log_info('Security server \"' + security_server['name'] + '\" already initialized')
            else:
                self.init_security_server(ss_api_config, security_server)

        BaseController.log_keyless_servers(ss_api_conf_tuple)
    def _download_csrs(self, config):
        downloaded_csrs = []
        ss_api_conf_tuple = list(
            zip(
                config["security_server"],
                map(lambda ss: self.create_api_config(ss, config),
                    config["security_server"])))

        for security_server in config["security_server"]:
            ss_api_config = self.create_api_config(security_server, config)
            BaseController.log_info(
                'Starting CSR download from security server: ' +
                security_server['name'])
            downloaded_csrs.extend(
                self.remote_download_csrs(ss_api_config, security_server))

        BaseController.log_keyless_servers(ss_api_conf_tuple)

        return downloaded_csrs
    def token_add_keys_with_csrs(self, config):
        ss_api_conf_tuple = list(
            zip(
                config["security_server"],
                map(lambda ss: self.create_api_config(ss, config),
                    config["security_server"])))

        for security_server in config["security_server"]:
            ss_api_config = self.create_api_config(security_server, config)
            BaseController.log_debug(
                'Starting token key creation process for security server: ' +
                security_server['name'])
            self.remote_token_add_keys_with_csrs(ss_api_config,
                                                 security_server)
            if "clients" in security_server:
                for client in security_server["clients"]:
                    if client["member_class"] != security_server[
                            "owner_member_class"] or client[
                                "member_code"] != security_server[
                                    "owner_member_code"]:
                        self.remote_token_add_signing_key_new_member(
                            ss_api_config, security_server, client)
        BaseController.log_keyless_servers(ss_api_conf_tuple)