diff --git a/deploy/nginx/host/dev/dev.procollab.ru b/deploy/nginx/host/dev/dev.procollab.ru index 38ec2fbf..e8f50d2c 100644 --- a/deploy/nginx/host/dev/dev.procollab.ru +++ b/deploy/nginx/host/dev/dev.procollab.ru @@ -37,7 +37,7 @@ server { include /etc/nginx/procollab/includes/proxy_app.inc; } - location ~ ^/(admin|api-auth|files|industries|news|projects|vacancies|core|invites|auth|chats|events|programs|courses|rate-project|evaluation|feed|api|anymail|ws)(/|$) { + location ~ ^/(admin|api-auth|files|industries|news|projects|vacancies|core|invites|solution-invitations|solution-form-templates|auth|chats|events|programs|courses|rate-project|evaluation|feed|api|anymail|ws)(/|$) { include /etc/nginx/procollab/includes/proxy_app.inc; } diff --git a/scripts/check_dev_routes.py b/scripts/check_dev_routes.py index 781873ef..be24410f 100644 --- a/scripts/check_dev_routes.py +++ b/scripts/check_dev_routes.py @@ -45,6 +45,8 @@ def check_routes(base_url, context=None): # These invalid requests cannot send reset email or change a password. for path, method, expected in ( ("/auth/users/current/", "GET", 401), + ("/solution-invitations/?status=pending&limit=100&offset=0", "GET", 401), + ("/solution-form-templates/", "GET", 401), ("/auth/reset_password/", "POST", 400), ("/auth/reset_password/confirm/", "POST", 400), ("/auth/reset_password/validate_token/", "POST", 400), diff --git a/scripts/tests/test_dev_nginx_routes.py b/scripts/tests/test_dev_nginx_routes.py index 44750626..6dc3f492 100644 --- a/scripts/tests/test_dev_nginx_routes.py +++ b/scripts/tests/test_dev_nginx_routes.py @@ -27,7 +27,8 @@ def respond(self, status): self.wfile.write(body) def do_GET(self): - self.respond(401 if self.path == "/auth/users/current/" else 404) + protected = {"/auth/users/current/", "/solution-invitations/", "/solution-form-templates/"} + self.respond(401 if self.path.partition("?")[0] in protected else 404) def do_POST(self): self.rfile.read(int(self.headers.get("Content-Length", 0))) @@ -104,10 +105,17 @@ def test_spa_reads_and_api_requests(self): time.sleep(0.1) check_routes(base_url, context) # Unknown auth URLs and protected APIs never fall through to SPA. - for path in ("/auth/unknown/", "/auth/login/unrecognized/", "/programs/6/"): + for path in ( + "/auth/unknown/", "/auth/login/unrecognized/", "/programs/6/", + "/solution-invitations/123/", "/solution-invitations/123/accept/", + "/solution-form-templates/unknown/", + ): status, content_type, body = request(base_url, path, context=context) self.assertEqual((status, content_type), (404, "application/json")) self.assertEqual(json.loads(body)["backend_path"], path) + status, content_type, body = request(base_url, "/solution-invitations-about", context=context) + self.assertEqual((status, content_type), (200, "text/html")) + self.assertIn(b"