fix: remove AuthGuard('jwt') from agent-service controllers

Agent-service does not have a registered Passport JWT strategy —
JWT validation is handled by Kong API gateway. The AuthGuard was
causing 500 "Unknown authentication strategy" errors on all
new controller endpoints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-21 22:36:46 -08:00
parent 5ee1227800
commit f897cfe240
4 changed files with 5 additions and 13 deletions

View File

@ -1,18 +1,16 @@
/** /**
* REST controller for per-tenant agent configuration (engine, prompt, turns, budget, tools). * REST controller for per-tenant agent configuration (engine, prompt, turns, budget, tools).
* *
* Endpoints (all JWT-protected): * Endpoints (JWT validated by Kong gateway):
* GET /api/v1/agent-config Get current tenant's config (returns defaults if none set) * GET /api/v1/agent-config Get current tenant's config (returns defaults if none set)
* POST /api/v1/agent-config Create new config * POST /api/v1/agent-config Create new config
* PUT /api/v1/agent-config/:id Update existing config * PUT /api/v1/agent-config/:id Update existing config
*/ */
import { Controller, Get, Post, Put, Body, Param, UseGuards } from '@nestjs/common'; import { Controller, Get, Post, Put, Body, Param } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { TenantId } from '@it0/common'; import { TenantId } from '@it0/common';
import { AgentConfigService, UpdateAgentConfigDto } from '../../../infrastructure/services/agent-config.service'; import { AgentConfigService, UpdateAgentConfigDto } from '../../../infrastructure/services/agent-config.service';
@Controller('api/v1/agent-config') @Controller('api/v1/agent-config')
@UseGuards(AuthGuard('jwt'))
export class AgentConfigController { export class AgentConfigController {
constructor(private readonly configService: AgentConfigService) {} constructor(private readonly configService: AgentConfigService) {}

View File

@ -7,13 +7,11 @@
* PUT /api/v1/agent/hooks/:id Update an existing hook * PUT /api/v1/agent/hooks/:id Update an existing hook
* DELETE /api/v1/agent/hooks/:id Delete a hook * DELETE /api/v1/agent/hooks/:id Delete a hook
*/ */
import { Controller, Get, Post, Put, Delete, Body, Param, UseGuards, NotFoundException } from '@nestjs/common'; import { Controller, Get, Post, Put, Delete, Body, Param, NotFoundException } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { TenantId } from '@it0/common'; import { TenantId } from '@it0/common';
import { HookScriptService, CreateHookDto, UpdateHookDto } from '../../../infrastructure/services/hook-script.service'; import { HookScriptService, CreateHookDto, UpdateHookDto } from '../../../infrastructure/services/hook-script.service';
@Controller('api/v1/agent/hooks') @Controller('api/v1/agent/hooks')
@UseGuards(AuthGuard('jwt'))
export class HooksController { export class HooksController {
constructor(private readonly hookService: HookScriptService) {} constructor(private readonly hookService: HookScriptService) {}

View File

@ -7,13 +7,11 @@
* PUT /api/v1/agent/skills/:id Update an existing skill * PUT /api/v1/agent/skills/:id Update an existing skill
* DELETE /api/v1/agent/skills/:id Delete a skill * DELETE /api/v1/agent/skills/:id Delete a skill
*/ */
import { Controller, Get, Post, Put, Delete, Body, Param, UseGuards, NotFoundException } from '@nestjs/common'; import { Controller, Get, Post, Put, Delete, Body, Param, NotFoundException } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { TenantId } from '@it0/common'; import { TenantId } from '@it0/common';
import { AgentSkillService, CreateSkillDto, UpdateSkillDto } from '../../../infrastructure/services/agent-skill.service'; import { AgentSkillService, CreateSkillDto, UpdateSkillDto } from '../../../infrastructure/services/agent-skill.service';
@Controller('api/v1/agent/skills') @Controller('api/v1/agent/skills')
@UseGuards(AuthGuard('jwt'))
export class SkillsController { export class SkillsController {
constructor(private readonly skillService: AgentSkillService) {} constructor(private readonly skillService: AgentSkillService) {}

View File

@ -8,13 +8,11 @@
* *
* Note: API key is never returned in responses only `hasApiKey: boolean` is exposed. * Note: API key is never returned in responses only `hasApiKey: boolean` is exposed.
*/ */
import { Controller, Get, Put, Delete, Body, UseGuards, NotFoundException } from '@nestjs/common'; import { Controller, Get, Put, Delete, Body, NotFoundException } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { TenantId } from '@it0/common'; import { TenantId } from '@it0/common';
import { TenantAgentConfigService, UpdateTenantAgentConfigDto } from '../../../infrastructure/services/tenant-agent-config.service'; import { TenantAgentConfigService, UpdateTenantAgentConfigDto } from '../../../infrastructure/services/tenant-agent-config.service';
@Controller('api/v1/agent/tenant-config') @Controller('api/v1/agent/tenant-config')
@UseGuards(AuthGuard('jwt'))
export class TenantAgentConfigController { export class TenantAgentConfigController {
constructor( constructor(
private readonly tenantConfigService: TenantAgentConfigService, private readonly tenantConfigService: TenantAgentConfigService,