Make it possible to open endpoints

This commit is contained in:
Jan Oberhauser
2020-09-23 14:14:31 +02:00
parent 395fe69bd3
commit 3374fda7c6
2 changed files with 13 additions and 2 deletions

View File

@@ -172,8 +172,13 @@ class App {
async config(): Promise<void> {
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
const basicAuthActive = config.get('security.basicAuth.active') as boolean;