multi registry support v2

This commit is contained in:
2025-11-19 15:17:32 +00:00
parent 211a74910e
commit e4480bff5d
10 changed files with 2297 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
import { IRequestContext, IResponse, IAuthToken } from './interfaces.core.js';
/**
* Abstract base class for all registry protocol implementations
*/
export abstract class BaseRegistry {
/**
* Initialize the registry
*/
abstract init(): Promise<void>;
/**
* Handle an incoming HTTP request
* @param context - Request context
* @returns Response object
*/
abstract handleRequest(context: IRequestContext): Promise<IResponse>;
/**
* Get the base path for this registry protocol
*/
abstract getBasePath(): string;
/**
* Validate that a token has the required permissions
* @param token - Authentication token
* @param resource - Resource being accessed
* @param action - Action being performed
* @returns true if authorized
*/
protected abstract checkPermission(
token: IAuthToken | null,
resource: string,
action: string
): Promise<boolean>;
}