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:
parent
5ee1227800
commit
f897cfe240
|
|
@ -1,18 +1,16 @@
|
|||
/**
|
||||
* 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)
|
||||
* POST /api/v1/agent-config → Create new config
|
||||
* PUT /api/v1/agent-config/:id → Update existing config
|
||||
*/
|
||||
import { Controller, Get, Post, Put, Body, Param, UseGuards } from '@nestjs/common';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import { Controller, Get, Post, Put, Body, Param } from '@nestjs/common';
|
||||
import { TenantId } from '@it0/common';
|
||||
import { AgentConfigService, UpdateAgentConfigDto } from '../../../infrastructure/services/agent-config.service';
|
||||
|
||||
@Controller('api/v1/agent-config')
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
export class AgentConfigController {
|
||||
constructor(private readonly configService: AgentConfigService) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,13 +7,11 @@
|
|||
* PUT /api/v1/agent/hooks/:id → Update an existing hook
|
||||
* DELETE /api/v1/agent/hooks/:id → Delete a hook
|
||||
*/
|
||||
import { Controller, Get, Post, Put, Delete, Body, Param, UseGuards, NotFoundException } from '@nestjs/common';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import { Controller, Get, Post, Put, Delete, Body, Param, NotFoundException } from '@nestjs/common';
|
||||
import { TenantId } from '@it0/common';
|
||||
import { HookScriptService, CreateHookDto, UpdateHookDto } from '../../../infrastructure/services/hook-script.service';
|
||||
|
||||
@Controller('api/v1/agent/hooks')
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
export class HooksController {
|
||||
constructor(private readonly hookService: HookScriptService) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,13 +7,11 @@
|
|||
* PUT /api/v1/agent/skills/:id → Update an existing skill
|
||||
* DELETE /api/v1/agent/skills/:id → Delete a skill
|
||||
*/
|
||||
import { Controller, Get, Post, Put, Delete, Body, Param, UseGuards, NotFoundException } from '@nestjs/common';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import { Controller, Get, Post, Put, Delete, Body, Param, NotFoundException } from '@nestjs/common';
|
||||
import { TenantId } from '@it0/common';
|
||||
import { AgentSkillService, CreateSkillDto, UpdateSkillDto } from '../../../infrastructure/services/agent-skill.service';
|
||||
|
||||
@Controller('api/v1/agent/skills')
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
export class SkillsController {
|
||||
constructor(private readonly skillService: AgentSkillService) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,13 +8,11 @@
|
|||
*
|
||||
* 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 { AuthGuard } from '@nestjs/passport';
|
||||
import { Controller, Get, Put, Delete, Body, NotFoundException } from '@nestjs/common';
|
||||
import { TenantId } from '@it0/common';
|
||||
import { TenantAgentConfigService, UpdateTenantAgentConfigDto } from '../../../infrastructure/services/tenant-agent-config.service';
|
||||
|
||||
@Controller('api/v1/agent/tenant-config')
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
export class TenantAgentConfigController {
|
||||
constructor(
|
||||
private readonly tenantConfigService: TenantAgentConfigService,
|
||||
|
|
|
|||
Loading…
Reference in New Issue