From 094fcb125ca9b0608689e1b222a165713e8ac2cd Mon Sep 17 00:00:00 2001 From: baudneo <86508179+baudneo@users.noreply.github.com> Date: Sun, 30 Oct 2022 19:07:16 -0600 Subject: [PATCH] added the text fields to Openidc defaults section --- backend/models/proxy_host.js | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/backend/models/proxy_host.js b/backend/models/proxy_host.js index a7583088..7144d5f1 100644 --- a/backend/models/proxy_host.js +++ b/backend/models/proxy_host.js @@ -20,12 +20,35 @@ class ProxyHost extends Model { this.domain_names = []; } + // Default for openidc_allowed_users + if (typeof this.openidc_allowed_users === 'undefined') { + this.openidc_allowed_users = []; + } + // Default for meta if (typeof this.meta === 'undefined') { this.meta = {}; } + // Openidc defaults + if (typeof this.openidc_auth_method === 'undefined') { + this.openidc_auth_method = 'client_secret_post'; + } + if (typeof this.openidc_redirect_uri === 'undefined') { + this.openidc_redirect_uri = ''; + } + if (typeof this.openidc_discovery === 'undefined') { + this.openidc_discovery = ''; + } + if (typeof this.openidc_client_id === 'undefined') { + this.openidc_client_id = ''; + } + if (typeof this.openidc_client_secret === 'undefined') { + this.openidc_client_secret = ''; + } + this.domain_names.sort(); + this.openidc_allowed_users.sort(); } $beforeUpdate () { @@ -35,6 +58,11 @@ class ProxyHost extends Model { if (typeof this.domain_names !== 'undefined') { this.domain_names.sort(); } + + // Sort openidc_allowed_users + if (typeof this.openidc_allowed_users !== 'undefined') { + this.openidc_allowed_users.sort(); + } } static get name () { @@ -46,7 +74,7 @@ class ProxyHost extends Model { } static get jsonAttributes () { - return ['domain_names', 'meta', 'locations']; + return ['domain_names', 'meta', 'locations', 'openidc_allowed_users']; } static get relationMappings () { @@ -91,4 +119,4 @@ class ProxyHost extends Model { } } -module.exports = ProxyHost; +module.exports = ProxyHost; \ No newline at end of file