From 3be37d12932c17c5a51d08c7e9041a08a176bc80 Mon Sep 17 00:00:00 2001 From: Max Mayfield Date: Mon, 2 Mar 2026 13:54:46 +0000 Subject: [PATCH] Skip auth on /version endpoint (same as /health) --- products/02-iac-drift-detection/saas/src/auth/middleware.ts | 2 +- products/03-alert-intelligence/src/auth/middleware.ts | 2 +- products/04-lightweight-idp/src/auth/middleware.ts | 2 +- products/05-aws-cost-anomaly/src/auth/middleware.ts | 2 +- products/06-runbook-automation/saas/src/auth/middleware.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/products/02-iac-drift-detection/saas/src/auth/middleware.ts b/products/02-iac-drift-detection/saas/src/auth/middleware.ts index ff679f6..74d519f 100644 --- a/products/02-iac-drift-detection/saas/src/auth/middleware.ts +++ b/products/02-iac-drift-detection/saas/src/auth/middleware.ts @@ -24,7 +24,7 @@ export function registerAuth(app: FastifyInstance, jwtSecret: string, pool: Pool app.decorateRequest('userRole', 'viewer'); app.addHook('onRequest', async (req: FastifyRequest, reply: FastifyReply) => { - if (req.url === '/health') return; + if (req.url === '/health' || req.url === '/version') return; if (req.url.startsWith('/webhooks/')) return; if (req.url.startsWith('/slack/')) return; if (req.url.startsWith('/api/v1/auth/login') || req.url.startsWith('/api/v1/auth/signup')) return; diff --git a/products/03-alert-intelligence/src/auth/middleware.ts b/products/03-alert-intelligence/src/auth/middleware.ts index ff679f6..74d519f 100644 --- a/products/03-alert-intelligence/src/auth/middleware.ts +++ b/products/03-alert-intelligence/src/auth/middleware.ts @@ -24,7 +24,7 @@ export function registerAuth(app: FastifyInstance, jwtSecret: string, pool: Pool app.decorateRequest('userRole', 'viewer'); app.addHook('onRequest', async (req: FastifyRequest, reply: FastifyReply) => { - if (req.url === '/health') return; + if (req.url === '/health' || req.url === '/version') return; if (req.url.startsWith('/webhooks/')) return; if (req.url.startsWith('/slack/')) return; if (req.url.startsWith('/api/v1/auth/login') || req.url.startsWith('/api/v1/auth/signup')) return; diff --git a/products/04-lightweight-idp/src/auth/middleware.ts b/products/04-lightweight-idp/src/auth/middleware.ts index ff679f6..74d519f 100644 --- a/products/04-lightweight-idp/src/auth/middleware.ts +++ b/products/04-lightweight-idp/src/auth/middleware.ts @@ -24,7 +24,7 @@ export function registerAuth(app: FastifyInstance, jwtSecret: string, pool: Pool app.decorateRequest('userRole', 'viewer'); app.addHook('onRequest', async (req: FastifyRequest, reply: FastifyReply) => { - if (req.url === '/health') return; + if (req.url === '/health' || req.url === '/version') return; if (req.url.startsWith('/webhooks/')) return; if (req.url.startsWith('/slack/')) return; if (req.url.startsWith('/api/v1/auth/login') || req.url.startsWith('/api/v1/auth/signup')) return; diff --git a/products/05-aws-cost-anomaly/src/auth/middleware.ts b/products/05-aws-cost-anomaly/src/auth/middleware.ts index ff679f6..74d519f 100644 --- a/products/05-aws-cost-anomaly/src/auth/middleware.ts +++ b/products/05-aws-cost-anomaly/src/auth/middleware.ts @@ -24,7 +24,7 @@ export function registerAuth(app: FastifyInstance, jwtSecret: string, pool: Pool app.decorateRequest('userRole', 'viewer'); app.addHook('onRequest', async (req: FastifyRequest, reply: FastifyReply) => { - if (req.url === '/health') return; + if (req.url === '/health' || req.url === '/version') return; if (req.url.startsWith('/webhooks/')) return; if (req.url.startsWith('/slack/')) return; if (req.url.startsWith('/api/v1/auth/login') || req.url.startsWith('/api/v1/auth/signup')) return; diff --git a/products/06-runbook-automation/saas/src/auth/middleware.ts b/products/06-runbook-automation/saas/src/auth/middleware.ts index ff679f6..74d519f 100644 --- a/products/06-runbook-automation/saas/src/auth/middleware.ts +++ b/products/06-runbook-automation/saas/src/auth/middleware.ts @@ -24,7 +24,7 @@ export function registerAuth(app: FastifyInstance, jwtSecret: string, pool: Pool app.decorateRequest('userRole', 'viewer'); app.addHook('onRequest', async (req: FastifyRequest, reply: FastifyReply) => { - if (req.url === '/health') return; + if (req.url === '/health' || req.url === '/version') return; if (req.url.startsWith('/webhooks/')) return; if (req.url.startsWith('/slack/')) return; if (req.url.startsWith('/api/v1/auth/login') || req.url.startsWith('/api/v1/auth/signup')) return;