feat(auth): implement JWT-based authentication with admin access controls
This commit is contained in:
@ -11,7 +11,7 @@ export class OpsServer {
|
||||
public typedrouter = new plugins.typedrequest.TypedRouter();
|
||||
|
||||
// Handler instances
|
||||
private adminHandler: handlers.AdminHandler;
|
||||
public adminHandler: handlers.AdminHandler;
|
||||
private configHandler: handlers.ConfigHandler;
|
||||
private logsHandler: handlers.LogsHandler;
|
||||
private securityHandler: handlers.SecurityHandler;
|
||||
@ -36,7 +36,7 @@ export class OpsServer {
|
||||
this.server.typedrouter.addTypedRouter(this.dcRouterRef.typedrouter);
|
||||
|
||||
// Set up handlers
|
||||
this.setupHandlers();
|
||||
await this.setupHandlers();
|
||||
|
||||
await this.server.start(3000);
|
||||
}
|
||||
@ -44,9 +44,11 @@ export class OpsServer {
|
||||
/**
|
||||
* Set up all TypedRequest handlers
|
||||
*/
|
||||
private setupHandlers(): void {
|
||||
private async setupHandlers(): Promise<void> {
|
||||
// Instantiate all handlers - they self-register with the typedrouter
|
||||
this.adminHandler = new handlers.AdminHandler(this);
|
||||
await this.adminHandler.initialize(); // JWT needs async initialization
|
||||
|
||||
this.configHandler = new handlers.ConfigHandler(this);
|
||||
this.logsHandler = new handlers.LogsHandler(this);
|
||||
this.securityHandler = new handlers.SecurityHandler(this);
|
||||
|
Reference in New Issue
Block a user