mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Make it possible to open endpoints
This commit is contained in:
parent
395fe69bd3
commit
3374fda7c6
|
@ -300,6 +300,12 @@ const config = convict({
|
||||||
},
|
},
|
||||||
|
|
||||||
security: {
|
security: {
|
||||||
|
excludeEndpoints: {
|
||||||
|
doc: 'Additional endpoints to exclude auth checks. Multiple endpoints can be separated by colon (":")',
|
||||||
|
format: String,
|
||||||
|
default: '',
|
||||||
|
env: 'N8N_AUTH_EXCLUDE_ENDPOINTS'
|
||||||
|
},
|
||||||
basicAuth: {
|
basicAuth: {
|
||||||
active: {
|
active: {
|
||||||
format: 'Boolean',
|
format: 'Boolean',
|
||||||
|
|
|
@ -172,8 +172,13 @@ class App {
|
||||||
async config(): Promise<void> {
|
async config(): Promise<void> {
|
||||||
|
|
||||||
this.versions = await GenericHelpers.getVersions();
|
this.versions = await GenericHelpers.getVersions();
|
||||||
const ignoredEndpoints = _(['healthz', this.endpointWebhook, this.endpointWebhookTest, this.endpointPresetCredentials]).compact().join('|');
|
|
||||||
const authIgnoreRegex = new RegExp(`^\/(${ignoredEndpoints})\/?.*$`);
|
const excludeEndpoints = config.get('security.excludeEndpoints') as string;
|
||||||
|
|
||||||
|
const ignoredEndpoints = ['healthz', this.endpointWebhook, this.endpointWebhookTest, this.endpointPresetCredentials];
|
||||||
|
ignoredEndpoints.push.apply(ignoredEndpoints, excludeEndpoints.split(':'));
|
||||||
|
|
||||||
|
const authIgnoreRegex = new RegExp(`^\/(${_(ignoredEndpoints).compact().join('|')})\/?.*$`);
|
||||||
|
|
||||||
// Check for basic auth credentials if activated
|
// Check for basic auth credentials if activated
|
||||||
const basicAuthActive = config.get('security.basicAuth.active') as boolean;
|
const basicAuthActive = config.get('security.basicAuth.active') as boolean;
|
||||||
|
|
Loading…
Reference in a new issue