def account(self): log.debug('CoreListener.account() <<<<') account_dict = self.ui_config.get('account') or {} if account_dict: if 'clientID' in account_dict: account_dict['clientID'] = rc4.decrypt(account_dict['clientID'], RC4_KEY) if 'authKey' in account_dict: account_dict['authKey'] = rc4.decrypt(account_dict['authKey'], RC4_KEY) return Account(**account_dict)
def account(self): log.debug('CoreListener.account() <<<<') account_dict = self.ui_config.get('account') or {} if account_dict: if 'clientID' in account_dict: account_dict['clientID'] = rc4.decrypt( account_dict['clientID'], RC4_KEY) if 'authKey' in account_dict: account_dict['authKey'] = rc4.decrypt(account_dict['authKey'], RC4_KEY) return Account(**account_dict)
def unlink(core_client, ui_config): account_dict = ui_config.get('account') if account_dict: if 'clientID' in account_dict: account_dict['clientID'] = rc4.decrypt(account_dict['clientID'], RC4_KEY) if 'authKey' in account_dict: account_dict['authKey'] = rc4.decrypt(account_dict['authKey'], RC4_KEY) account = Account(**account_dict) ui_config.unset('account') ui_config.unset('cloud_home') core_client.unlink(account) return True return False
def unlink(core_client, ui_config): account_dict = ui_config.get("account") if account_dict: if "clientID" in account_dict: account_dict["clientID"] = rc4.decrypt(account_dict["clientID"], RC4_KEY) if "authKey" in account_dict: account_dict["authKey"] = rc4.decrypt(account_dict["authKey"], RC4_KEY) account = Account(**account_dict) ui_config.unset("account") ui_config.unset("cloud_home") core_client.unlink(account) return True return False