Skip to content

Commit 094fcb1

Browse files
committed
added the text fields to Openidc defaults section
1 parent d26ecd0 commit 094fcb1

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

backend/models/proxy_host.js

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,35 @@ class ProxyHost extends Model {
2020
this.domain_names = [];
2121
}
2222

23+
// Default for openidc_allowed_users
24+
if (typeof this.openidc_allowed_users === 'undefined') {
25+
this.openidc_allowed_users = [];
26+
}
27+
2328
// Default for meta
2429
if (typeof this.meta === 'undefined') {
2530
this.meta = {};
2631
}
2732

33+
// Openidc defaults
34+
if (typeof this.openidc_auth_method === 'undefined') {
35+
this.openidc_auth_method = 'client_secret_post';
36+
}
37+
if (typeof this.openidc_redirect_uri === 'undefined') {
38+
this.openidc_redirect_uri = '';
39+
}
40+
if (typeof this.openidc_discovery === 'undefined') {
41+
this.openidc_discovery = '';
42+
}
43+
if (typeof this.openidc_client_id === 'undefined') {
44+
this.openidc_client_id = '';
45+
}
46+
if (typeof this.openidc_client_secret === 'undefined') {
47+
this.openidc_client_secret = '';
48+
}
49+
2850
this.domain_names.sort();
51+
this.openidc_allowed_users.sort();
2952
}
3053

3154
$beforeUpdate () {
@@ -35,6 +58,11 @@ class ProxyHost extends Model {
3558
if (typeof this.domain_names !== 'undefined') {
3659
this.domain_names.sort();
3760
}
61+
62+
// Sort openidc_allowed_users
63+
if (typeof this.openidc_allowed_users !== 'undefined') {
64+
this.openidc_allowed_users.sort();
65+
}
3866
}
3967

4068
static get name () {
@@ -46,7 +74,7 @@ class ProxyHost extends Model {
4674
}
4775

4876
static get jsonAttributes () {
49-
return ['domain_names', 'meta', 'locations'];
77+
return ['domain_names', 'meta', 'locations', 'openidc_allowed_users'];
5078
}
5179

5280
static get relationMappings () {
@@ -91,4 +119,4 @@ class ProxyHost extends Model {
91119
}
92120
}
93121

94-
module.exports = ProxyHost;
122+
module.exports = ProxyHost;

0 commit comments

Comments
 (0)