codecrucible-synth
Version:
Production-Ready AI Development Platform with Multi-Voice Synthesis, Smithery MCP Integration, Enterprise Security, and Zero-Timeout Reliability
146 lines • 3.73 kB
TypeScript
/**
* Encrypted Configuration Management
* Provides secure configuration loading with environment-specific encryption
*/
export interface ConfigSchema {
[key: string]: {
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
required?: boolean;
default?: any;
sensitive?: boolean;
validation?: (value: any) => boolean;
description?: string;
};
}
export interface EncryptedConfigOptions {
environment: string;
configPath: string;
secretsPath: string;
schema?: ConfigSchema;
validateOnLoad?: boolean;
watchForChanges?: boolean;
}
export declare class EncryptedConfig {
private secretsManager;
private config;
private schema?;
private environment;
private options;
private watchers;
constructor(options: EncryptedConfigOptions);
/**
* Initialize encrypted configuration
*/
initialize(masterPassword?: string): Promise<void>;
/**
* Get configuration value
*/
get<T = any>(key: string, defaultValue?: T): Promise<T>;
/**
* Set configuration value
*/
set(key: string, value: any): Promise<void>;
/**
* Get multiple configuration values
*/
getAll(keys?: string[]): Promise<Record<string, any>>;
/**
* Update multiple configuration values
*/
setMany(values: Record<string, any>): Promise<void>;
/**
* Remove configuration value
*/
remove(key: string): Promise<boolean>;
/**
* Watch for configuration changes
*/
watch(callback: (key: string, value: any, oldValue: any) => void): void;
/**
* Unwatch configuration changes
*/
unwatch(callback: (key: string, value: any, oldValue: any) => void): void;
/**
* Validate entire configuration against schema
*/
validateConfiguration(): void;
/**
* Export configuration (excluding sensitive values)
*/
exportConfig(includeSensitive?: boolean): Promise<Record<string, any>>;
/**
* Reload configuration from storage
*/
reload(): Promise<void>;
/**
* Get configuration schema
*/
getSchema(): ConfigSchema | undefined;
/**
* Update configuration schema
*/
updateSchema(schema: ConfigSchema): void;
/**
* Check if configuration has a specific key
*/
has(key: string): Promise<boolean>;
/**
* Get configuration statistics
*/
getStats(): Promise<{
totalKeys: number;
sensitiveKeys: number;
memoryKeys: number;
secretKeys: number;
environment: string;
}>;
/**
* Load configuration from various sources
*/
private loadConfiguration;
/**
* Load configuration from environment variables
*/
private loadFromEnvironment;
/**
* Load configuration from file
*/
private loadFromFile;
/**
* Load sensitive values from secrets manager
*/
private loadSensitiveValues;
/**
* Generate secret key for configuration
*/
private getSecretKey;
/**
* Generate environment variable key
*/
private getEnvironmentKey;
/**
* Validate a configuration value against schema definition
*/
private validateValue;
/**
* Check if value matches expected type
*/
private isCorrectType;
/**
* Parse string value to correct type
*/
private parseValue;
/**
* Convert value to string for storage
*/
private stringifyValue;
/**
* Notify watchers of configuration changes
*/
private notifyWatchers;
/**
* Clean up resources
*/
stop(): Promise<void>;
}
//# sourceMappingURL=encrypted-config.d.ts.map