From: Peter Amstutz Date: Wed, 30 Jun 2021 19:49:01 +0000 (-0400) Subject: Merge branch '17464-download-activity' refs #17464 X-Git-Tag: 2.3.0~167 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/c89213f5a5e303050caaebe4f8fdf2980fc65605 Merge branch '17464-download-activity' refs #17464 Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- c89213f5a5e303050caaebe4f8fdf2980fc65605 diff --cc lib/config/config.default.yml index 645da56718,ff2f649fac..e28d5cbb7f --- a/lib/config/config.default.yml +++ b/lib/config/config.default.yml @@@ -551,8 -554,36 +551,36 @@@ Clusters # Persistent sessions. MaxSessions: 100 + # Selectively set permissions for regular users and admins to + # download or upload data files using the upload/download + # features for Workbench, WebDAV and S3 API support. + WebDAVPermission: + User: + Download: true + Upload: true + Admin: + Download: true + Upload: true + + # Selectively set permissions for regular users and admins to be + # able to download or upload blocks using arv-put and + # arv-get from outside the cluster. + KeepproxyPermission: + User: + Download: true + Upload: true + Admin: + Download: true + Upload: true + + # Post upload / download events to the API server logs table, so + # that they can be included in the arv-user-activity report. + # You can disable this if you find that it is creating excess + # load on the API server and you don't need it. + WebDAVLogEvents: true + Login: - # One of the following mechanisms (SSO, Google, PAM, LDAP, or + # One of the following mechanisms (Google, PAM, LDAP, or # LoginCluster) should be enabled; see # https://doc.arvados.org/install/setup-login.html diff --cc lib/config/generated_config.go index 1bdc269c08,34cc07115a..b15bf7eebc --- a/lib/config/generated_config.go +++ b/lib/config/generated_config.go @@@ -557,8 -560,36 +557,36 @@@ Clusters # Persistent sessions. MaxSessions: 100 + # Selectively set permissions for regular users and admins to + # download or upload data files using the upload/download + # features for Workbench, WebDAV and S3 API support. + WebDAVPermission: + User: + Download: true + Upload: true + Admin: + Download: true + Upload: true + + # Selectively set permissions for regular users and admins to be + # able to download or upload blocks using arv-put and + # arv-get from outside the cluster. + KeepproxyPermission: + User: + Download: true + Upload: true + Admin: + Download: true + Upload: true + + # Post upload / download events to the API server logs table, so + # that they can be included in the arv-user-activity report. + # You can disable this if you find that it is creating excess + # load on the API server and you don't need it. + WebDAVLogEvents: true + Login: - # One of the following mechanisms (SSO, Google, PAM, LDAP, or + # One of the following mechanisms (Google, PAM, LDAP, or # LoginCluster) should be enabled; see # https://doc.arvados.org/install/setup-login.html diff --cc services/keepproxy/keepproxy_test.go index c569a05e74,9dc07ddaa0..2d4266d8d5 --- a/services/keepproxy/keepproxy_test.go +++ b/services/keepproxy/keepproxy_test.go @@@ -228,30 -236,8 +236,30 @@@ func (s *ServerRequiredSuite) TestStora c.Check(hdr.Get("X-Keep-Storage-Classes"), Equals, "secure") } +func (s *ServerRequiredSuite) TestStorageClassesConfirmedHeader(c *C) { + runProxy(c, false, false) + defer closeListener() + + content := []byte("foo") + hash := fmt.Sprintf("%x", md5.Sum(content)) + client := &http.Client{} + + req, err := http.NewRequest("PUT", + fmt.Sprintf("http://%s/%s", listener.Addr().String(), hash), + bytes.NewReader(content)) + c.Assert(err, IsNil) + req.Header.Set("X-Keep-Storage-Classes", "default") + req.Header.Set("Authorization", "OAuth2 "+arvadostest.ActiveToken) + req.Header.Set("Content-Type", "application/octet-stream") + + resp, err := client.Do(req) + c.Assert(err, IsNil) + c.Assert(resp.StatusCode, Equals, http.StatusOK) + c.Assert(resp.Header.Get("X-Keep-Storage-Classes-Confirmed"), Equals, "default=2") +} + func (s *ServerRequiredSuite) TestDesiredReplicas(c *C) { - kc := runProxy(c, false, false) + kc, _ := runProxy(c, false, false, nil) defer closeListener() content := []byte("TestDesiredReplicas")