diff --git a/src/controllers/agent/AgentController.ts b/src/controllers/agent/AgentController.ts index 79f42b26..a7ec6fc6 100644 --- a/src/controllers/agent/AgentController.ts +++ b/src/controllers/agent/AgentController.ts @@ -19,7 +19,7 @@ export class AgentController extends Controller { /** * Retrieve basic agent information */ - @Get('/info') + @Get('/') public async getAgentInfo(): Promise { return { label: this.agent.config.label, diff --git a/src/routes/routes.ts b/src/routes/routes.ts index d2b9cce8..a83b6bc7 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -4081,7 +4081,7 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/agent/info', + app.get('/agent', ...(fetchMiddlewares(AgentController)), ...(fetchMiddlewares(AgentController.prototype.getAgentInfo)), diff --git a/src/routes/swagger.json b/src/routes/swagger.json index b78f5c04..8c5e1342 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -10773,7 +10773,7 @@ } } }, - "/agent/info": { + "/agent": { "get": { "operationId": "GetAgentInfo", "responses": { diff --git a/src/securityMiddleware.ts b/src/securityMiddleware.ts index 1b7b834f..75654c49 100644 --- a/src/securityMiddleware.ts +++ b/src/securityMiddleware.ts @@ -16,7 +16,11 @@ export class SecurityMiddleware { const requestMethod = request.method // List of paths for which authentication should be skipped - const pathsToSkipAuthentication = ['/url/', '/multi-tenancy/url/', '/agent/info'] + const pathsToSkipAuthentication = [ + { path: '/url/', method: 'GET' }, + { path: '/multi-tenancy/url/', method: 'GET' }, + { path: '/agent', method: 'GET' }, + ] // Check if authentication should be skipped for this route or controller const skipAuthentication = pathsToSkipAuthentication.some(