Skip to content

Commit

Permalink
fix keys
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Feb 5, 2024
1 parent 78168f3 commit fe9a8ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions all.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lib/up_rest.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
4 changes: 2 additions & 2 deletions priv/account.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "maxim-0012",
"id": "01707162568915302633",
"name": "Maksym Sokhatskyi",
"key": "maxim-abac-2"
"key": "maxim-abac-3"
}

0 comments on commit fe9a8ed

Please sign in to comment.