You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2020/03/19 19:30:18 UTC
[couchdb] 03/04: test all variants of jwt hmac
This is an automated email from the ASF dual-hosted git repository.
rnewson pushed a commit to branch jwt-enhancements
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit cadc0de27e7ded575b67384934f5f2cdc37225fe
Author: Robert Newson <rn...@apache.org>
AuthorDate: Thu Mar 19 16:16:05 2020 +0000
test all variants of jwt hmac
---
test/elixir/test/jwtauth_test.exs | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/test/elixir/test/jwtauth_test.exs b/test/elixir/test/jwtauth_test.exs
index 9f2074c..aee14b3 100644
--- a/test/elixir/test/jwtauth_test.exs
+++ b/test/elixir/test/jwtauth_test.exs
@@ -3,7 +3,7 @@ defmodule JwtAuthTest do
@moduletag :authentication
- test "jwt auth with HS256 secret", _context do
+ test "jwt auth with HMAC secret", _context do
secret = "zxczxc12zxczxc12"
@@ -12,12 +12,17 @@ defmodule JwtAuthTest do
:section => "jwt_auth",
:key => "secret",
:value => secret
+ },
+ %{
+ :section => "jwt_auth",
+ :key => "allowed_algorithms",
+ :value => "HS256, HS384, HS512"
}
]
- run_on_modified_server(server_config, fn ->
- test_fun("HS256", secret)
- end)
+ run_on_modified_server(server_config, fn -> test_fun("HS256", secret) end)
+ run_on_modified_server(server_config, fn -> test_fun("HS384", secret) end)
+ run_on_modified_server(server_config, fn -> test_fun("HS512", secret) end)
end
def test_fun(alg, key) do