mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor(core): Load and validate all config at startup (no-changelog) (#5283)
This commit is contained in:
committed by
GitHub
parent
b2f59c3f39
commit
72249e0de8
@@ -1,18 +1,15 @@
|
||||
import config from '@/config';
|
||||
import type { ICredentialDataDecryptedObject, ICredentialTypes } from 'n8n-workflow';
|
||||
import { deepCopy, LoggerProxy as Logger, jsonParse } from 'n8n-workflow';
|
||||
import type { ICredentialsOverwrite } from '@/Interfaces';
|
||||
import * as GenericHelpers from '@/GenericHelpers';
|
||||
|
||||
class CredentialsOverwritesClass {
|
||||
private overwriteData: ICredentialsOverwrite = {};
|
||||
|
||||
private resolvedTypes: string[] = [];
|
||||
|
||||
constructor(private credentialTypes: ICredentialTypes) {}
|
||||
|
||||
async init() {
|
||||
const data = (await GenericHelpers.getConfigValue('credentials.overwrite.data')) as string;
|
||||
|
||||
constructor(private credentialTypes: ICredentialTypes) {
|
||||
const data = config.getEnv('credentials.overwrite.data');
|
||||
const overwriteData = jsonParse<ICredentialsOverwrite>(data, {
|
||||
errorMessage: 'The credentials-overwrite is not valid JSON.',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user