@citrineos/util
Version:
The OCPP util module which supplies helpful utilities like cache and queue connectors, etc.
33 lines (32 loc) • 953 B
TypeScript
import type { ILogObj } from 'tslog';
import { Logger } from 'tslog';
/**
* Class to load and validate RBAC rules
*/
export declare class RbacRulesLoader {
private _rules;
private readonly _logger;
/**
* Creates a new RBAC rules loader
*
* @param rulesFilePath Path to the JSON rules file
* @param logger Logger instance
*/
constructor(rulesFilePath: string, logger: Logger<ILogObj>);
/**
* Load and validate rules from a JSON file
*
* @param filePath Path to the JSON rules file
*/
private loadRules;
/**
* Get the required roles for a specific tenant, URL, and HTTP method
*
* @param tenantId Tenant identifier
* @param url URL path
* @param method HTTP method
* @returns Array of required roles or null if no matching rule
*/
getRequiredRoles(tenantId: string, url: string, method: string): string[] | null;
private normalizeUrl;
}