From 9b3bdc7a12fa7132787dd46145f4ec16eb0c0550 Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Sat, 5 Dec 2026 08:32:46 -0600 Subject: [PATCH] Send OpsProof visitors to sign in --- apps/opsproof/README.md | 7 ++++--- apps/opsproof/overlay/handlers/welcome/welcome.go | 2 +- apps/opsproof/overlay/tests/feature/demo_test.go | 2 +- apps/opsproof/overlay/tests/feature/welcome_test.go | 4 +--- docs/opsproof-architecture.md | 6 +++--- tests/jeannie/test_privacy_services_pipeline.py | 5 ++--- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/apps/opsproof/README.md b/apps/opsproof/README.md index cb0c04b..d097628 100644 --- a/apps/opsproof/README.md +++ b/apps/opsproof/README.md @@ -108,9 +108,10 @@ as a successful repair. sanitized fixture. It does not construct a Jeannie client and has no approval or execution controls. The canonical application URL is `https://opsproof.lab2025.duckdns.org/`; unauthenticated root requests redirect -to the fixture. The OCI edge publishes only the fixture, build assets, and the -explicit Dex/operator route families. Incident data and mutations still require -both a valid Dex session and current operator allowlist membership. +to the sign-in page, while `/demo` remains the explicit public fixture. The OCI +edge publishes only the fixture, build assets, and the explicit Dex/operator +route families. Incident data and mutations still require both a valid Dex +session and current operator allowlist membership. ## Security boundary diff --git a/apps/opsproof/overlay/handlers/welcome/welcome.go b/apps/opsproof/overlay/handlers/welcome/welcome.go index 0559fc4..b10614c 100644 --- a/apps/opsproof/overlay/handlers/welcome/welcome.go +++ b/apps/opsproof/overlay/handlers/welcome/welcome.go @@ -23,7 +23,7 @@ type overview struct { func Show(request *web.Request) *web.Response { if models.CurrentUser(request) == nil { - return web.Redirect("/demo") + return web.Redirect("/login") } status := overview{ Message: "Jeannie status is temporarily unavailable.", diff --git a/apps/opsproof/overlay/tests/feature/demo_test.go b/apps/opsproof/overlay/tests/feature/demo_test.go index 1323e4f..6232580 100644 --- a/apps/opsproof/overlay/tests/feature/demo_test.go +++ b/apps/opsproof/overlay/tests/feature/demo_test.go @@ -13,7 +13,7 @@ func TestPublicDemoUsesSanitizedFixtureWithoutAuthentication(t *testing.T) { "OPSPROOF_JEANNIE_URL": "http://127.0.0.1:1", "OPSPROOF_JEANNIE_TOKEN": "must-not-be-used", })) - client.WithoutRedirects().Get("/").AssertRedirect("/demo") + client.WithoutRedirects().Get("/").AssertRedirect("/login") client.Get("/demo").AssertOK().AssertInertia("Demo"). AssertProp("demo.scope", "opi5"). AssertProp("demo.target", "k3s-storage"). diff --git a/apps/opsproof/overlay/tests/feature/welcome_test.go b/apps/opsproof/overlay/tests/feature/welcome_test.go index eb5781a..b9af146 100644 --- a/apps/opsproof/overlay/tests/feature/welcome_test.go +++ b/apps/opsproof/overlay/tests/feature/welcome_test.go @@ -8,7 +8,5 @@ import ( func TestTheWelcomePageRenders(t *testing.T) { client := tests.New(t) - client.Get("/").AssertOK().AssertInertia("Demo"). - AssertProp("demo.target", "k3s-storage"). - AssertProp("demo.outcome", "validated") + client.WithoutRedirects().Get("/").AssertRedirect("/login") } diff --git a/docs/opsproof-architecture.md b/docs/opsproof-architecture.md index 5df027e..f753103 100644 --- a/docs/opsproof-architecture.md +++ b/docs/opsproof-architecture.md @@ -85,9 +85,9 @@ confirmed by deterministic validation. outcome rather than inferring success from the execution status alone. - Keep the unauthenticated portfolio route fixture-only. The OCI edge proxies `/demo`, `/build/`, and explicit login/operator route families. Root redirects - anonymous users to the fixture; live evidence and mutations remain behind - Dex authentication and the server-side operator allowlist. Unknown routes - return 404. + anonymous users to sign-in and `/demo` remains an explicit public fixture; + live evidence and mutations remain behind Dex authentication and the + server-side operator allowlist. Unknown routes return 404. ## Why not Laravel Rust now? diff --git a/tests/jeannie/test_privacy_services_pipeline.py b/tests/jeannie/test_privacy_services_pipeline.py index 560122a..e5fabc2 100644 --- a/tests/jeannie/test_privacy_services_pipeline.py +++ b/tests/jeannie/test_privacy_services_pipeline.py @@ -233,14 +233,13 @@ class OpsProofPipelineTests(unittest.TestCase): ROOT / "apps/opsproof/overlay/handlers/welcome/welcome.go" ).read_text(encoding="utf-8") self.assertIn("models.CurrentUser(request) == nil", welcome) - self.assertIn('web.Redirect("/demo")', welcome) + self.assertIn('web.Redirect("/login")', welcome) welcome_test = ( ROOT / "apps/opsproof/overlay/tests/feature/welcome_test.go" ).read_text(encoding="utf-8") self.assertIn("TestTheWelcomePageRenders", welcome_test) - self.assertIn('AssertInertia("Demo")', welcome_test) - self.assertIn('AssertProp("demo.target", "k3s-storage")', welcome_test) + self.assertIn('AssertRedirect("/login")', welcome_test) if __name__ == "__main__":