Skip to content

Commit

Permalink
tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
invaliduser committed Feb 27, 2025
1 parent ea58407 commit b8895c3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
26 changes: 14 additions & 12 deletions src/test/lrsql/admin/protocol_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,14 @@
(is (re-matches Base64RegEx secret-key))
(is (= {:api-key api-key
:secret-key secret-key
:scopes #{"all" "all/read"}}
key-pair))
:scopes #{"all" "all/read"}}))
(testing "and credential retrieval"
(is (= [{:api-key api-key
:secret-key secret-key
:scopes #{"all" "all/read"}}]
(adp/-get-api-keys lrs acc-id))))
(is (let [[result] (adp/-get-api-keys lrs acc-id)]
(and
(= {:api-key api-key
:secret-key secret-key
:scopes #{"all" "all/read"}}
(dissoc result :id))))))
(testing "and credential update"
(is (= {:api-key api-key
:secret-key secret-key
Expand All @@ -298,12 +299,13 @@
api-key
secret-key
#{"all/read" "statements/read" "statements/read/mine"})))
(is (= [{:api-key api-key
:secret-key secret-key
:scopes #{"all/read"
"statements/read"
"statements/read/mine"}}]
(adp/-get-api-keys lrs acc-id))))
(is (let [[result] (adp/-get-api-keys lrs acc-id)]
(= {:api-key api-key
:secret-key secret-key
:scopes #{"all/read"
"statements/read"
"statements/read/mine"}}
(dissoc result :id)))))
(testing "and credential deletion"
(adp/-delete-api-keys lrs acc-id api-key secret-key)
(is (= []
Expand Down
3 changes: 2 additions & 1 deletion src/test/lrsql/admin/route_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,8 @@
(u/parse-json :object? false)
(#(filter (fn [cred] (= (get cred "api-key") api-key))
%))
first)))))
first
(dissoc "id"))))))
(testing "and updating"
(let [req-scopes
["all/read" "statements/read" "statements/read/mine"]
Expand Down

0 comments on commit b8895c3

Please sign in to comment.