[ARVADOS] updated: 1.3.0-2907-g658f6be33
Git user
git at public.arvados.org
Thu Aug 20 14:35:18 UTC 2020
Summary of changes:
lib/config/export.go | 3 +++
lib/controller/localdb/login.go | 28 +++++++++++++++++++++-------
2 files changed, 24 insertions(+), 7 deletions(-)
via 658f6be33e100b4cefd3ca7c332fe13970d6a245 (commit)
via e5533f58701d271b7362ac2527f925402b0be1b0 (commit)
from 20cea53c48260a0cec3d588c2af520b27433b8c1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 658f6be33e100b4cefd3ca7c332fe13970d6a245
Author: Tom Clegg <tom at tomclegg.ca>
Date: Thu Aug 20 10:32:41 2020 -0400
16314: Clean up long bool expressions.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>
diff --git a/lib/controller/localdb/login.go b/lib/controller/localdb/login.go
index 34da4933a..126741484 100644
--- a/lib/controller/localdb/login.go
+++ b/lib/controller/localdb/login.go
@@ -35,7 +35,11 @@ func chooseLoginController(cluster *arvados.Cluster, railsProxy *railsProxy) log
wantLDAP := cluster.Login.LDAP.Enable
wantTest := cluster.Login.Test.Enable
switch {
- case wantGoogle && !wantOpenIDConnect && !wantSSO && !wantPAM && !wantLDAP && !wantTest:
+ case 1 != countTrue(wantGoogle, wantOpenIDConnect, wantSSO, wantPAM, wantLDAP, wantTest):
+ return errorLoginController{
+ error: errors.New("configuration problem: exactly one of Login.Google, Login.OpenIDConnect, Login.SSO, Login.PAM, Login.LDAP, and Login.Test must be enabled"),
+ }
+ case wantGoogle:
return &oidcLoginController{
Cluster: cluster,
RailsProxy: railsProxy,
@@ -46,7 +50,7 @@ func chooseLoginController(cluster *arvados.Cluster, railsProxy *railsProxy) log
EmailClaim: "email",
EmailVerifiedClaim: "email_verified",
}
- case !wantGoogle && wantOpenIDConnect && !wantSSO && !wantPAM && !wantLDAP && !wantTest:
+ case wantOpenIDConnect:
return &oidcLoginController{
Cluster: cluster,
RailsProxy: railsProxy,
@@ -57,19 +61,29 @@ func chooseLoginController(cluster *arvados.Cluster, railsProxy *railsProxy) log
EmailVerifiedClaim: cluster.Login.OpenIDConnect.EmailVerifiedClaim,
UsernameClaim: cluster.Login.OpenIDConnect.UsernameClaim,
}
- case !wantGoogle && !wantOpenIDConnect && wantSSO && !wantPAM && !wantLDAP && !wantTest:
+ case wantSSO:
return &ssoLoginController{railsProxy}
- case !wantGoogle && !wantOpenIDConnect && !wantSSO && wantPAM && !wantLDAP && !wantTest:
+ case wantPAM:
return &pamLoginController{Cluster: cluster, RailsProxy: railsProxy}
- case !wantGoogle && !wantOpenIDConnect && !wantSSO && !wantPAM && wantLDAP && !wantTest:
+ case wantLDAP:
return &ldapLoginController{Cluster: cluster, RailsProxy: railsProxy}
- case !wantGoogle && !wantOpenIDConnect && !wantSSO && !wantPAM && !wantLDAP && wantTest:
+ case wantTest:
return &testLoginController{Cluster: cluster, RailsProxy: railsProxy}
default:
return errorLoginController{
- error: errors.New("configuration problem: exactly one of Login.Google, Login.OpenIDConnect, Login.SSO, Login.PAM, Login.LDAP, and Login.Test must be enabled"),
+ error: errors.New("BUG: missing case in login controller setup switch"),
+ }
+ }
+}
+
+func countTrue(vals ...bool) int {
+ n := 0
+ for _, val := range vals {
+ if val {
+ n++
}
}
+ return n
}
// Login and Logout are passed through to the wrapped railsProxy;
commit e5533f58701d271b7362ac2527f925402b0be1b0
Author: Tom Clegg <tom at tomclegg.ca>
Date: Thu Aug 20 10:26:29 2020 -0400
16314: Export Login.Test.Enable config.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>
diff --git a/lib/config/export.go b/lib/config/export.go
index d6b02b750..251415f71 100644
--- a/lib/config/export.go
+++ b/lib/config/export.go
@@ -169,6 +169,9 @@ var whitelist = map[string]bool{
"Login.SSO.ProviderAppID": false,
"Login.SSO.ProviderAppSecret": false,
"Login.RemoteTokenRefresh": true,
+ "Login.Test": true,
+ "Login.Test.Enable": true,
+ "Login.Test.Users": false,
"Mail": true,
"Mail.MailchimpAPIKey": false,
"Mail.MailchimpListID": false,
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list