diff --git a/services/platform-service/src/server.ts b/services/platform-service/src/server.ts index accc8380..9d0546ae 100644 --- a/services/platform-service/src/server.ts +++ b/services/platform-service/src/server.ts @@ -300,8 +300,11 @@ await app.register( '/devops/info', { preHandler: async (request, reply) => { - // Require admin role - const auth = (request as any).auth; + // Require admin role. The `auth` property is decorated onto the + // Fastify request by the auth preHandler upstream; cast through + // `unknown` to read it without `any` (a `declare module` augmentation + // would be cleaner but requires touching @bytelyst/fastify-auth). + const auth = (request as unknown as { auth?: { role?: string } }).auth; if (!auth || auth.role !== 'admin') { return reply.code(403).send({ error: 'Admin access required' }); }