@enactprotocol/security
Version:
Backend security library for signing enact documents
68 lines (67 loc) • 1.83 kB
TypeScript
import type { SecurityConfig } from './types';
export declare class SecurityConfigManager {
private static readonly ENACT_DIR;
private static readonly SECURITY_DIR;
private static readonly CONFIG_FILE;
/**
* Ensure the .enact/security directory structure exists
*/
private static ensureDirectories;
/**
* Initialize security config with default values if it doesn't exist
*/
static initializeConfig(): SecurityConfig;
/**
* Load security config from file
*/
static loadConfig(): SecurityConfig;
/**
* Save security config to file
*/
static saveConfig(config: SecurityConfig): boolean;
/**
* Update specific config values
*/
static updateConfig(updates: Partial<SecurityConfig>): SecurityConfig;
/**
* Reset config to defaults
*/
static resetToDefaults(): SecurityConfig;
/**
* Get the paths used by the security config manager
*/
static getPaths(): {
enactDir: string;
securityDir: string;
configFile: string;
};
/**
* Check if security config exists
*/
static configExists(): boolean;
/**
* Get current config status
*/
static getStatus(): {
enactDirExists: boolean;
securityDirExists: boolean;
configFileExists: boolean;
paths: {
enactDir: string;
securityDir: string;
configFile: string;
};
};
/**
* Validate security config structure
*/
static validateConfig(config: any): config is SecurityConfig;
/**
* Import config from another file
*/
static importConfig(filePath: string): SecurityConfig | null;
/**
* Export current config to a file
*/
static exportConfig(filePath: string): boolean;
}