diff --git a/content/blogs/phantom-token/shell.nix b/content/blogs/phantom-token/shell.nix index 8004e63..67bf5e6 100644 --- a/content/blogs/phantom-token/shell.nix +++ b/content/blogs/phantom-token/shell.nix @@ -3,5 +3,6 @@ pkgs.mkShell { packages = with pkgs; [ bun go + hurl ]; } diff --git a/content/blogs/phantom-token/test.hurl b/content/blogs/phantom-token/test.hurl new file mode 100644 index 0000000..c5563ad --- /dev/null +++ b/content/blogs/phantom-token/test.hurl @@ -0,0 +1,12 @@ +POST http://localhost:7891/auth/user +{ "name": "pina" } +HTTP 201 +[Captures] +session_token: jsonpath "$['token']" + +GET http://localhost:7891/api/me +authorization: Bearer {{session_token}} +HTTP 200 +[Asserts] +jsonpath "$['sub']" == "pina" +jsonpath "$['iss']" == "keibi-blog" \ No newline at end of file