feat(core): Scaffold inbound-secrets module (no-changelog) (#30093)

This commit is contained in:
Andreas Fitzek 2026-05-12 10:03:29 +02:00 committed by GitHub
parent 1e685062c3
commit 0bde73c42f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 50 additions and 0 deletions

View File

@ -44,6 +44,7 @@ describe('eligibleModules', () => {
'instance-version-history',
'encryption-key-manager',
'oauth-jwe',
'inbound-secrets',
]);
});
@ -74,6 +75,7 @@ describe('eligibleModules', () => {
'instance-version-history',
'encryption-key-manager',
'oauth-jwe',
'inbound-secrets',
'instance-ai',
]);
});

View File

@ -55,6 +55,7 @@ export class ModuleRegistry {
'instance-version-history',
'encryption-key-manager',
'oauth-jwe',
'inbound-secrets',
];
private readonly activeModules: string[] = [];

View File

@ -30,6 +30,7 @@ export const MODULE_NAMES = [
'instance-version-history',
'encryption-key-manager',
'oauth-jwe',
'inbound-secrets',
] as const;
export type ModuleName = (typeof MODULE_NAMES)[number];

View File

@ -0,0 +1,27 @@
import { Container } from '@n8n/di';
import { InboundSecretsModule } from '../inbound-secrets.module';
describe('InboundSecretsModule', () => {
let module: InboundSecretsModule;
beforeEach(() => {
Container.reset();
module = new InboundSecretsModule();
});
afterEach(() => {
delete process.env.N8N_ENV_FEAT_INBOUND_SECRETS;
});
describe('init', () => {
it('is a no-op when the feature flag is off', async () => {
await expect(module.init()).resolves.toBeUndefined();
});
it('loads without error when the feature flag is on', async () => {
process.env.N8N_ENV_FEAT_INBOUND_SECRETS = 'true';
await expect(module.init()).resolves.toBeUndefined();
});
});
});

View File

@ -0,0 +1,4 @@
import { Config } from '@n8n/config';
@Config
export class InboundSecretsConfig {}

View File

@ -0,0 +1,15 @@
import type { ModuleInterface } from '@n8n/decorators';
import { BackendModule } from '@n8n/decorators';
function isFeatureFlagEnabled(): boolean {
return process.env.N8N_ENV_FEAT_INBOUND_SECRETS === 'true';
}
@BackendModule({ name: 'inbound-secrets' })
export class InboundSecretsModule implements ModuleInterface {
async init() {
if (!isFeatureFlagEnabled()) return;
await import('./inbound-secrets.config');
}
}