From 17bdae33db6fda31c510b6affcab3ff6f27c9dbd Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Wed, 13 Mar 2019 22:50:03 -0700 Subject: [PATCH] Changed http auth saving structure --- src/models/AppDefinition.ts | 11 ++++++++++- src/user/system/LoadBalancerManager.ts | 7 ++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/models/AppDefinition.ts b/src/models/AppDefinition.ts index a59bf1a..3d693b2 100644 --- a/src/models/AppDefinition.ts +++ b/src/models/AppDefinition.ts @@ -54,7 +54,6 @@ interface IAppDefinitionBase { hasPersistentData: boolean hasDefaultSubDomainSsl: boolean containerHttpPort?: number - httpBasicAuth?: string captainDefinitionRelativeFilePath: string forceSsl: boolean nodeId?: string @@ -76,6 +75,11 @@ interface IAppDef extends IAppDefinitionBase { repoInfo: RepoInfo pushWebhookToken: string } + httpAuth?: { + user: string + password?: string + passwordHashed?: string + } appName?: string isAppBuilding?: boolean } @@ -88,4 +92,9 @@ interface IAppDefSaved extends IAppDefinitionBase { pushWebhookToken: string } | undefined + + httpAuth?: { + user: string + passwordHashed?: string + } } diff --git a/src/user/system/LoadBalancerManager.ts b/src/user/system/LoadBalancerManager.ts index 7defa68..731e34a 100644 --- a/src/user/system/LoadBalancerManager.ts +++ b/src/user/system/LoadBalancerManager.ts @@ -227,7 +227,12 @@ class LoadBalancerManager { .then(function(apps) { Object.keys(apps).forEach(function(appName) { const webApp = apps[appName] - const httpBasicAuth = webApp.httpBasicAuth || '' + const httpBasicAuth = + webApp.httpAuth && webApp.httpAuth.passwordHashed // + ? webApp.httpAuth.user + + ':' + + webApp.httpAuth.passwordHashed + : '' if (webApp.notExposeAsWebApp) { return