From 573aa6b9ab6676426254195ffbb176f524aea862 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Thu, 4 Mar 2021 12:22:04 +0100 Subject: [PATCH 1/5] Stubs for storage spaces manipulation and make sql janitor configureable --- changelog/unreleased/storage-space-stubs.md | 7 ++ go.mod | 2 +- go.sum | 2 + .../grpc/services/gateway/storageprovider.go | 89 +++++++++++++++++++ .../publicstorageprovider.go | 16 ++++ .../storageprovider/storageprovider.go | 23 +++++ pkg/cbox/group/rest/rest.go | 17 ++-- pkg/cbox/publicshare/sql/sql.go | 23 +++-- pkg/cbox/utils/conversions.go | 4 +- 9 files changed, 161 insertions(+), 22 deletions(-) create mode 100644 changelog/unreleased/storage-space-stubs.md diff --git a/changelog/unreleased/storage-space-stubs.md b/changelog/unreleased/storage-space-stubs.md new file mode 100644 index 0000000000..7169bd263b --- /dev/null +++ b/changelog/unreleased/storage-space-stubs.md @@ -0,0 +1,7 @@ +Enhancement: Add stubs for storage spaces manipulation + +This PR adds stubs for the storage space CRUD methods in the storageprovider +service and makes the expired shares janitor configureable in the publicshares +SQL driver. + +https://github.com/cs3org/reva/pull/1513 diff --git a/go.mod b/go.mod index fb627220c7..06c9337267 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/cheggaaa/pb v1.0.29 github.com/coreos/go-oidc v2.2.1+incompatible github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e - github.com/cs3org/go-cs3apis v0.0.0-20210209082852-35ace33082f5 + github.com/cs3org/go-cs3apis v0.0.0-20210209091240-d16c30974508 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/eventials/go-tus v0.0.0-20200718001131-45c7ec8f5d59 github.com/go-ldap/ldap/v3 v3.2.4 diff --git a/go.sum b/go.sum index 0b71f2fb43..5eba5e5aef 100644 --- a/go.sum +++ b/go.sum @@ -130,6 +130,8 @@ github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e h1:tqSPWQeueWTKnJVMJff github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e/go.mod h1:XJEZ3/EQuI3BXTp/6DUzFr850vlxq11I6satRtz0YQ4= github.com/cs3org/go-cs3apis v0.0.0-20210209082852-35ace33082f5 h1:wy1oeyy6v9/65G97AkE5o4jC9J+sngPV9AZL5TbNsaY= github.com/cs3org/go-cs3apis v0.0.0-20210209082852-35ace33082f5/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= +github.com/cs3org/go-cs3apis v0.0.0-20210209091240-d16c30974508 h1:AyeoeZZGPC1lTN7mhgh8HGwwRlvG8hXJ/06q9P+ad9I= +github.com/cs3org/go-cs3apis v0.0.0-20210209091240-d16c30974508/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/cucumber/godog v0.8.1/go.mod h1:vSh3r/lM+psC1BPXvdkSEuNjmXfpVqrMGYAElF6hxnA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/internal/grpc/services/gateway/storageprovider.go b/internal/grpc/services/gateway/storageprovider.go index dc565ecfed..9bdcbc63d2 100644 --- a/internal/grpc/services/gateway/storageprovider.go +++ b/internal/grpc/services/gateway/storageprovider.go @@ -90,10 +90,99 @@ func (s *svc) CreateHome(ctx context.Context, req *provider.CreateHomeRequest) ( Status: status.NewInternal(ctx, err, "error calling CreateHome"), }, nil } + return res, nil +} + +func (s *svc) CreateStorageSpace(ctx context.Context, req *provider.CreateStorageSpaceRequest) (*provider.CreateStorageSpaceResponse, error) { + log := appctx.GetLogger(ctx) + // TODO: needs to be fixed + c, err := s.findByPath(ctx, req.Type) + if err != nil { + return &provider.CreateStorageSpaceResponse{ + Status: status.NewStatusFromErrType(ctx, "error finding path", err), + }, nil + } + res, err := c.CreateStorageSpace(ctx, req) + if err != nil { + log.Err(err).Msg("gateway: error creating storage space on storage provider") + return &provider.CreateStorageSpaceResponse{ + Status: status.NewInternal(ctx, err, "error calling CreateStorageSpace"), + }, nil + } return res, nil +} + +func (s *svc) ListStorageSpaces(ctx context.Context, req *provider.ListStorageSpacesRequest) (*provider.ListStorageSpacesResponse, error) { + log := appctx.GetLogger(ctx) + // TODO: needs to be fixed + var id *provider.StorageSpaceId + for _, f := range req.Filters { + if f.Type == provider.ListStorageSpacesRequest_Filter_TYPE_ID { + id = f.GetId() + } + } + c, err := s.findByID(ctx, &provider.ResourceId{ + OpaqueId: id.OpaqueId, + }) + if err != nil { + return &provider.ListStorageSpacesResponse{ + Status: status.NewStatusFromErrType(ctx, "error finding path", err), + }, nil + } + res, err := c.ListStorageSpaces(ctx, req) + if err != nil { + log.Err(err).Msg("gateway: error listing storage space on storage provider") + return &provider.ListStorageSpacesResponse{ + Status: status.NewInternal(ctx, err, "error calling ListStorageSpaces"), + }, nil + } + return res, nil } + +func (s *svc) UpdateStorageSpace(ctx context.Context, req *provider.UpdateStorageSpaceRequest) (*provider.UpdateStorageSpaceResponse, error) { + log := appctx.GetLogger(ctx) + // TODO: needs to be fixed + c, err := s.findByID(ctx, req.StorageSpace.Root) + if err != nil { + return &provider.UpdateStorageSpaceResponse{ + Status: status.NewStatusFromErrType(ctx, "error finding ID", err), + }, nil + } + + res, err := c.UpdateStorageSpace(ctx, req) + if err != nil { + log.Err(err).Msg("gateway: error creating update space on storage provider") + return &provider.UpdateStorageSpaceResponse{ + Status: status.NewInternal(ctx, err, "error calling UpdateStorageSpace"), + }, nil + } + return res, nil +} + +func (s *svc) DeleteStorageSpace(ctx context.Context, req *provider.DeleteStorageSpaceRequest) (*provider.DeleteStorageSpaceResponse, error) { + log := appctx.GetLogger(ctx) + // TODO: needs to be fixed + c, err := s.findByID(ctx, &provider.ResourceId{ + OpaqueId: req.Id.OpaqueId, + }) + if err != nil { + return &provider.DeleteStorageSpaceResponse{ + Status: status.NewStatusFromErrType(ctx, "error finding path", err), + }, nil + } + + res, err := c.DeleteStorageSpace(ctx, req) + if err != nil { + log.Err(err).Msg("gateway: error deleting storage space on storage provider") + return &provider.DeleteStorageSpaceResponse{ + Status: status.NewInternal(ctx, err, "error calling DeleteStorageSpace"), + }, nil + } + return res, nil +} + func (s *svc) GetHome(ctx context.Context, _ *provider.GetHomeRequest) (*provider.GetHomeResponse, error) { home := s.getHome(ctx) homeRes := &provider.GetHomeResponse{Path: home, Status: status.NewOK(ctx)} diff --git a/internal/grpc/services/publicstorageprovider/publicstorageprovider.go b/internal/grpc/services/publicstorageprovider/publicstorageprovider.go index 74b82ce637..e5560eeeb5 100644 --- a/internal/grpc/services/publicstorageprovider/publicstorageprovider.go +++ b/internal/grpc/services/publicstorageprovider/publicstorageprovider.go @@ -288,6 +288,22 @@ func (s *service) CreateHome(ctx context.Context, req *provider.CreateHomeReques return nil, gstatus.Errorf(codes.Unimplemented, "method not implemented") } +func (s *service) CreateStorageSpace(ctx context.Context, req *provider.CreateStorageSpaceRequest) (*provider.CreateStorageSpaceResponse, error) { + return nil, gstatus.Errorf(codes.Unimplemented, "method not implemented") +} + +func (s *service) ListStorageSpaces(ctx context.Context, req *provider.ListStorageSpacesRequest) (*provider.ListStorageSpacesResponse, error) { + return nil, gstatus.Errorf(codes.Unimplemented, "method not implemented") +} + +func (s *service) UpdateStorageSpace(ctx context.Context, req *provider.UpdateStorageSpaceRequest) (*provider.UpdateStorageSpaceResponse, error) { + return nil, gstatus.Errorf(codes.Unimplemented, "method not implemented") +} + +func (s *service) DeleteStorageSpace(ctx context.Context, req *provider.DeleteStorageSpaceRequest) (*provider.DeleteStorageSpaceResponse, error) { + return nil, gstatus.Errorf(codes.Unimplemented, "method not implemented") +} + func (s *service) CreateContainer(ctx context.Context, req *provider.CreateContainerRequest) (*provider.CreateContainerResponse, error) { ctx, span := trace.StartSpan(ctx, "CreateContainer") defer span.End() diff --git a/internal/grpc/services/storageprovider/storageprovider.go b/internal/grpc/services/storageprovider/storageprovider.go index 4e64793047..4ea9e48e44 100644 --- a/internal/grpc/services/storageprovider/storageprovider.go +++ b/internal/grpc/services/storageprovider/storageprovider.go @@ -418,7 +418,30 @@ func (s *service) CreateHome(ctx context.Context, req *provider.CreateHomeReques Status: status.NewOK(ctx), } return res, nil +} + +func (s *service) CreateStorageSpace(ctx context.Context, req *provider.CreateStorageSpaceRequest) (*provider.CreateStorageSpaceResponse, error) { + return &provider.CreateStorageSpaceResponse{ + Status: status.NewUnimplemented(ctx, errors.New("CreateStorageSpace not implemented"), "CreateStorageSpace not implemented"), + }, nil +} +func (s *service) ListStorageSpaces(ctx context.Context, req *provider.ListStorageSpacesRequest) (*provider.ListStorageSpacesResponse, error) { + return &provider.ListStorageSpacesResponse{ + Status: status.NewUnimplemented(ctx, errors.New("ListStorageSpaces not implemented"), "ListStorageSpaces not implemented"), + }, nil +} + +func (s *service) UpdateStorageSpace(ctx context.Context, req *provider.UpdateStorageSpaceRequest) (*provider.UpdateStorageSpaceResponse, error) { + return &provider.UpdateStorageSpaceResponse{ + Status: status.NewUnimplemented(ctx, errors.New("UpdateStorageSpace not implemented"), "UpdateStorageSpace not implemented"), + }, nil +} + +func (s *service) DeleteStorageSpace(ctx context.Context, req *provider.DeleteStorageSpaceRequest) (*provider.DeleteStorageSpaceResponse, error) { + return &provider.DeleteStorageSpaceResponse{ + Status: status.NewUnimplemented(ctx, errors.New("DeleteStorageSpace not implemented"), "DeleteStorageSpace not implemented"), + }, nil } func (s *service) CreateContainer(ctx context.Context, req *provider.CreateContainerRequest) (*provider.CreateContainerResponse, error) { diff --git a/pkg/cbox/group/rest/rest.go b/pkg/cbox/group/rest/rest.go index 5957768bfd..d1f785248b 100644 --- a/pkg/cbox/group/rest/rest.go +++ b/pkg/cbox/group/rest/rest.go @@ -46,8 +46,7 @@ func init() { } var ( - emailRegex = regexp.MustCompile(`^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$`) - groupNameRegex = regexp.MustCompile(`^[ a-zA-Z0-9._-]+$`) + emailRegex = regexp.MustCompile(`^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$`) ) type manager struct { @@ -404,16 +403,10 @@ func (m *manager) findGroupsByFilter(ctx context.Context, url string, groups map } func (m *manager) FindGroups(ctx context.Context, query string) ([]*grouppb.Group, error) { - - var filters []string - switch { - case groupNameRegex.MatchString(query): - filters = []string{"groupidentifier", "displayName"} - case emailRegex.MatchString(query): - filters = []string{"groupidentifier"} - query = strings.TrimSuffix(query, "@cern.ch") - default: - return nil, errors.New("rest: illegal characters present in query") + filters := []string{"groupIdentifier"} + if emailRegex.MatchString(query) { + parts := strings.Split(query, "@") + query = parts[0] } groups := make(map[string]*grouppb.Group) diff --git a/pkg/cbox/publicshare/sql/sql.go b/pkg/cbox/publicshare/sql/sql.go index 86e24b0a70..cee22c9013 100644 --- a/pkg/cbox/publicshare/sql/sql.go +++ b/pkg/cbox/publicshare/sql/sql.go @@ -51,13 +51,14 @@ func init() { } type config struct { - SharePasswordHashCost int `mapstructure:"password_hash_cost"` - JanitorRunInterval int `mapstructure:"janitor_run_interval"` - DbUsername string `mapstructure:"db_username"` - DbPassword string `mapstructure:"db_password"` - DbHost string `mapstructure:"db_host"` - DbPort int `mapstructure:"db_port"` - DbName string `mapstructure:"db_name"` + SharePasswordHashCost int `mapstructure:"password_hash_cost"` + JanitorRunInterval int `mapstructure:"janitor_run_interval"` + EnableExpiredSharesCleanup bool `mapstructure:"enable_expired_shares_cleanup"` + DbUsername string `mapstructure:"db_username"` + DbPassword string `mapstructure:"db_password"` + DbHost string `mapstructure:"db_host"` + DbPort int `mapstructure:"db_port"` + DbName string `mapstructure:"db_name"` } type manager struct { @@ -75,6 +76,10 @@ func (c *config) init() { } func (m *manager) startJanitorRun() { + if !m.c.EnableExpiredSharesCleanup { + return + } + ticker := time.NewTicker(time.Duration(m.c.JanitorRunInterval) * time.Second) work := make(chan os.Signal, 1) signal.Notify(work, syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT) @@ -415,6 +420,10 @@ func (m *manager) GetPublicShareByToken(ctx context.Context, token, password str } func (m *manager) cleanupExpiredShares() error { + if !m.c.EnableExpiredSharesCleanup { + return nil + } + query := "delete from oc_share where expiration IS NOT NULL AND expiration < ?" params := []interface{}{time.Now().Format("2006-01-02 03:04:05")} diff --git a/pkg/cbox/utils/conversions.go b/pkg/cbox/utils/conversions.go index 38d5424911..1997c66664 100644 --- a/pkg/cbox/utils/conversions.go +++ b/pkg/cbox/utils/conversions.go @@ -169,7 +169,7 @@ func FormatUserID(u *userpb.UserId) string { // ExtractUserID retrieves a CS3API user ID from a string func ExtractUserID(u string) *userpb.UserId { - parts := strings.Split(u, ":") + parts := strings.SplitN(u, ":", 2) if len(parts) > 1 { return &userpb.UserId{OpaqueId: parts[0], Idp: parts[1]} } @@ -186,7 +186,7 @@ func FormatGroupID(u *grouppb.GroupId) string { // ExtractGroupID retrieves a CS3API group ID from a string func ExtractGroupID(u string) *grouppb.GroupId { - parts := strings.Split(u, ":") + parts := strings.SplitN(u, ":", 2) if len(parts) > 1 { return &grouppb.GroupId{OpaqueId: parts[0], Idp: parts[1]} } From 1a416acb650db3939db123011e68c99995a8d5d2 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Thu, 18 Feb 2021 14:31:59 +0100 Subject: [PATCH 2/5] Change permissions order --- .../services/owncloud/ocs/conversions/role.go | 18 +++++++++--------- .../oc-integration-tests/drone/ldap-users.toml | 4 ++-- .../oc-integration-tests/local/ldap-users.toml | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/http/services/owncloud/ocs/conversions/role.go b/internal/http/services/owncloud/ocs/conversions/role.go index d1b7de605e..b53513a153 100644 --- a/internal/http/services/owncloud/ocs/conversions/role.go +++ b/internal/http/services/owncloud/ocs/conversions/role.go @@ -92,6 +92,15 @@ func (r *Role) OCSPermissions() Permissions { func (r *Role) WebDAVPermissions(isDir, isShared, isMountpoint, isPublic bool) string { var b strings.Builder //b.Grow(7) + if !isPublic && isShared { + fmt.Fprintf(&b, "S") + } + if r.ocsPermissions.Contain(PermissionShare) { + fmt.Fprintf(&b, "R") + } + if !isPublic && isMountpoint { + fmt.Fprintf(&b, "M") + } if r.ocsPermissions.Contain(PermissionDelete) { fmt.Fprintf(&b, "D") // TODO oc10 shows received shares as deletable } @@ -104,15 +113,6 @@ func (r *Role) WebDAVPermissions(isDir, isShared, isMountpoint, isPublic bool) s if isDir && r.ocsPermissions.Contain(PermissionCreate) { fmt.Fprintf(&b, "CK") } - if !isPublic && isShared { - fmt.Fprintf(&b, "S") - } - if r.ocsPermissions.Contain(PermissionShare) { - fmt.Fprintf(&b, "R") - } - if !isPublic && isMountpoint { - fmt.Fprintf(&b, "M") - } return b.String() } diff --git a/tests/oc-integration-tests/drone/ldap-users.toml b/tests/oc-integration-tests/drone/ldap-users.toml index d5e897db0b..348cd5599e 100644 --- a/tests/oc-integration-tests/drone/ldap-users.toml +++ b/tests/oc-integration-tests/drone/ldap-users.toml @@ -61,7 +61,7 @@ bind_password="admin" idp="http://localhost:18000" [grpc.services.groupprovider.drivers.ldap.schema] -gid="gid" -displayName="displayName" +gid="cn" +displayName="cn" dn="dn" cn="cn" diff --git a/tests/oc-integration-tests/local/ldap-users.toml b/tests/oc-integration-tests/local/ldap-users.toml index afc638a989..d4d20d3e38 100644 --- a/tests/oc-integration-tests/local/ldap-users.toml +++ b/tests/oc-integration-tests/local/ldap-users.toml @@ -61,7 +61,7 @@ bind_password="admin" idp="http://localhost:18000" [grpc.services.groupprovider.drivers.ldap.schema] -gid="gid" -displayName="displayName" +gid="cn" +displayName="cn" dn="dn" cn="cn" From 217ace1c43cf8e00b69715d2d711f3811841db3b Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Thu, 4 Mar 2021 12:33:11 +0100 Subject: [PATCH 3/5] Add janitor config to json driver as well --- pkg/publicshare/manager/json/json.go | 37 ++++++++++++++++++---------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/pkg/publicshare/manager/json/json.go b/pkg/publicshare/manager/json/json.go index daff07bad3..512f510fc9 100644 --- a/pkg/publicshare/manager/json/json.go +++ b/pkg/publicshare/manager/json/json.go @@ -63,12 +63,13 @@ func New(c map[string]interface{}) (publicshare.Manager, error) { conf.init() m := manager{ - mutex: &sync.Mutex{}, - marshaler: jsonpb.Marshaler{}, - unmarshaler: jsonpb.Unmarshaler{}, - file: conf.File, - passwordHashCost: conf.SharePasswordHashCost, - janitorRunInterval: conf.JanitorRunInterval, + mutex: &sync.Mutex{}, + marshaler: jsonpb.Marshaler{}, + unmarshaler: jsonpb.Unmarshaler{}, + file: conf.File, + passwordHashCost: conf.SharePasswordHashCost, + janitorRunInterval: conf.JanitorRunInterval, + enableExpiredSharesCleanup: conf.EnableExpiredSharesCleanup, } // attempt to create the db file @@ -97,9 +98,10 @@ func New(c map[string]interface{}) (publicshare.Manager, error) { } type config struct { - File string `mapstructure:"file"` - SharePasswordHashCost int `mapstructure:"password_hash_cost"` - JanitorRunInterval int `mapstructure:"janitor_run_interval"` + File string `mapstructure:"file"` + SharePasswordHashCost int `mapstructure:"password_hash_cost"` + JanitorRunInterval int `mapstructure:"janitor_run_interval"` + EnableExpiredSharesCleanup bool `mapstructure:"enable_expired_shares_cleanup"` } func (c *config) init() { @@ -118,13 +120,18 @@ type manager struct { mutex *sync.Mutex file string - marshaler jsonpb.Marshaler - unmarshaler jsonpb.Unmarshaler - passwordHashCost int - janitorRunInterval int + marshaler jsonpb.Marshaler + unmarshaler jsonpb.Unmarshaler + passwordHashCost int + janitorRunInterval int + enableExpiredSharesCleanup bool } func (m *manager) startJanitorRun() { + if !m.enableExpiredSharesCleanup { + return + } + ticker := time.NewTicker(time.Duration(m.janitorRunInterval) * time.Second) work := make(chan os.Signal, 1) signal.Notify(work, syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT) @@ -414,6 +421,10 @@ func (m *manager) cleanupExpiredShares() { } func (m *manager) revokeExpiredPublicShare(ctx context.Context, s *link.PublicShare, u *user.User) error { + if !m.enableExpiredSharesCleanup { + return nil + } + m.mutex.Unlock() defer m.mutex.Lock() From c8fdc50c78c37ada2cf75c0fa1c85d6c93b3f402 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Thu, 4 Mar 2021 13:03:41 +0100 Subject: [PATCH 4/5] Update expected failures --- .../acceptance/expected-failures-on-OCIS-storage.md | 12 ------------ .../expected-failures-on-OWNCLOUD-storage.md | 13 ------------- 2 files changed, 25 deletions(-) diff --git a/tests/acceptance/expected-failures-on-OCIS-storage.md b/tests/acceptance/expected-failures-on-OCIS-storage.md index 51a66dd4e7..271f5bb240 100644 --- a/tests/acceptance/expected-failures-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-on-OCIS-storage.md @@ -327,12 +327,6 @@ Scenario Outline: try to create a folder with a name of an existing file ### [Different webdav properties from core](https://github.com/owncloud/ocis/issues/1302) - [apiWebdavProperties2/getFileProperties.feature:327](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L327) - [apiWebdavProperties2/getFileProperties.feature:328](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L328) -Scenario Outline: Propfind the permissions on a file using webdav api `Property "oc:permissions" found with value "DNVWR", expected "/RM{0,1}DNVW/"` -- [apiWebdavProperties2/getFileProperties.feature:441](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L441) -- [apiWebdavProperties2/getFileProperties.feature:442](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L442) -Scenario Outline: Propfind the permissions on a folder using webdav api `Property "oc:permissions" found with value "DNVCKR", expected "/RM{0,1}DNVCK/"` -- [apiWebdavProperties2/getFileProperties.feature:454](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L454) -- [apiWebdavProperties2/getFileProperties.feature:455](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L455) #### [Some failing tests with Webdav custom properties](https://github.com/owncloud/ocis/issues/1297) _ocdav: double check the webdav property parsing when custom namespaces are used_ @@ -1273,9 +1267,7 @@ _requires a [CS3 user provisioning api that can update the quota for a user](htt #### [share permissions are not enforced](https://github.com/owncloud/product/issues/270) -- [apiShareManagementToShares/mergeShare.feature:24](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature#L24) - [apiShareManagementToShares/mergeShare.feature:52](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature#L52) -- [apiShareManagementToShares/mergeShare.feature:79](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature#L79) - [apiShareManagementToShares/mergeShare.feature:99](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature#L99) - [apiShareReshareToShares3/reShareUpdate.feature:59](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareReshareToShares3/reShareUpdate.feature#L59) - [apiShareReshareToShares3/reShareUpdate.feature:60](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareReshareToShares3/reShareUpdate.feature#L60) @@ -1682,8 +1674,6 @@ Scenario Outline: Renaming a file to a path with extension .part should not be p - [apiShareCreateSpecialToShares2/createShareDefaultFolderForReceivedShares.feature:22](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareDefaultFolderForReceivedShares.feature#L22) #### [Group shares support ](https://github.com/owncloud/ocis/issues/1289) -- [apiShareOperationsToShares/gettingShares.feature:103](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares/gettingShares.feature#L103) -- [apiShareOperationsToShares/gettingShares.feature:104](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares/gettingShares.feature#L104) - [apiShareOperationsToShares/gettingShares.feature:184](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares/gettingShares.feature#L184) #### [various sharing settings cannot be set](https://github.com/owncloud/ocis/issues/1328) @@ -1701,8 +1691,6 @@ Scenario Outline: Renaming a file to a path with extension .part should not be p #### [Sharing seems to work but does not work](https://github.com/owncloud/ocis/issues/1303) - [apiShareUpdateToShares/updateShare.feature:61](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L61) - [apiShareUpdateToShares/updateShare.feature:62](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L62) -- [apiShareUpdateToShares/updateShare.feature:75](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L75) -- [apiShareUpdateToShares/updateShare.feature:76](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L76) - [apiShareUpdateToShares/updateShare.feature:115](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L115) - [apiShareUpdateToShares/updateShare.feature:116](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L116) - [apiShareUpdateToShares/updateShare.feature:117](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L117) diff --git a/tests/acceptance/expected-failures-on-OWNCLOUD-storage.md b/tests/acceptance/expected-failures-on-OWNCLOUD-storage.md index 8e84a02818..2925a0d802 100644 --- a/tests/acceptance/expected-failures-on-OWNCLOUD-storage.md +++ b/tests/acceptance/expected-failures-on-OWNCLOUD-storage.md @@ -361,12 +361,6 @@ Scenario Outline: Propfind the content type of a file using webdav api `Property Scenario Outline: Propfind the size of a folder using webdav api `Property "oc:size" found with value "10", expected "#^0$#" or "#^0$#"` - [apiWebdavProperties2/getFileProperties.feature:376](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L376) - [apiWebdavProperties2/getFileProperties.feature:377](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L377) -Scenario Outline: Propfind the permissions on a file using webdav api `Property "oc:permissions" found with value "DNVWR", expected "/RM{0,1}DNVW/"` -- [apiWebdavProperties2/getFileProperties.feature:441](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L441) -- [apiWebdavProperties2/getFileProperties.feature:442](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L442) -Scenario Outline: Propfind the permissions on a folder using webdav api `Property "oc:permissions" found with value "DNVCKR", expected "/RM{0,1}DNVCK/"` -- [apiWebdavProperties2/getFileProperties.feature:454](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L454) -- [apiWebdavProperties2/getFileProperties.feature:455](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties2/getFileProperties.feature#L455) #### [Some failing tests with Webdav custom properties](https://github.com/owncloud/ocis/issues/1297) _ocdav: double check the webdav property parsing when custom namespaces are used_ @@ -1345,9 +1339,6 @@ The following scenarios fail on OWNCLOUD storage but not on OCIS storage: #### [share permissions are not enforced](https://github.com/owncloud/product/issues/270) -- [apiShareManagementToShares/mergeShare.feature:24](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature#L24) -- [apiShareManagementToShares/mergeShare.feature:52](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature#L52) -- [apiShareManagementToShares/mergeShare.feature:79](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature#L79) - [apiShareManagementToShares/mergeShare.feature:99](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature#L99) - [apiShareReshareToShares3/reShareUpdate.feature:59](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareReshareToShares3/reShareUpdate.feature#L59) - [apiShareReshareToShares3/reShareUpdate.feature:60](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareReshareToShares3/reShareUpdate.feature#L60) @@ -1825,8 +1816,6 @@ The following scenarios fail on OWNCLOUD storage but not on OCIS storage: - [apiShareCreateSpecialToShares2/createShareDefaultFolderForReceivedShares.feature:22](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareDefaultFolderForReceivedShares.feature#L22) #### [Group shares support ](https://github.com/owncloud/ocis/issues/1289) -- [apiShareOperationsToShares/gettingShares.feature:103](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares/gettingShares.feature#L103) -- [apiShareOperationsToShares/gettingShares.feature:104](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares/gettingShares.feature#L104) - [apiShareOperationsToShares/gettingShares.feature:184](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares/gettingShares.feature#L184) #### [various sharing settings cannot be set](https://github.com/owncloud/ocis/issues/1328) @@ -1844,8 +1833,6 @@ The following scenarios fail on OWNCLOUD storage but not on OCIS storage: #### [Sharing seems to work but does not work](https://github.com/owncloud/ocis/issues/1303) - [apiShareUpdateToShares/updateShare.feature:61](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L61) - [apiShareUpdateToShares/updateShare.feature:62](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L62) -- [apiShareUpdateToShares/updateShare.feature:75](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L75) -- [apiShareUpdateToShares/updateShare.feature:76](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L76) - [apiShareUpdateToShares/updateShare.feature:115](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L115) - [apiShareUpdateToShares/updateShare.feature:116](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L116) - [apiShareUpdateToShares/updateShare.feature:117](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L117) From d8e687246a275811927e2239c82035db85e7aa86 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Thu, 4 Mar 2021 16:24:39 +0100 Subject: [PATCH 5/5] Return correct error in upload cmd --- cmd/reva/upload.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/reva/upload.go b/cmd/reva/upload.go index 9bf2ea0070..56ca5d8db4 100644 --- a/cmd/reva/upload.go +++ b/cmd/reva/upload.go @@ -169,7 +169,7 @@ func uploadCommand() *command { } defer httpRes.Body.Close() if httpRes.StatusCode != http.StatusOK { - return err + return errors.New("upload: PUT request returned " + httpRes.Status) } } else { // create the tus client.