14812: Fix lib/config tests
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Tue, 2 Jul 2019 17:42:17 +0000 (13:42 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Tue, 2 Jul 2019 17:42:17 +0000 (13:42 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

apps/workbench/config/arvados_config.rb
build/run-tests.sh
lib/config/config.default.yml
lib/config/export.go
lib/config/generated_config.go
sdk/go/arvados/config.go

index d571cda09a1084db52070035345ac11b0e77c843..baceff50164a7895758a0fd8a991245d3f9fce4e 100644 (file)
@@ -19,14 +19,6 @@ require 'config_loader'
 require 'config_validators'
 require 'open3'
 
-begin
-  # If secret_token.rb exists here, we need to load it first.
-  require_relative 'secret_token.rb'
-rescue LoadError
-  # Normally secret_token.rb is missing and the secret token is
-  # configured by application.yml (i.e., here!) instead.
-end
-
 # Load the defaults, used by config:migrate and fallback loading
 # legacy application.yml
 Open3.popen2("arvados-server", "config-defaults") do |stdin, stdout, status_thread|
@@ -93,7 +85,6 @@ arvcfg.declare_config "Services.Workbench2.ExternalURL", URI, :workbench2_url
 
 arvcfg.declare_config "Users.AnonymousUserToken", String, :anonymous_user_token
 
-arvcfg.declare_config "Workbench.SecretToken", String, :secret_token
 arvcfg.declare_config "Workbench.SecretKeyBase", String, :secret_key_base
 
 arvcfg.declare_config "Workbench.ApplicationMimetypesWithViewIcon", Hash, :application_mimetypes_with_view_icon, ->(cfg, k, v) {
index 143320c48915c04707baadfbcf52e1427bb1573b..6572765b9acb70c4df243be32ee4213cd9146090 100755 (executable)
@@ -988,7 +988,7 @@ pythonstuff=(
 )
 
 declare -a gostuff
-gostuff=($(git grep -lw func | grep \\.go | sed -e 's/\/[^\/]*$//' | sort -u))
+gostuff=($(cd "$WORKSPACE" && git grep -lw func | grep \\.go | sed -e 's/\/[^\/]*$//' | sort -u))
 
 install_apps/workbench() {
     cd "$WORKSPACE/apps/workbench" \
index 8137998277deb6f6084ec4b467b257eefd957710..f17c13d2a97da69802ac1a25e5cbce473cf65198 100644 (file)
@@ -666,24 +666,23 @@ Clusters:
       ShowUserAgreementInline: false
       SecretKeyBase: ""
       RepositoryCache: /var/www/arvados-workbench/current/tmp/git
-      UserProfileFormFields:
-        SAMPLE:
-          exampleTextValue:  # key that will be set in properties
-            Type: text  #
-            FormFieldTitle: ""
-            FormFieldDescription: ""
-            Required: true
-            Position: 1
-          exampleOptionsValue:
-            Type: select
-            FormFieldTitle: ""
-            FormFieldDescription: ""
-            Required: true
-            Position: 1
-            Options:
-              red: {}
-              blue: {}
-              yellow: {}
+      UserProfileFormFields: {}
+          # exampleTextValue:  # key that will be set in properties
+          #   Type: text  #
+          #   FormFieldTitle: ""
+          #   FormFieldDescription: ""
+          #   Required: true
+          #   Position: 1
+          # exampleOptionsValue:
+          #   Type: select
+          #   FormFieldTitle: ""
+          #   FormFieldDescription: ""
+          #   Required: true
+          #   Position: 1
+          #   Options:
+          #     red: {}
+          #     blue: {}
+          #     yellow: {}
       UserProfileFormMessage: 'Welcome to Arvados. All <span style="color:red">required fields</span> must be completed before you can proceed.'
 
       # Mimetypes of applications for which the view icon
index faf542e6f773c6192779c7aa4dbb5ed0675fe0c5..0eb573609329de8a6dee46ebefff5504632f30ab 100644 (file)
@@ -55,77 +55,116 @@ func ExportJSON(w io.Writer, cluster *arvados.Cluster) error {
 // exists.
 var whitelist = map[string]bool{
        // | sort -t'"' -k2,2
-       "API":                                        true,
-       "API.AsyncPermissionsUpdateInterval":         false,
-       "API.DisabledAPIs":                           false,
-       "API.MaxIndexDatabaseRead":                   false,
-       "API.MaxItemsPerResponse":                    true,
-       "API.MaxRequestAmplification":                false,
-       "API.MaxRequestSize":                         true,
-       "API.RailsSessionSecretToken":                false,
-       "API.RequestTimeout":                         true,
-       "AuditLogs":                                  false,
-       "AuditLogs.MaxAge":                           false,
-       "AuditLogs.MaxDeleteBatch":                   false,
-       "AuditLogs.UnloggedAttributes":               false,
-       "Collections":                                true,
-       "Collections.BlobSigning":                    true,
-       "Collections.BlobSigningKey":                 false,
-       "Collections.BlobSigningTTL":                 true,
-       "Collections.CollectionVersioning":           false,
-       "Collections.DefaultReplication":             true,
-       "Collections.DefaultTrashLifetime":           true,
-       "Collections.ManagedProperties":              true,
-       "Collections.ManagedProperties.*":            true,
-       "Collections.ManagedProperties.*.*":          true,
-       "Collections.PreserveVersionIfIdle":          true,
-       "Collections.TrashSweepInterval":             false,
-       "Containers":                                 true,
-       "Containers.CloudVMs":                        false,
-       "Containers.DefaultKeepCacheRAM":             true,
-       "Containers.DispatchPrivateKey":              false,
-       "Containers.JobsAPI":                         true,
-       "Containers.JobsAPI.CrunchJobUser":           false,
-       "Containers.JobsAPI.CrunchJobWrapper":        false,
-       "Containers.JobsAPI.CrunchRefreshTrigger":    false,
-       "Containers.JobsAPI.DefaultDockerImage":      false,
-       "Containers.JobsAPI.Enable":                  true,
-       "Containers.JobsAPI.GitInternalDir":          false,
-       "Containers.JobsAPI.ReuseJobIfOutputsDiffer": false,
-       "Containers.Logging":                         false,
-       "Containers.LogReuseDecisions":               false,
-       "Containers.MaxComputeVMs":                   false,
-       "Containers.MaxDispatchAttempts":             false,
-       "Containers.MaxRetryAttempts":                true,
-       "Containers.SLURM":                           false,
-       "Containers.StaleLockTimeout":                false,
-       "Containers.SupportedDockerImageFormats":     true,
-       "Containers.UsePreemptibleInstances":         true,
-       "EnableBetaController14287":                  false,
-       "Git":                                        false,
-       "InstanceTypes":                              true,
-       "InstanceTypes.*":                            true,
-       "InstanceTypes.*.*":                          true,
-       "Login":                                      false,
-       "Mail":                                       false,
-       "ManagementToken":                            false,
-       "PostgreSQL":                                 false,
-       "RemoteClusters":                             true,
-       "RemoteClusters.*":                           true,
-       "RemoteClusters.*.ActivateUsers":             true,
-       "RemoteClusters.*.Host":                      true,
-       "RemoteClusters.*.Insecure":                  true,
-       "RemoteClusters.*.Proxy":                     true,
-       "RemoteClusters.*.Scheme":                    true,
-       "Services":                                   true,
-       "Services.*":                                 true,
-       "Services.*.ExternalURL":                     true,
-       "Services.*.InternalURLs":                    false,
-       "SystemLogs":                                 false,
-       "SystemRootToken":                            false,
-       "TLS":                                        false,
-       "Users":                                      false,
-       "Workbench":                                  false,
+       "API":                                         true,
+       "API.AsyncPermissionsUpdateInterval":          false,
+       "API.DisabledAPIs":                            false,
+       "API.MaxIndexDatabaseRead":                    false,
+       "API.MaxItemsPerResponse":                     true,
+       "API.MaxRequestAmplification":                 false,
+       "API.MaxRequestSize":                          true,
+       "API.RailsSessionSecretToken":                 false,
+       "API.RequestTimeout":                          true,
+       "AuditLogs":                                   false,
+       "AuditLogs.MaxAge":                            false,
+       "AuditLogs.MaxDeleteBatch":                    false,
+       "AuditLogs.UnloggedAttributes":                false,
+       "Collections":                                 true,
+       "Collections.BlobSigning":                     true,
+       "Collections.BlobSigningKey":                  false,
+       "Collections.BlobSigningTTL":                  true,
+       "Collections.CollectionVersioning":            false,
+       "Collections.DefaultReplication":              true,
+       "Collections.DefaultTrashLifetime":            true,
+       "Collections.ManagedProperties":               true,
+       "Collections.ManagedProperties.*":             true,
+       "Collections.ManagedProperties.*.*":           true,
+       "Collections.PreserveVersionIfIdle":           true,
+       "Collections.TrashSweepInterval":              false,
+       "Containers":                                  true,
+       "Containers.CloudVMs":                         false,
+       "Containers.DefaultKeepCacheRAM":              true,
+       "Containers.DispatchPrivateKey":               false,
+       "Containers.JobsAPI":                          true,
+       "Containers.JobsAPI.CrunchJobUser":            false,
+       "Containers.JobsAPI.CrunchJobWrapper":         false,
+       "Containers.JobsAPI.CrunchRefreshTrigger":     false,
+       "Containers.JobsAPI.DefaultDockerImage":       false,
+       "Containers.JobsAPI.Enable":                   true,
+       "Containers.JobsAPI.GitInternalDir":           false,
+       "Containers.JobsAPI.ReuseJobIfOutputsDiffer":  false,
+       "Containers.Logging":                          false,
+       "Containers.LogReuseDecisions":                false,
+       "Containers.MaxComputeVMs":                    false,
+       "Containers.MaxDispatchAttempts":              false,
+       "Containers.MaxRetryAttempts":                 true,
+       "Containers.SLURM":                            false,
+       "Containers.StaleLockTimeout":                 false,
+       "Containers.SupportedDockerImageFormats":      true,
+       "Containers.UsePreemptibleInstances":          true,
+       "EnableBetaController14287":                   false,
+       "Git":                                         false,
+       "InstanceTypes":                               true,
+       "InstanceTypes.*":                             true,
+       "InstanceTypes.*.*":                           true,
+       "Login":                                       false,
+       "Mail":                                        false,
+       "ManagementToken":                             false,
+       "PostgreSQL":                                  false,
+       "RemoteClusters":                              true,
+       "RemoteClusters.*":                            true,
+       "RemoteClusters.*.ActivateUsers":              true,
+       "RemoteClusters.*.Host":                       true,
+       "RemoteClusters.*.Insecure":                   true,
+       "RemoteClusters.*.Proxy":                      true,
+       "RemoteClusters.*.Scheme":                     true,
+       "Services":                                    true,
+       "Services.*":                                  true,
+       "Services.*.ExternalURL":                      true,
+       "Services.*.InternalURLs":                     false,
+       "SystemLogs":                                  false,
+       "SystemRootToken":                             false,
+       "TLS":                                         false,
+       "Users":                                       true,
+       "Users.AnonymousUserToken":                    true,
+       "Users.AdminNotifierEmailFrom":                false,
+       "Users.AutoAdminFirstUser":                    false,
+       "Users.AutoAdminUserWithEmail":                false,
+       "Users.AutoSetupNewUsers":                     false,
+       "Users.AutoSetupNewUsersWithRepository":       false,
+       "Users.AutoSetupNewUsersWithVmUUID":           false,
+       "Users.AutoSetupUsernameBlacklist":            false,
+       "Users.EmailSubjectPrefix":                    false,
+       "Users.NewInactiveUserNotificationRecipients": false,
+       "Users.NewUserNotificationRecipients":         false,
+       "Users.NewUsersAreActive":                     false,
+       "Users.UserNotifierEmailFrom":                 false,
+       "Users.UserProfileNotificationAddress":        false,
+       "Workbench":                                   true,
+       "Workbench.ActivationContactLink":             false,
+       "Workbench.APIClientConnectTimeout":           true,
+       "Workbench.APIClientReceiveTimeout":           true,
+       "Workbench.APIResponseCompression":            false,
+       "Workbench.ApplicationMimetypesWithViewIcon":  false,
+       "Workbench.ArvadosDocsite":                    true,
+       "Workbench.ArvadosPublicDataDocURL":           true,
+       "Workbench.EnableGettingStartedPopup":         true,
+       "Workbench.EnablePublicProjectsPage":          true,
+       "Workbench.FileViewersConfigURL":              true,
+       "Workbench.LogViewerMaxBytes":                 true,
+       "Workbench.MultiSiteSearch":                   true,
+       "Workbench.Repositories":                      false,
+       "Workbench.RepositoryCache":                   false,
+       "Workbench.RunningJobLogRecordsToFetch":       true,
+       "Workbench.SecretKeyBase":                     false,
+       "Workbench.ShowRecentCollectionsOnDashboard":  true,
+       "Workbench.ShowUserAgreementInline":           false,
+       "Workbench.ShowUserNotifications":             false,
+       "Workbench.SiteName":                          true,
+       "Workbench.Theme":                             true,
+       "Workbench.TrustAllContent":                   false,
+       "Workbench.UserProfileFormFields":             true,
+       "Workbench.UserProfileFormMessage":            true,
+       "Workbench.VocabularyURL":                     true,
 }
 
 func redactUnsafe(m map[string]interface{}, mPrefix, lookupPrefix string) error {
index ba576ee5b9b9cc819a666ba10ef82f935b445aa0..1bb046ff9540efa341986f664cbdaccd3173d5c2 100644 (file)
@@ -672,24 +672,23 @@ Clusters:
       ShowUserAgreementInline: false
       SecretKeyBase: ""
       RepositoryCache: /var/www/arvados-workbench/current/tmp/git
-      UserProfileFormFields:
-        SAMPLE:
-          exampleTextValue:  # key that will be set in properties
-            Type: text  #
-            FormFieldTitle: ""
-            FormFieldDescription: ""
-            Required: true
-            Position: 1
-          exampleOptionsValue:
-            Type: select
-            FormFieldTitle: ""
-            FormFieldDescription: ""
-            Required: true
-            Position: 1
-            Options:
-              red: {}
-              blue: {}
-              yellow: {}
+      UserProfileFormFields: {}
+          # exampleTextValue:  # key that will be set in properties
+          #   Type: text  #
+          #   FormFieldTitle: ""
+          #   FormFieldDescription: ""
+          #   Required: true
+          #   Position: 1
+          # exampleOptionsValue:
+          #   Type: select
+          #   FormFieldTitle: ""
+          #   FormFieldDescription: ""
+          #   Required: true
+          #   Position: 1
+          #   Options:
+          #     red: {}
+          #     blue: {}
+          #     yellow: {}
       UserProfileFormMessage: 'Welcome to Arvados. All <span style="color:red">required fields</span> must be completed before you can proceed.'
 
       # Mimetypes of applications for which the view icon
index 2165e87f520bc5a16fc3af4b0abc7d4c40c3b5dd..943e0a07ade24aeefe2530b1c09c218956d151b0 100644 (file)
@@ -113,6 +113,7 @@ type Cluster struct {
                Insecure    bool
        }
        Users struct {
+               AnonymousUserToken                    string
                AdminNotifierEmailFrom                string
                AutoAdminFirstUser                    bool
                AutoAdminUserWithEmail                string
@@ -144,12 +145,12 @@ type Cluster struct {
                RepositoryCache                  string
                RunningJobLogRecordsToFetch      int
                SecretKeyBase                    string
-               SecretToken                      string
                ShowRecentCollectionsOnDashboard bool
                ShowUserAgreementInline          bool
                ShowUserNotifications            bool
                SiteName                         string
                Theme                            string
+               TrustAllContent                  bool
                UserProfileFormFields            map[string]struct {
                        Type                 string
                        FormFieldTitle       string