def put_secret(name, secret_type, fields): response = get_session().put( base_secrets_url + "/" + name, json={ "name": name, "type": secret_type, "fields": parse_key_values(fields) }, ) if response.status_code != 200: raise get_exception(response) else: return response.json()
def create_secret(name, secret_type, fields): token = get_stored_token() response = requests.post(base_secrets_url, headers={'Authorization': 'JWT ' + token}, json={ "name": name, "type": secret_type, "fields": parse_key_values(fields) }, ) if response.status_code != 200: raise get_exception(response) else: return response.json()