def update_role_api_call(token, id, level): url = reverse('role-detail', args=(id,)) client = VaultierAPIClient() client.token(token) data = { 'level': level } response = client.put(url, data) return response
def update_lost_key_api_rebuild_call(lost_key_id, auth_hash=None, public_key=None): """ Call to update view with parameter recover_type set to RecoverTypeField.REBUILD :param lost_key_id: int :param auth_hash: str :param public_key: str :return: Response """ client = VaultierAPIClient() url = "{}?hash={}".format(reverse('lost_keys-detail', args=(lost_key_id,)), auth_hash) return client.put(url, data={ 'public_key': public_key, 'recover_type': RecoverTypeField.REBUILD})
def update_lost_key_api_disable_call(lost_key_id, auth_hash=None, public_key=None): """ Call to update view with parameter recover_type set to RecoverTypeField.DISABLE :param lost_key_id: int :param auth_hash: str :param public_key: str :return: Response """ client = VaultierAPIClient() url = reverse('lost_keys-detail', args=(lost_key_id,)) + '?hash=' + auth_hash # todo: RecoverTypeField? # return client.put(url, data={'public_key': public_key, # 'recover_type': RecoverTypeField.DISABLE}) return client.put(url, data={'public_key': public_key, 'recover_type': None})
def update_lost_key_api_disable_call(lost_key_id, auth_hash=None, public_key=None): """ Call to update view with parameter recover_type set to RecoverTypeField.DISABLE :param lost_key_id: int :param auth_hash: str :param public_key: str :return: Response """ client = VaultierAPIClient() url = reverse('lost_keys-detail', args=(lost_key_id, )) + '?hash=' + auth_hash # todo: RecoverTypeField? # return client.put(url, data={'public_key': public_key, # 'recover_type': RecoverTypeField.DISABLE}) return client.put(url, data={ 'public_key': public_key, 'recover_type': None })
def update_workspace_api_call(token, id, **kwargs): url = reverse('workspace-detail', args=(id,)) client = VaultierAPIClient() client.token(token) response = client.put(url, kwargs) return response
def update_vault_api_call(token, id, **kwargs): url = reverse('vault-detail', args=(id, )) client = VaultierAPIClient() client.token(token) response = client.put(url, kwargs) return response
def accept_invitation_api_call(token, id=None, hash=None): url = reverse('invitation-detail', args=(hash, )) client = VaultierAPIClient() client.token(token) response = client.put(url) return response
def accept_invitation_api_call(token, id=None, hash=None): url = reverse('invitation-detail', args=(hash,)) client = VaultierAPIClient() client.token(token) response = client.put(url) return response
def set_workspace_key_api_call(token, member, key): url = reverse('workspace_key-detail', args=(member,)) client = VaultierAPIClient() client.token(token) response = client.put(url, {'workspace_key': key}) return response