mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-12 16:10:30 +02:00
feat(core): Scaffold inbound-secrets module (no-changelog) (#30093)
This commit is contained in:
parent
1e685062c3
commit
0bde73c42f
|
|
@ -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',
|
||||
]);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ export class ModuleRegistry {
|
|||
'instance-version-history',
|
||||
'encryption-key-manager',
|
||||
'oauth-jwe',
|
||||
'inbound-secrets',
|
||||
];
|
||||
|
||||
private readonly activeModules: string[] = [];
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
import { Config } from '@n8n/config';
|
||||
|
||||
@Config
|
||||
export class InboundSecretsConfig {}
|
||||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user