[2024-09-24 22:39:47] [INFO] Overriding the public key used to verify the signature [2024-09-24 22:39:47] [UNKNOWN] Take down any old project WARN[0000] /home/nick/projects/github/haproxy-lua-oauth/docker-compose.ubuntu.example.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion [2024-09-24 22:39:48] [INFO] Start the compose project WARN[0000] /home/nick/projects/github/haproxy-lua-oauth/docker-compose.ubuntu.example.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion [+] Running 3/3 ✔ Network haproxy-lua-oauth_default Created 0.1s ✔ Container haproxy-lua-oauth-server1-1 Started 0.4s ✔ Container haproxy-lua-oauth-haproxy-1 Started 0.7s [2024-09-24 22:39:48] [INFO] Waiting for containers to go up Waiting for at least 2 containers to be running... WARN[0000] /home/nick/projects/github/haproxy-lua-oauth/docker-compose.ubuntu.example.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion WARN[0000] /home/nick/projects/github/haproxy-lua-oauth/docker-compose.ubuntu.example.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion haproxy-1 | Reading file /etc/haproxy/pem/pubkey.pem haproxy-1 | Reading file /etc/haproxy/pem/pubkey2.pem haproxy-1 | PublicKeyPath: /etc/haproxy/pem/pubkey.pem /etc/haproxy/pem/pubkey2.pem haproxy-1 | KeyIdentifiers: key1 key2 haproxy-1 | Issuer: https://youraccount.auth0.com/ haproxy-1 | Audience: https://api.mywebsite.com haproxy-1 | [NOTICE] (1) : New worker (8) forked haproxy-1 | [NOTICE] (1) : Loading success. At least 2 containers are running. server1-1 | server1-1 | > web@1.0.0 start server1-1 | > node index.js server1-1 | WARN[0000] /home/nick/projects/github/haproxy-lua-oauth/docker-compose.ubuntu.example.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion Waiting for haproxy to be up... WARN[0000] /home/nick/projects/github/haproxy-lua-oauth/docker-compose.ubuntu.example.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion haproxy is up! Waiting for server1 to be up... server1-1 | Server listening on port 80 WARN[0000] /home/nick/projects/github/haproxy-lua-oauth/docker-compose.ubuntu.example.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion server1 is up! [2024-09-24 22:39:49] [INFO] Running test_sanity... [2024-09-24 22:39:49] [INFO] Payload (modify as needed) [2024-09-24 22:39:49] [INFO] Create jwt [2024-09-24 22:39:49] [INFO] Testing the API haproxy-1 | Decoded JWT header: { ["alg"] = RS256,["typ"] = JWT,["kid"] = key1,} haproxy-1 | Decoded JWT payload: { ["scope"] = read:myapp,["exp"] = 1727235589,["sub"] = user@example.com,["iss"] = https://youraccount.auth0.com/,["aud"] = https://api.mywebsite.com,} haproxy-1 | req.authorized = true curl: (22) haproxy-1 | 172.18.0.1:59546 [25/Sep/2024:02:39:49.601] api_gateway~ apiservers/server1 0/0/9/9/18 404 383 - - ---- 1/1/0/0/0 0/0 "GET https://localhost/api/myapp HTTP/2.0" The requested URL returned error: 404 [2024-09-24 22:39:49] [ERROR] test_sanity failed [2024-09-24 22:39:49] [INFO] Running test_no_audience... [2024-09-24 22:39:49] [INFO] Payload (modify as needed) [2024-09-24 22:39:49] [INFO] Create jwt [2024-09-24 22:39:49] [INFO] Testing the API haproxy-1 | Decoded JWT header: { ["alg"] = RS256,["typ"] = JWT,["kid"] = key1,} haproxy-1 | Decoded JWT payload: { ["scope"] = read:myapp,["iss"] = https://youraccount.auth0.com/,["exp"] = 1727235589,["sub"] = user@example.com,} chaproxy-1 | Audience not valid. urhaproxy-1 | req.authorized = false l: haproxy-1 | 172.18.0.1:59548 [25/Sep/2024:02:39:49.676] api_gateway~ api_gateway/ 0/-1/-1/-1/0 403 192 - - PR-- 1/1/0/0/0 0/0 "GET https://localhost/api/myapp HTTP/2.0" (22) The requested URL returned error: 403 [2024-09-24 22:39:49] [INFO] test_no_audience passed [2024-09-24 22:39:49] [INFO] Running test_incorrect_key_id... [2024-09-24 22:39:49] [INFO] Payload (modify as needed) [2024-09-24 22:39:49] [INFO] Create jwt [2024-09-24 22:39:49] [INFO] Testing the API haproxy-1 | Decoded JWT header: { ["alg"] = RS256,["typ"] = JWT,["kid"] = key195,} haproxy-1 | Decoded JWT payload: { ["scope"] = read:myapp,["exp"] = 1727235589,["sub"] = user@example.com,["iss"] = https://youraccount.auth0.com/,["aud"] = https://api.mywebsite.com,} haproxy-1 | The kid provided in the token (key195) does not match the kid provided in the configuration. haproxy-1 | Signature not valid. haproxy-1 | req.authorized = false chaproxy-1 | 172.18.0.1:59556 [25/Sep/2024:02:39:49.740] api_gateway~ api_gateway/ 0/-1/-1/-1/0 403 192 - - PR-- 1/1/0/0/0 0/0 "GET https://localhost/api/myapp HTTP/2.0" url: (22) The requested URL returned error: 403 [2024-09-24 22:39:49] [INFO] test_incorrect_key_id passed [2024-09-24 22:39:49] [INFO] Running test_second_key_usage_pass... [2024-09-24 22:39:49] [INFO] Payload (modify as needed) [2024-09-24 22:39:49] [INFO] Create jwt [2024-09-24 22:39:49] [INFO] Testing the API haproxy-1 | Decoded JWT header: { ["alg"] = RS256,["typ"] = JWT,["kid"] = key2,} haproxy-1 | Decoded JWT payload: { ["scope"] = read:myapp,["exp"] = 1727235589,["sub"] = user@example.com,["iss"] = https://youraccount.auth0.com/,["aud"] = https://api.mywebsite.com,} haproxy-1 | req.authorized = true haproxy-1 | 172.18.0.1:59558 [25/Sep/2024:02:39:49.793] api_gateway~ apiservers/server1 0/0/0/9/9 404 383 - - ---- 1/1/0/0/0 0/0 "GET https://localhost/api/myapp HTTP/2.0" curl: (22) The requested URL returned error: 404 [2024-09-24 22:39:49] [ERROR] test_second_key_usage_pass failed [2024-09-24 22:39:49] [INFO] Running test_second_key_usage_fail... [2024-09-24 22:39:49] [INFO] Payload (modify as needed) [2024-09-24 22:39:49] [INFO] Create jwt [2024-09-24 22:39:49] [INFO] Testing the API curl: (22) The requested URL returned error: 403 haproxy-1 | Decoded JWT header: { ["alg"] = RS256,["typ"] = JWT,["kid"] = key,} haproxy-1 | Decoded JWT payload: { ["scope"] = read:myapp,["exp"] = 1727235589,["sub"] = user@example.com,["iss"] = https://youraccount.auth0.com/,["aud"] = https://api.mywebsite.com,} haproxy-1 | The kid provided in the token (key) does not match the kid provided in the configuration. haproxy-1 | Signature not valid. haproxy-1 | req.authorized = false haproxy-1 | 172.18.0.1:59560 [25/Sep/2024:02:39:49.854] api_gateway~ api_gateway/ 0/-1/-1/-1/0 403 192 - - PR-- 1/1/0/0/0 0/0 "GET https://localhost/api/myapp HTTP/2.0" [2024-09-24 22:39:49] [INFO] test_second_key_usage_fail passed [2024-09-24 22:39:49] [INFO] Take down any old project WARN[0000] /home/nick/projects/github/haproxy-lua-oauth/docker-compose.ubuntu.example.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion haproxy-1 | [NOTICE] (1) : haproxy version is 2.6.15-446b02c haproxy-1 | [NOTICE] (1) : path to executable is /usr/local/sbin/haproxy haproxy-1 | [WARNING] (1) : Exiting Master process... haproxy-1 | [WARNING] (8) : Proxy api_gateway stopped (cumulated conns: FE: 5, BE: 0). haproxy-1 | [WARNING] (8) : Proxy apiservers stopped (cumulated conns: FE: 0, BE: 2). haproxy-1 | Proxy api_gateway stopped (cumulated conns: FE: 5, BE: 0). haproxy-1 | Proxy apiservers stopped (cumulated conns: FE: 0, BE: 2). haproxy-1 | Proxy stopped (cumulated conns: FE: 0, BE: 0). haproxy-1 | [WARNING] (8) : Proxy stopped (cumulated conns: FE: 0, BE: 0). haproxy-1 | [WARNING] (1) : Current worker (8) exited with code 0 (Exit) haproxy-1 | [WARNING] (1) : All workers exited. Exiting... (0) [+] Running 0/1 [+] Running 1/2proxy-lua-oauth-haproxy-1 Stopping 0.6s [+] Running 3/3proxy-lua-oauth-haproxy-1 Removed 0.6s ✔ Container haproxy-lua-oauth-haproxy-1 Removed 0.6s ✔ Container haproxy-lua-oauth-server1-1 Removed 10.4s ✔ Network haproxy-lua-oauth_default Removed 0.4s [2024-09-24 22:40:01] [ERROR] Some tests failed. The run failed.