Merge branch '16678-login-tokens-lifetime-config'
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Tue, 25 Aug 2020 18:00:33 +0000 (15:00 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Tue, 25 Aug 2020 18:00:33 +0000 (15:00 -0300)
Closes #16678

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

1  2 
lib/config/config.default.yml
lib/config/export.go
lib/config/generated_config.go
sdk/go/arvados/config.go

index f84c60192f2854571292dc05c466ab40b66d71ec,c392d8638d88d424cb41b8b7b748fda934d5f8d6..6c47a068e98a4c9612e3fe55f69cd9f2d7bdac6b
@@@ -689,16 -689,6 +689,16 @@@ Clusters
          ProviderAppID: ""
          ProviderAppSecret: ""
  
 +      Test:
 +        # Authenticate users listed here in the config file. This
 +        # feature is intended to be used in test environments, and
 +        # should not be used in production.
 +        Enable: false
 +        Users:
 +          SAMPLE:
 +            Email: alice@example.com
 +            Password: xyzzy
 +
        # The cluster ID to delegate the user database.  When set,
        # logins on this cluster will be redirected to the login cluster
        # (login cluster must appear in RemoteClusters with Proxy: true)
        # remain valid before it needs to be revalidated.
        RemoteTokenRefresh: 5m
  
+       # How long a client token created from a login flow will be valid without
+       # asking the user to re-login. Example values: 60m, 8h.
+       # Default value zero means tokens don't have expiration.
+       TokenLifetime: 0s
      Git:
        # Path to git or gitolite-shell executable. Each authenticated
        # request will execute this program with the single argument "http-backend"
diff --combined lib/config/export.go
index 5cdc3dae6a11b3dd5464743aee7213a2bd5d21d6,76f00c765251693040d68242f4bb2726e1411990..b203dff26a1b80272be29f41dd747c8108beb272
@@@ -170,9 -170,7 +170,10 @@@ var whitelist = map[string]bool
        "Login.SSO.Enable":                             true,
        "Login.SSO.ProviderAppID":                      false,
        "Login.SSO.ProviderAppSecret":                  false,
 +      "Login.Test":                                   true,
 +      "Login.Test.Enable":                            true,
 +      "Login.Test.Users":                             false,
+       "Login.TokenLifetime":                          false,
        "Mail":                                         true,
        "Mail.EmailFrom":                               false,
        "Mail.IssueReporterEmailFrom":                  false,
index 25eaa7d30cd20221a1eb2330e9867d88de5cbd95,f5004667b23f077750046cd7d0a567832e4e47a8..cbb73d97b81f62f538de77d9b6a7fe563bdc49f7
@@@ -695,16 -695,6 +695,16 @@@ Clusters
          ProviderAppID: ""
          ProviderAppSecret: ""
  
 +      Test:
 +        # Authenticate users listed here in the config file. This
 +        # feature is intended to be used in test environments, and
 +        # should not be used in production.
 +        Enable: false
 +        Users:
 +          SAMPLE:
 +            Email: alice@example.com
 +            Password: xyzzy
 +
        # The cluster ID to delegate the user database.  When set,
        # logins on this cluster will be redirected to the login cluster
        # (login cluster must appear in RemoteClusters with Proxy: true)
        # remain valid before it needs to be revalidated.
        RemoteTokenRefresh: 5m
  
+       # How long a client token created from a login flow will be valid without
+       # asking the user to re-login. Example values: 60m, 8h.
+       # Default value zero means tokens don't have expiration.
+       TokenLifetime: 0s
      Git:
        # Path to git or gitolite-shell executable. Each authenticated
        # request will execute this program with the single argument "http-backend"
diff --combined sdk/go/arvados/config.go
index c87f880e5e56365e4bbec06c211a72cee9e0ee7c,86673320da3c41fc394fc8381e0221a47fd2e436..d98ffd18ed154c6882eb64c16f3af47bbc8c4b94
@@@ -177,12 -177,9 +177,13 @@@ type Cluster struct 
                        ProviderAppID     string
                        ProviderAppSecret string
                }
 +              Test struct {
 +                      Enable bool
 +                      Users  map[string]TestUser
 +              }
                LoginCluster       string
                RemoteTokenRefresh Duration
+               TokenLifetime      Duration
        }
        Mail struct {
                MailchimpAPIKey                string
@@@ -334,11 -331,6 +335,11 @@@ type Service struct 
        ExternalURL  URL
  }
  
 +type TestUser struct {
 +      Email    string
 +      Password string
 +}
 +
  // URL is a url.URL that is also usable as a JSON key/value.
  type URL url.URL