mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat: External Secrets storage for credentials (#6477)
Github issue / Community forum post (link here to close automatically): --------- Co-authored-by: Romain Minaud <romain.minaud@gmail.com> Co-authored-by: Valya Bullions <valya@n8n.io> Co-authored-by: Csaba Tuncsik <csaba@n8n.io> Co-authored-by: Giulio Andreini <g.andreini@gmail.com> Co-authored-by: Omar Ajoue <krynble@gmail.com>
This commit is contained in:
@@ -21,6 +21,7 @@ import type {
|
||||
ExecutionStatus,
|
||||
IExecutionsSummary,
|
||||
FeatureFlags,
|
||||
INodeProperties,
|
||||
IUserSettings,
|
||||
IHttpRequestMethods,
|
||||
} from 'n8n-workflow';
|
||||
@@ -460,6 +461,13 @@ export interface IInternalHooksClass {
|
||||
onApiKeyCreated(apiKeyDeletedData: { user: User; public_api: boolean }): Promise<void>;
|
||||
onApiKeyDeleted(apiKeyDeletedData: { user: User; public_api: boolean }): Promise<void>;
|
||||
onVariableCreated(createData: { variable_type: string }): Promise<void>;
|
||||
onExternalSecretsProviderSettingsSaved(saveData: {
|
||||
user_id?: string;
|
||||
vault_type: string;
|
||||
is_valid: boolean;
|
||||
is_new: boolean;
|
||||
error_message?: string;
|
||||
}): Promise<void>;
|
||||
}
|
||||
|
||||
export interface IVersionNotificationSettings {
|
||||
@@ -779,4 +787,35 @@ export interface N8nApp {
|
||||
|
||||
export type UserSettings = Pick<User, 'id' | 'settings'>;
|
||||
|
||||
export interface SecretsProviderSettings<T = IDataObject> {
|
||||
connected: boolean;
|
||||
connectedAt: Date | null;
|
||||
settings: T;
|
||||
}
|
||||
|
||||
export interface ExternalSecretsSettings {
|
||||
[key: string]: SecretsProviderSettings;
|
||||
}
|
||||
|
||||
export type SecretsProviderState = 'initializing' | 'connected' | 'error';
|
||||
|
||||
export abstract class SecretsProvider {
|
||||
displayName: string;
|
||||
|
||||
name: string;
|
||||
|
||||
properties: INodeProperties[];
|
||||
|
||||
state: SecretsProviderState;
|
||||
|
||||
abstract init(settings: SecretsProviderSettings): Promise<void>;
|
||||
abstract connect(): Promise<void>;
|
||||
abstract disconnect(): Promise<void>;
|
||||
abstract update(): Promise<void>;
|
||||
abstract test(): Promise<[boolean] | [boolean, string]>;
|
||||
abstract getSecret(name: string): IDataObject | undefined;
|
||||
abstract hasSecret(name: string): boolean;
|
||||
abstract getSecretNames(): string[];
|
||||
}
|
||||
|
||||
export type N8nInstanceType = 'main' | 'webhook' | 'worker';
|
||||
|
||||
Reference in New Issue
Block a user