diff options
author | Robert Newson <rnewson@apache.org> | 2020-03-19 16:16:05 +0000 |
---|---|---|
committer | Robert Newson <rnewson@apache.org> | 2020-03-22 23:16:29 +0000 |
commit | 5c77ef0b9cf3be98db3da692527e4c8726b2fc78 (patch) | |
tree | affd5f6a370896c3cf4df2821a03c60ff7862cc3 | |
parent | bb86d0478412e525e810abbb4cecbdd32c6d3e11 (diff) | |
download | couchdb-5c77ef0b9cf3be98db3da692527e4c8726b2fc78.tar.gz |
test all variants of jwt hmac
-rw-r--r-- | test/elixir/test/jwtauth_test.exs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/elixir/test/jwtauth_test.exs b/test/elixir/test/jwtauth_test.exs index 9f2074ccf..aee14b3c5 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 |