Skip to content

Commit

Permalink
fix: agent auth
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna <[email protected]>
  • Loading branch information
GHkrishna committed Apr 10, 2024
1 parent b413ca0 commit c9b54da
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/controllers/agent/AgentController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class AgentController extends Controller {
/**
* Retrieve basic agent information
*/
@Get('/info')
@Get('/')
public async getAgentInfo(): Promise<AgentInfo> {
return {
label: this.agent.config.label,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<RequestHandler>(AgentController)),
...(fetchMiddlewares<RequestHandler>(AgentController.prototype.getAgentInfo)),

Expand Down
2 changes: 1 addition & 1 deletion src/routes/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10773,7 +10773,7 @@
}
}
},
"/agent/info": {
"/agent": {
"get": {
"operationId": "GetAgentInfo",
"responses": {
Expand Down
6 changes: 5 additions & 1 deletion src/securityMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c9b54da

Please sign in to comment.