|
1 | | -# JwtTestUtils |
2 | | - |
3 | 1 | [](https://coveralls.io/github/heyorbit/elixir-jwt-utils?branch=master) |
4 | | -[](https://hex.pm/packages/server_utils) |
5 | | -[](https://hexdocs.pm/server_utils) |
| 2 | +[](https://hex.pm/packages/jwt_test_utils) |
| 3 | +[](https://hexdocs.pm/jwt_test_utils) |
6 | 4 | [](https://travis-ci.org/heyorbit/elixir-jwt-utils) |
7 | 5 | [](https://beta.hexfaktor.org/github/heyorbit/elixir-jwt-utils) |
8 | 6 |
|
9 | | -# ServerUtils |
| 7 | +# JwtTestUtils |
10 | 8 |
|
11 | | -This project has several module utils to handle common tasks in a server, like authorization params parsing. |
| 9 | +Test utils for app based JWT authentication |
12 | 10 |
|
13 | 11 | Features: |
14 | 12 |
|
15 | | - * Phoenix plug to validate JWT header |
16 | | - * Phoenix plug to parse a pagination request |
17 | | - * Simple integer parsing |
18 | | - * Page query params parser |
19 | | - * JWT claims parser |
20 | | - * Wrapped Logger with Sentry integration |
| 13 | + * Create mocked JWT tokens |
| 14 | + * Create Plug.Conn structs with an injected JWT token |
21 | 15 |
|
22 | 16 | ## Installation |
23 | 17 |
|
24 | 18 | Add to dependencies |
25 | 19 |
|
26 | 20 | ```elixir |
27 | 21 | def deps do |
28 | | - [{:server_utils, "~> 0.1.3"}] |
| 22 | + [{:jwt_test_utils, "~> 0.1.1", only: :test}] |
29 | 23 | end |
30 | 24 | ``` |
31 | 25 |
|
32 | 26 | ```bash |
33 | 27 | mix deps.get |
34 | 28 | ``` |
35 | | - |
36 | | -## Configuration |
37 | | - |
38 | | -Configure default pagination params |
39 | | - |
40 | | -``` |
41 | | -config :server_utils, |
42 | | - page_size_key: "page_size", |
43 | | - page_number_key: "page_number", |
44 | | - max_page_size: 25, |
45 | | - page_size: 10, |
46 | | - page_number: 1 |
47 | | -``` |
0 commit comments