From fe9a8ed26f3582adb11e752f2c898e33f1806c14 Mon Sep 17 00:00:00 2001 From: 5HT Date: Mon, 5 Feb 2024 21:51:04 +0200 Subject: [PATCH] fix keys --- all.sh | 4 ++-- lib/up_rest.ex | 2 +- priv/account.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/all.sh b/all.sh index 521a88f..75b55c6 100755 --- a/all.sh +++ b/all.sh @@ -1,7 +1,7 @@ # copy id key from from result of account.sh -export id=01707161812754226949 -export key=01707161812754213150 +export id=01707162568915302633 +export key=01707162568915283933 curl -H "Auth: $key" -X PUT "http://localhost:5010/subscription/$id" -d @priv/subscription.json curl -H "Auth: $key" -X GET "http://localhost:5010/subscription" diff --git a/lib/up_rest.ex b/lib/up_rest.ex index ebe6886..7b70865 100644 --- a/lib/up_rest.ex +++ b/lib/up_rest.ex @@ -44,7 +44,7 @@ defmodule UP.HTTP do requested_id = UP.account(account, :id) key = :nitro.to_binary(:kvs.seq([],[])) id = case :kvs.get "/#{type}/", "#{requested_id}" do - {:ok, account} -> :kvs.delete("/keys/", UP.account(account, :key)) ; requested_id + {:ok, account} -> :kvs.delete("/keys", UP.account(account, :key)) ; requested_id {:error, _} -> :nitro.to_binary(:kvs.seq([],[])) end newAccount = account |> UP.account(id: id) |> UP.account(key: key) :kvs.append newAccount, "/account/" diff --git a/priv/account.json b/priv/account.json index c9cfe23..c008077 100644 --- a/priv/account.json +++ b/priv/account.json @@ -1,5 +1,5 @@ { - "id": "maxim-0012", + "id": "01707162568915302633", "name": "Maksym Sokhatskyi", - "key": "maxim-abac-2" + "key": "maxim-abac-3" }