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:
@@ -1,3 +1,4 @@
|
||||
import { EXTERNAL_SECRETS_DB_KEY } from '@/ExternalSecrets/constants';
|
||||
import { Service } from 'typedi';
|
||||
import { DataSource, Repository } from 'typeorm';
|
||||
import { ErrorReporterProxy as ErrorReporter } from 'n8n-workflow';
|
||||
@@ -10,6 +11,21 @@ export class SettingsRepository extends Repository<Settings> {
|
||||
super(Settings, dataSource.manager);
|
||||
}
|
||||
|
||||
async getEncryptedSecretsProviderSettings(): Promise<string | null> {
|
||||
return (await this.findOne({ where: { key: EXTERNAL_SECRETS_DB_KEY } }))?.value ?? null;
|
||||
}
|
||||
|
||||
async saveEncryptedSecretsProviderSettings(data: string): Promise<void> {
|
||||
await this.upsert(
|
||||
{
|
||||
key: EXTERNAL_SECRETS_DB_KEY,
|
||||
value: data,
|
||||
loadOnStartup: false,
|
||||
},
|
||||
['key'],
|
||||
);
|
||||
}
|
||||
|
||||
async dismissBanner({ bannerName }: { bannerName: string }): Promise<{ success: boolean }> {
|
||||
const key = 'ui.banners.dismissed';
|
||||
const dismissedBannersSetting = await this.findOneBy({ key });
|
||||
|
||||
Reference in New Issue
Block a user