|
19 | 19 | from litestar.security.jwt.token import JWTDecodeOptions
|
20 | 20 |
|
21 | 21 |
|
| 22 | +@pytest.mark.parametrize("algorithm", ["HS256", "HS384", "HS512"]) |
| 23 | +@pytest.mark.parametrize("token_issuer", [None, "e3d7d10edbbc28bfebd8861d39ae7587acde1e1fcefe2cbbec686d235d68f475"]) |
| 24 | +@pytest.mark.parametrize("token_audience", [None, "627224198b4245ed91cf8353e4ccdf1650728c7ee92748f55fe1e9a9c4d961df"]) |
22 | 25 | @pytest.mark.parametrize(
|
23 |
| - "algorithm", |
24 |
| - [pytest.param("HS256", id="HS256"), pytest.param("HS384", id="HS384"), pytest.param("HS512", id="HS512")], |
25 |
| -) |
26 |
| -@pytest.mark.parametrize( |
27 |
| - "token_issuer", |
28 |
| - [ |
29 |
| - pytest.param(None, id="None"), |
30 |
| - pytest.param("e3d7d10edbbc28bfebd8861d39ae7587acde1e1fcefe2cbbec686d235d68f475", id="String"), |
31 |
| - ], |
32 |
| -) |
33 |
| -@pytest.mark.parametrize( |
34 |
| - "token_audience", |
35 |
| - [ |
36 |
| - pytest.param(None, id="None"), |
37 |
| - pytest.param("627224198b4245ed91cf8353e4ccdf1650728c7ee92748f55fe1e9a9c4d961df", id="String"), |
38 |
| - ], |
39 |
| -) |
40 |
| -@pytest.mark.parametrize( |
41 |
| - "token_unique_jwt_id", |
42 |
| - [ |
43 |
| - pytest.param(None, id="None"), |
44 |
| - pytest.param("10f5c6967783ddd6bb0c4e8262d7097caeae64705e45f83275e3c32eee5d30f2", id="String"), |
45 |
| - ], |
46 |
| -) |
47 |
| -@pytest.mark.parametrize( |
48 |
| - "token_extras", [pytest.param(None, id="None"), pytest.param({"email": "[email protected]"}, id="Dict")] |
| 26 | + "token_unique_jwt_id", [None, "10f5c6967783ddd6bb0c4e8262d7097caeae64705e45f83275e3c32eee5d30f2"] |
49 | 27 | )
|
| 28 | +@pytest.mark.parametrize("token_extras", [None, {"email": "[email protected]"}]) |
50 | 29 | def test_token(
|
51 | 30 | algorithm: str,
|
52 | 31 | token_issuer: str | None,
|
53 |
| - token_audience: str | Sequence[str] | None, |
| 32 | + token_audience: str | None, |
54 | 33 | token_unique_jwt_id: str | None,
|
55 | 34 | token_extras: dict[str, Any] | None,
|
56 | 35 | ) -> None:
|
|
0 commit comments