diff --git a/.drone.env b/.drone.env index f9810cd6c77..ec3d6f948d1 100644 --- a/.drone.env +++ b/.drone.env @@ -1,5 +1,5 @@ # The test runner source for API tests -CORE_COMMITID=751c7d92b189cdc30b2a39bc08f31336a0ec2c41 +CORE_COMMITID=8b15ef46e68cf73ea861d4f180ed1f6bff5096a8 CORE_BRANCH=master # The test runner source for UI tests diff --git a/.drone.star b/.drone.star index abd62be4380..4ce8ab9d135 100644 --- a/.drone.star +++ b/.drone.star @@ -112,7 +112,7 @@ config = { "suites": [ "apiShareManagement", ], - "skip": False, + "skip": True, "earlyFail": True, "cron": "nightly", }, @@ -120,7 +120,7 @@ config = { "suites": [ "apiWebdavOperations", ], - "skip": False, + "skip": True, "earlyFail": True, "cron": "nightly", }, diff --git a/CHANGELOG.md b/CHANGELOG.md index 623214e1bf1..4dd7ef7351f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,10 @@ The following sections list the changes for unreleased. ## Summary +* Bugfix - Fix search in received shares: [#4308](https://github.com/owncloud/ocis/issues/4308) * Bugfix - Substring search for sharees: [#547](https://github.com/owncloud/ocis/issues/547) +* Bugfix - Space Creators can hand over spaces: [#4244](https://github.com/owncloud/ocis/pull/4244) +* Enhancement - Add drives field to users endpoint: [#4072](https://github.com/owncloud/ocis/pull/4072) * Enhancement - Improve error log for "could not get user by claim" error: [#4227](https://github.com/owncloud/ocis/pull/4227) * Enhancement - Allow providing list of services NOT to start: [#4254](https://github.com/owncloud/ocis/pull/4254) * Enhancement - Introduce insecure flag for smtp email notifications: [#4279](https://github.com/owncloud/ocis/pull/4279) @@ -14,6 +17,12 @@ The following sections list the changes for unreleased. ## Details +* Bugfix - Fix search in received shares: [#4308](https://github.com/owncloud/ocis/issues/4308) + + We fixed a problem where items in received shares were not found. + + https://github.com/owncloud/ocis/issues/4308 + * Bugfix - Substring search for sharees: [#547](https://github.com/owncloud/ocis/issues/547) We fixed searching for sharees to be no longer case-sensitive. With this we introduced two new @@ -29,6 +38,20 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/issues/547 +* Bugfix - Space Creators can hand over spaces: [#4244](https://github.com/owncloud/ocis/pull/4244) + + Set no owner on non personal spaces to be able to pass the space manager role to a new user. + + https://github.com/owncloud/ocis/pull/4244 + +* Enhancement - Add drives field to users endpoint: [#4072](https://github.com/owncloud/ocis/pull/4072) + + We have added `$expand=drives` to the `/users/{id}/` endpoint using the user filter + implemented in reva. + + https://github.com/owncloud/ocis/pull/4072 + https://github.com/cs3org/reva/pull/3046 + * Enhancement - Improve error log for "could not get user by claim" error: [#4227](https://github.com/owncloud/ocis/pull/4227) We've improved the error log for "could not get user by claim" error where previously only the @@ -56,6 +79,7 @@ The following sections list the changes for unreleased. Updated reva to version x.x.x. This update includes: https://github.com/owncloud/ocis/pull/4272 + https://github.com/cs3org/reva/pull/3096 * todo: # Changelog for [2.0.0-beta.5] (2022-07-19) diff --git a/changelog/unreleased/add-drives-endpoint-and-userfilter.md b/changelog/unreleased/add-drives-endpoint-and-userfilter.md new file mode 100644 index 00000000000..98035fd41f7 --- /dev/null +++ b/changelog/unreleased/add-drives-endpoint-and-userfilter.md @@ -0,0 +1,7 @@ +Enhancement: add drives field to users endpoint + +We have added `$expand=drives` to the `/users/{id}/` endpoint +using the user filter implemented in reva. + +https://github.com/owncloud/ocis/pull/4072 +https://github.com/cs3org/reva/pull/3046 \ No newline at end of file diff --git a/changelog/unreleased/fix-search-in-received-shares.md b/changelog/unreleased/fix-search-in-received-shares.md new file mode 100644 index 00000000000..88bac6a23de --- /dev/null +++ b/changelog/unreleased/fix-search-in-received-shares.md @@ -0,0 +1,5 @@ +Bugfix: Fix search in received shares + +We fixed a problem where items in received shares were not found. + +https://github.com/owncloud/ocis/issues/4308 diff --git a/changelog/unreleased/space-owner.md b/changelog/unreleased/space-owner.md new file mode 100644 index 00000000000..ff41e37bacb --- /dev/null +++ b/changelog/unreleased/space-owner.md @@ -0,0 +1,5 @@ +Bugfix: Space Creators can hand over spaces + +Set no owner on non personal spaces to be able to pass the space manager role to a new user. + +https://github.com/owncloud/ocis/pull/4244 diff --git a/changelog/unreleased/update-reva-beta.6.md b/changelog/unreleased/update-reva-beta.6.md index 2bcd4071dd2..98b18edba57 100644 --- a/changelog/unreleased/update-reva-beta.6.md +++ b/changelog/unreleased/update-reva-beta.6.md @@ -4,3 +4,4 @@ Updated reva to version x.x.x. This update includes: * TODO: https://github.com/owncloud/ocis/pull/4272 +https://github.com/cs3org/reva/pull/3096 \ No newline at end of file diff --git a/services/graph/pkg/identity/cs3.go b/services/graph/pkg/identity/cs3.go index 039edbfb869..a42bbdbc43c 100644 --- a/services/graph/pkg/identity/cs3.go +++ b/services/graph/pkg/identity/cs3.go @@ -203,7 +203,6 @@ func createGroupModelFromCS3(g *cs3group.Group) *libregraph.Group { OnPremisesDomainName: &g.Id.Idp, OnPremisesSamAccountName: &g.GroupName, DisplayName: &g.DisplayName, - Mail: &g.Mail, // TODO when to fetch and expand memberof, usernames or ids? } } diff --git a/services/graph/pkg/service/v0/drives.go b/services/graph/pkg/service/v0/drives.go index 9ec9984dbf8..dfe702240a7 100644 --- a/services/graph/pkg/service/v0/drives.go +++ b/services/graph/pkg/service/v0/drives.go @@ -223,7 +223,6 @@ func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request) { } csr := storageprovider.CreateStorageSpaceRequest{ - Owner: us, Type: driveType, Name: spaceName, Quota: getQuota(drive.Quota, g.config.Spaces.DefaultQuota), @@ -237,6 +236,10 @@ func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request) { csr.Opaque = utils.AppendPlainToOpaque(csr.Opaque, "spaceAlias", *drive.DriveAlias) } + if driveType == "personal" { + csr.Owner = us + } + resp, err := client.CreateStorageSpace(r.Context(), &csr) if err != nil { errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, err.Error()) @@ -733,6 +736,17 @@ func listStorageSpacesIDFilter(id string) *storageprovider.ListStorageSpacesRequ } } +func listStorageSpacesUserFilter(id string) *storageprovider.ListStorageSpacesRequest_Filter { + return &storageprovider.ListStorageSpacesRequest_Filter{ + Type: storageprovider.ListStorageSpacesRequest_Filter_TYPE_USER, + Term: &storageprovider.ListStorageSpacesRequest_Filter_User{ + User: &userv1beta1.UserId{ + OpaqueId: id, + }, + }, + } +} + func listStorageSpacesTypeFilter(spaceType string) *storageprovider.ListStorageSpacesRequest_Filter { return &storageprovider.ListStorageSpacesRequest_Filter{ Type: storageprovider.ListStorageSpacesRequest_Filter_TYPE_SPACE_TYPE, diff --git a/services/graph/pkg/service/v0/users.go b/services/graph/pkg/service/v0/users.go index 96f8e9cc752..8fa16c17337 100644 --- a/services/graph/pkg/service/v0/users.go +++ b/services/graph/pkg/service/v0/users.go @@ -11,9 +11,12 @@ import ( "strings" "github.com/CiscoM31/godata" + cs3rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" + storageprovider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" ctxpkg "github.com/cs3org/reva/v2/pkg/ctx" revactx "github.com/cs3org/reva/v2/pkg/ctx" "github.com/cs3org/reva/v2/pkg/events" + "github.com/cs3org/reva/v2/pkg/rgrpc/status" "github.com/go-chi/chi/v5" "github.com/go-chi/render" libregraph "github.com/owncloud/libre-graph-api-go" @@ -21,6 +24,7 @@ import ( "github.com/owncloud/ocis/v2/services/graph/pkg/identity" "github.com/owncloud/ocis/v2/services/graph/pkg/service/v0/errorcode" settingssvc "github.com/owncloud/ocis/v2/services/settings/pkg/service/v0" + "golang.org/x/exp/slices" ) // GetMe implements the Service interface. @@ -171,6 +175,43 @@ func (g Graph) GetUser(w http.ResponseWriter, r *http.Request) { errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, err.Error()) } } + sel := strings.Split(r.URL.Query().Get("$select"), ",") + exp := strings.Split(r.URL.Query().Get("$expand"), ",") + if slices.Contains(sel, "drive") || slices.Contains(sel, "drives") || slices.Contains(exp, "drive") || slices.Contains(exp, "drives") { + wdu, err := url.Parse(g.config.Spaces.WebDavBase + g.config.Spaces.WebDavPath) + f := listStorageSpacesUserFilter(user.GetId()) + lspr, err := g.gatewayClient.ListStorageSpaces(r.Context(), &storageprovider.ListStorageSpacesRequest{ + Opaque: nil, + Filters: []*storageprovider.ListStorageSpacesRequest_Filter{f}, + }) + if err != nil { + g.logger.Err(err).Interface("query", r.URL.Query()).Msg("error getting storages") + render.Status(r, http.StatusInternalServerError) + render.JSON(w, r, user) + return + } + if lspr.Status.Code != cs3rpc.Code_CODE_OK { + // in case of NOT_OK, we can just return the user object with empty drives + render.Status(r, status.HTTPStatusFromCode(http.StatusOK)) + render.JSON(w, r, user) + return + } + drives := []libregraph.Drive{} + for _, sp := range lspr.GetStorageSpaces() { + d, err := g.cs3StorageSpaceToDrive(r.Context(), wdu, sp) + if err != nil { + g.logger.Err(err).Interface("query", r.URL.Query()).Msg("error converting space to drive") + } + if slices.Contains(sel, "drive") || slices.Contains(exp, "drive") { + if *d.DriveType == "personal" { + drives = append(drives, *d) + } + } else { + drives = append(drives, *d) + } + } + user.Drives = drives + } render.Status(r, http.StatusOK) render.JSON(w, r, user) diff --git a/services/search/pkg/search/provider/searchprovider.go b/services/search/pkg/search/provider/searchprovider.go index a744699e6e2..719fa6a7b99 100644 --- a/services/search/pkg/search/provider/searchprovider.go +++ b/services/search/pkg/search/provider/searchprovider.go @@ -114,12 +114,19 @@ func (p *Provider) Search(ctx context.Context, req *searchsvc.SearchRequest) (*s matches := MatchArray{} total := int32(0) for _, space := range listSpacesRes.StorageSpaces { + searchRootId := &searchmsg.ResourceID{ + StorageId: space.Root.StorageId, + SpaceId: space.Root.SpaceId, + OpaqueId: space.Root.OpaqueId, + } var mountpointRootId *searchmsg.ResourceID mountpointPrefix := "" switch space.SpaceType { case "mountpoint": continue // mountpoint spaces are only "links" to the shared spaces. we have to search the shared "grant" space instead case "grant": + // In case of grant spaces we search the root of the outer space and translate the paths to the according mountpoint + searchRootId.OpaqueId = space.Root.SpaceId mountpointId, ok := mountpointMap[space.Id.OpaqueId] if !ok { p.logger.Warn().Interface("space", space).Msg("could not find mountpoint space for grant space") @@ -153,12 +160,8 @@ func (p *Provider) Search(ctx context.Context, req *searchsvc.SearchRequest) (*s res, err := p.indexClient.Search(ctx, &searchsvc.SearchIndexRequest{ Query: formatQuery(req.Query), Ref: &searchmsg.Reference{ - ResourceId: &searchmsg.ResourceID{ - StorageId: space.Root.StorageId, - SpaceId: space.Root.SpaceId, - OpaqueId: space.Root.OpaqueId, - }, - Path: mountpointPrefix, + ResourceId: searchRootId, + Path: mountpointPrefix, }, PageSize: req.PageSize, }) diff --git a/services/search/pkg/search/provider/searchprovider_test.go b/services/search/pkg/search/provider/searchprovider_test.go index 0badf5e715a..f16e6f6f1f8 100644 --- a/services/search/pkg/search/provider/searchprovider_test.go +++ b/services/search/pkg/search/provider/searchprovider_test.go @@ -49,8 +49,8 @@ var _ = Describe("Searchprovider", func() { }, }, }, - Id: &sprovider.StorageSpaceId{OpaqueId: "personalspace"}, - Root: &sprovider.ResourceId{StorageId: "storageid", OpaqueId: "storageid"}, + Id: &sprovider.StorageSpaceId{OpaqueId: "storageid$personalspace!personalspace"}, + Root: &sprovider.ResourceId{StorageId: "storageid", SpaceId: "personalspace", OpaqueId: "storageid"}, Name: "personalspace", } @@ -133,6 +133,7 @@ var _ = Describe("Searchprovider", func() { Ref: &searchmsg.Reference{ ResourceId: &searchmsg.ResourceID{ StorageId: personalSpace.Root.StorageId, + SpaceId: personalSpace.Root.SpaceId, OpaqueId: personalSpace.Root.OpaqueId, }, Path: "./path/to/Foo.pdf", @@ -259,6 +260,7 @@ var _ = Describe("Searchprovider", func() { Ref: &searchmsg.Reference{ ResourceId: &searchmsg.ResourceID{ StorageId: grantSpace.Root.StorageId, + SpaceId: grantSpace.Root.SpaceId, OpaqueId: grantSpace.Root.OpaqueId, }, Path: "./grant/path/to/Shared.pdf", @@ -297,7 +299,8 @@ var _ = Describe("Searchprovider", func() { StorageSpaces: []*sprovider.StorageSpace{personalSpace, grantSpace, mountpointSpace}, }, nil) indexClient.On("Search", mock.Anything, mock.MatchedBy(func(req *searchsvc.SearchIndexRequest) bool { - return req.Ref.ResourceId.StorageId == grantSpace.Root.StorageId + return req.Ref.ResourceId.OpaqueId == grantSpace.Root.SpaceId && + req.Ref.ResourceId.SpaceId == grantSpace.Root.SpaceId })).Return(&searchsvc.SearchIndexResponse{ TotalMatches: 2, Matches: []*searchmsg.Match{ @@ -307,6 +310,7 @@ var _ = Describe("Searchprovider", func() { Ref: &searchmsg.Reference{ ResourceId: &searchmsg.ResourceID{ StorageId: grantSpace.Root.StorageId, + SpaceId: grantSpace.Root.SpaceId, OpaqueId: grantSpace.Root.OpaqueId, }, Path: "./grant/path/to/Shared.pdf", @@ -324,6 +328,7 @@ var _ = Describe("Searchprovider", func() { Ref: &searchmsg.Reference{ ResourceId: &searchmsg.ResourceID{ StorageId: grantSpace.Root.StorageId, + SpaceId: grantSpace.Root.SpaceId, OpaqueId: grantSpace.Root.OpaqueId, }, Path: "./grant/path/to/Irrelevant.pdf", @@ -338,7 +343,8 @@ var _ = Describe("Searchprovider", func() { }, }, nil) indexClient.On("Search", mock.Anything, mock.MatchedBy(func(req *searchsvc.SearchIndexRequest) bool { - return req.Ref.ResourceId.StorageId == personalSpace.Root.StorageId + return req.Ref.ResourceId.OpaqueId == personalSpace.Root.OpaqueId && + req.Ref.ResourceId.SpaceId == personalSpace.Root.SpaceId })).Return(&searchsvc.SearchIndexResponse{ TotalMatches: 1, Matches: []*searchmsg.Match{ @@ -348,6 +354,7 @@ var _ = Describe("Searchprovider", func() { Ref: &searchmsg.Reference{ ResourceId: &searchmsg.ResourceID{ StorageId: personalSpace.Root.StorageId, + SpaceId: personalSpace.Root.SpaceId, OpaqueId: personalSpace.Root.OpaqueId, }, Path: "./path/to/Foo.pdf", diff --git a/services/settings/l10n/translations.json b/services/settings/l10n/translations.json index d50639cab82..c5d9b3c7ade 100644 --- a/services/settings/l10n/translations.json +++ b/services/settings/l10n/translations.json @@ -1 +1 @@ -{"de":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Konto","Cancel":"Abbrechen","Hello":"Hallo","Language":"Sprache","Loading personal settings":"Lade persönliche Einstellungen","Loading personal settings...":"Lade persönliche Einstellungen...","msg":"msg","No settings available":"Keine Einstellungen verfügbar","Save":"Speichern","Settings":"Einstellungen","Settings type not implemented: %{type}":"Einstellungs-Typ nicht verfügbar: %{type}"},"de_DE":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Benutzerkonto","Cancel":"Abbrechen","Hello":"Hallo","Language":"Sprache","Loading personal settings":"Lade persönliche Einstellungen","Loading personal settings...":"Lade persönliche Einstellungen...","msg":"msg","No settings available":"Keine Einstellungen verfügbar","Save":"Speichern","Settings":"Einstellungen","Settings type not implemented: %{type}":"Einstellungs-Typ nicht verfügbar: %{type}"},"el":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Λογαριασμός","Cancel":"Aκύρωση","Hello":"Γεια σας","Language":"Γλώσσα","Loading personal settings":"Γίνεται φόρτωση προσωπικών ρυθμίσεων","Loading personal settings...":"Γίνεται φόρτωση προσωπικών ρυθμίσεων...","msg":"μνμ","No settings available":"Δεν υπάρχουν διαθέσιμες ρυθμίσεις","Save":"Αποθήκευση","Settings":"Ρυθμίσεις","Settings type not implemented: %{type}":"Ο τύπος ρυθμίσεων δεν εφαρμόστηκε: %{type}"},"es":{"{{ bundle.displayName }}":"{{bundle.displayName}}","Account":"Cuenta","Cancel":"Cancelar","Hello":"Hola","Language":"Idioma","Loading personal settings":"Cargando configuraciones personales","Loading personal settings...":"Cargando configuración personal ...","msg":"msg","No settings available":"No hay configuraciones disponibles","Save":"Guardar","Settings":"Configuración","Settings type not implemented: %{type}":"Tipo de configuración no implementado: %{type}"},"pl":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Konto","Cancel":"Anuluj","Hello":"Witaj","Language":"Język","Loading personal settings":"Ładowanie ustawień osobistych","Loading personal settings...":"Ładowanie ustawień osobistych...","msg":"wiad","No settings available":"Brak dostępnych ustawień","Save":"Zapisz","Settings":"Ustawienia","Settings type not implemented: %{type}":"Typ ustawień nie jest wdrożony: %{type}"},"pt_BR":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Conta","Cancel":"Cancelar","Hello":"Olá","Language":"Idioma","Loading personal settings":"Carregando configurações pessoais ","Loading personal settings...":"Carregando configurações pessoais... ","msg":"msg","No settings available":"Nenhuma configuração disponível ","Save":"Salvar","Settings":"Configurações","Settings type not implemented: %{type}":"Tipo de configuração não implementado: %{type}"},"ru":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Уч.запись","Cancel":"Отмена","Hello":"Здравствуйте","Language":"Язык","Loading personal settings":"Загрузка личных настроек","Loading personal settings...":"Загрузка личных настроек…","msg":"сообщ","No settings available":"Нет доступных настроек","Save":"Сохранить","Settings":"Настройки","Settings type not implemented: %{type}":"Тип настроек не реализован: %{type}"},"sq":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Llogari","Cancel":"Anuloje","Hello":"Tungjatjeta","Language":"Gjuhë","Loading personal settings":"Ngarkim rregullimesh personale","Loading personal settings...":"Po ngarkohen rregullime personale…","msg":"msz","No settings available":"S’ka rregullime","Save":"Ruaje","Settings":"Rregullime","Settings type not implemented: %{type}":"Lloj rregullimi i pasendërtuar: %{type}"},"th_TH":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"บัญชี","Cancel":"ยกเลิก","Hello":"สวัสดี","Language":"ภาษา","Loading personal settings":"กำลังโหลดการตั้งค่าส่วนบุคคล","Loading personal settings...":"กำลังโหลดการตั้งค่าส่วนบุคคล...","msg":"msg","No settings available":"ไม่มีการตั้งค่า","Save":"บันทึก","Settings":"ตั้งค่า","Settings type not implemented: %{type}":"ประเภทการตั้งค่าที่ยังไม่ถูกดำเนินการ: %{type}"},"zh_CN":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"账户","Cancel":"取消","Hello":"你好","Language":"语言","Loading personal settings":"加载个人设置","Loading personal settings...":"加载个人设置...","msg":"msg","No settings available":"没有可用的设置","Save":"保存","Settings":"设置","Settings type not implemented: %{type}":"设置类型未实现:%{type}"}} \ No newline at end of file +{"de":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Konto","Cancel":"Abbrechen","Hello":"Hallo","Language":"Sprache","Loading personal settings":"Lade persönliche Einstellungen","Loading personal settings...":"Lade persönliche Einstellungen...","msg":"msg","No settings available":"Keine Einstellungen verfügbar","Save":"Speichern","Settings":"Einstellungen","Settings type not implemented: %{type}":"Einstellungs-Typ nicht verfügbar: %{type}"},"de_DE":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Benutzerkonto","Cancel":"Abbrechen","Hello":"Hallo","Language":"Sprache","Loading personal settings":"Lade persönliche Einstellungen","Loading personal settings...":"Lade persönliche Einstellungen...","msg":"msg","No settings available":"Keine Einstellungen verfügbar","Save":"Speichern","Settings":"Einstellungen","Settings type not implemented: %{type}":"Einstellungs-Typ nicht verfügbar: %{type}"},"el":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Λογαριασμός","Cancel":"Aκύρωση","Hello":"Γεια σας","Language":"Γλώσσα","Loading personal settings":"Γίνεται φόρτωση προσωπικών ρυθμίσεων","Loading personal settings...":"Γίνεται φόρτωση προσωπικών ρυθμίσεων...","msg":"μνμ","No settings available":"Δεν υπάρχουν διαθέσιμες ρυθμίσεις","Save":"Αποθήκευση","Settings":"Ρυθμίσεις","Settings type not implemented: %{type}":"Ο τύπος ρυθμίσεων δεν εφαρμόστηκε: %{type}"},"es":{"{{ bundle.displayName }}":"{{bundle.displayName}}","Account":"Cuenta","Cancel":"Cancelar","Hello":"Hola","Language":"Idioma","Loading personal settings":"Cargando configuraciones personales","Loading personal settings...":"Cargando configuración personal ...","msg":"msg","No settings available":"No hay configuraciones disponibles","Save":"Guardar","Settings":"Configuración","Settings type not implemented: %{type}":"Tipo de configuración no implementado: %{type}"},"pl":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Konto","Cancel":"Anuluj","Hello":"Witaj","Language":"Język","Loading personal settings":"Ładowanie ustawień osobistych","Loading personal settings...":"Ładowanie ustawień osobistych...","msg":"wiad","No settings available":"Brak dostępnych ustawień","Save":"Zapisz","Settings":"Ustawienia","Settings type not implemented: %{type}":"Typ ustawień nie jest wdrożony: %{type}"},"pt_BR":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Conta","Cancel":"Cancelar","Hello":"Olá","Language":"Idioma","Loading personal settings":"Carregando configurações pessoais ","Loading personal settings...":"Carregando configurações pessoais... ","msg":"msg","No settings available":"Nenhuma configuração disponível ","Save":"Salvar","Settings":"Configurações","Settings type not implemented: %{type}":"Tipo de configuração não implementado: %{type}"},"ru":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Уч.запись","Cancel":"Отмена","Hello":"Здравствуйте","Language":"Язык","Loading personal settings":"Загрузка личных настроек","Loading personal settings...":"Загрузка личных настроек…","msg":"сообщ","No settings available":"Нет доступных настроек","Save":"Сохранить","Settings":"Настройки","Settings type not implemented: %{type}":"Тип настроек не реализован: %{type}"},"sq":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Llogari","Cancel":"Anuloje","Hello":"Tungjatjeta","Language":"Gjuhë","Loading personal settings":"Ngarkim rregullimesh personale","Loading personal settings...":"Po ngarkohen rregullime personale…","msg":"msz","No settings available":"S’ka rregullime","Save":"Ruaje","Settings":"Rregullime","Settings type not implemented: %{type}":"Lloj rregullimi i pasendërtuar: %{type}"},"th_TH":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"บัญชี","Cancel":"ยกเลิก","Hello":"สวัสดี","Language":"ภาษา","Loading personal settings":"กำลังโหลดการตั้งค่าส่วนบุคคล","Loading personal settings...":"กำลังโหลดการตั้งค่าส่วนบุคคล...","msg":"msg","No settings available":"ไม่มีการตั้งค่า","Save":"บันทึก","Settings":"ตั้งค่า","Settings type not implemented: %{type}":"ประเภทการตั้งค่าที่ยังไม่ถูกดำเนินการ: %{type}"},"tr":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"Hesap","Cancel":"İptal","Hello":"Merhaba","Language":"Dil","Loading personal settings":"Kişisel ayarlar yükleniyor","Loading personal settings...":"Kişisel ayarlar yükleniyor...","msg":"msj","No settings available":"Kullanılabilir ayar yok.","Save":"Kaydet","Settings":"Ayarlar","Settings type not implemented: %{type}":"Ayar türü uygulanmadı: %{type}"},"zh_CN":{"{{ bundle.displayName }}":"{{ bundle.displayName }}","Account":"账户","Cancel":"取消","Hello":"你好","Language":"语言","Loading personal settings":"加载个人设置","Loading personal settings...":"加载个人设置...","msg":"msg","No settings available":"没有可用的设置","Save":"保存","Settings":"设置","Settings type not implemented: %{type}":"设置类型未实现:%{type}"}} \ No newline at end of file diff --git a/tests/acceptance/docker/Makefile b/tests/acceptance/docker/Makefile index e6b9ae25d17..7d23d9913e0 100644 --- a/tests/acceptance/docker/Makefile +++ b/tests/acceptance/docker/Makefile @@ -219,6 +219,7 @@ clean-docker-volumes: ## clean docker volumes created during acceptance tests docker-compose down --remove-orphans -v .PHONY: clean-files +clean-files: @$(MAKE) --no-print-directory -C ../. clean-tests .PHONY: clean diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index 3f2b56207b8..eef202227cd 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -536,16 +536,12 @@ cannot share a folder with create permission - [apiSharePublicLink2/reShareAsPublicLinkToSharesNewDav.feature:181](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink2/reShareAsPublicLinkToSharesNewDav.feature#L181) - [apiSharePublicLink2/reShareAsPublicLinkToSharesNewDav.feature:182](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink2/reShareAsPublicLinkToSharesNewDav.feature#L182) -#### [Removing the public link password is broken](https://github.com/owncloud/ocis/issues/4262) - -- [apiSharePublicLink3/updatePublicLinkShare.feature:165](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink3/updatePublicLinkShare.feature#L165) - #### [Adding public upload to a read only shared folder as a recipient is allowed ](https://github.com/owncloud/ocis/issues/2164) -- [apiSharePublicLink3/updatePublicLinkShare.feature:356](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink3/updatePublicLinkShare.feature#L356) -- [apiSharePublicLink3/updatePublicLinkShare.feature:357](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink3/updatePublicLinkShare.feature#L357) -- [apiSharePublicLink3/updatePublicLinkShare.feature:416](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink3/updatePublicLinkShare.feature#L416) -- [apiSharePublicLink3/updatePublicLinkShare.feature:417](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink3/updatePublicLinkShare.feature#L417) +- [apiSharePublicLink3/updatePublicLinkShare.feature:364](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink3/updatePublicLinkShare.feature#L364) +- [apiSharePublicLink3/updatePublicLinkShare.feature:365](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink3/updatePublicLinkShare.feature#L365) +- [apiSharePublicLink3/updatePublicLinkShare.feature:424](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink3/updatePublicLinkShare.feature#L424) +- [apiSharePublicLink3/updatePublicLinkShare.feature:425](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharePublicLink3/updatePublicLinkShare.feature#L425) #### [Upload-only shares must not overwrite but create a separate file](https://github.com/owncloud/ocis-reva/issues/286) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 2fe0ae8d122..53ea58b38fc 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -22,10 +22,6 @@ The expected failures in this file are from features in the owncloud/ocis repo. ### [Search by shares jail works incorrect](https://github.com/owncloud/ocis/issues/4014) - [apiSpaces/search.feature:43](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/search.feature#L43) -### [Space Admin still has access to the project despite being removed from it](https://github.com/owncloud/ocis/issues/4127) -- [apiSpaces/shareSpaces.feature:77](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSpaces.feature#L77) -- [apiSpaces/shareSpaces.feature:78](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/shareSpaces.feature#L78) - ### [Depth infinity not supported for space Shares Jail](https://github.com/owncloud/ocis/issues/4188) - [apiSpaces/copySpaces.feature:112](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/copySpaces.feature#L112) - [apiSpaces/copySpaces.feature:113](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/copySpaces.feature#L113) @@ -43,5 +39,7 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiSpaces/moveSpaces.feature:186](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/moveSpaces.feature#L186) - [apiSpaces/moveSpaces.feature:189](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/moveSpaces.feature#L189) -### [A space manager cannot see the public links of another manager](https://github.com/owncloud/ocis/issues/4260) -- [apiSpaces/editPublicLinkOfSpace.feature:67](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature#L67) +### [User without space manager role cannot restore space](https://github.com/owncloud/ocis/issues/4027) + - [apiSpaces/restoreSpaces.feature:63](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/restoreSpaces.feature#L63) + - [apiSpaces/restoreSpaces.feature:64](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/restoreSpaces.feature#L64) + diff --git a/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature b/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature index e359dac65fa..764d0f63e5f 100644 --- a/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature +++ b/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature @@ -35,18 +35,15 @@ Feature: A manager of the space can edit public link And the OCS status code should be "200" And the OCS status message should be "OK" And the fields of the last response to user "Alice" should include - | item_type | folder | - | mimetype | httpd/unix-directory | - | file_target | / | - | path | / | - | permissions | | - | share_type | public_link | - | displayname_file_owner | %displayname% | - | displayname_owner | %displayname% | - | uid_file_owner | %username% | - | uid_owner | %username% | - | name | | - | expiration | | + | item_type | folder | + | mimetype | httpd/unix-directory | + | file_target | / | + | path | / | + | permissions | | + | share_type | public_link | + | displayname_owner | %displayname% | + | name | | + | expiration | | And the public should be able to download file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "" And the downloaded content should be "some content" Examples: @@ -65,8 +62,8 @@ Feature: A manager of the space can edit public link Examples: | role | shouldOrNot | | manager | should | - | editor | should not | - | viewer | should not | + | editor | should | + | viewer | should | Scenario Outline: Members of the space try to edit a public link diff --git a/tests/acceptance/features/apiSpaces/shareSpacesViaLink.feature b/tests/acceptance/features/apiSpaces/shareSpacesViaLink.feature index 8260c4a52fb..643157df974 100644 --- a/tests/acceptance/features/apiSpaces/shareSpacesViaLink.feature +++ b/tests/acceptance/features/apiSpaces/shareSpacesViaLink.feature @@ -32,9 +32,7 @@ Feature: Share spaces via link | path | / | | permissions | | | share_type | public_link | - | displayname_file_owner | %displayname% | | displayname_owner | %displayname% | - | uid_file_owner | %username% | | uid_owner | %username% | | name | | And the public should be able to download file "/test.txt" from inside the last public link shared folder using the new public WebDAV API with password "" @@ -57,17 +55,15 @@ Feature: Share spaces via link And the OCS status code should be "200" And the OCS status message should be "OK" And the fields of the last response to user "Alice" should include - | item_type | folder | - | mimetype | httpd/unix-directory | - | file_target | / | - | path | / | - | permissions | create | - | share_type | public_link | - | displayname_file_owner | %displayname% | - | displayname_owner | %displayname% | - | uid_file_owner | %username% | - | uid_owner | %username% | - | name | forUpload | + | item_type | folder | + | mimetype | httpd/unix-directory | + | file_target | / | + | path | / | + | permissions | create | + | share_type | public_link | + | displayname_owner | %displayname% | + | uid_owner | %username% | + | name | forUpload | And the public should be able to upload file "lorem.txt" into the last public link shared folder using the new public WebDAV API with password "123" And for user "Alice" the space "share space" should contain these entries: | lorem.txt | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 1dd8cb2e1fc..b95f252295d 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -267,8 +267,9 @@ class SpacesContext implements Context { $this->theUserListsAllAvailableSpacesUsingTheGraphApi($user); $spaces = $this->getAvailableSpaces(); - Assert::assertIsArray($spaces[$spaceName], "Space with name $spaceName for user $user not found"); - Assert::assertNotEmpty($spaces[$spaceName]["root"]["webDavUrl"], "WebDavUrl for space with name $spaceName for user $user not found"); + Assert::assertArrayHasKey($spaceName, $spaces, "Space with name '$spaceName' for user '$user' not found"); + Assert::assertIsArray($spaces[$spaceName], "Data for space with name '$spaceName' for user '$user' not found"); + Assert::assertNotEmpty($spaces[$spaceName]["root"]["webDavUrl"], "WebDavUrl for space with name '$spaceName' for user '$user' not found"); return $spaces[$spaceName]; } @@ -2842,18 +2843,12 @@ class SpacesContext implements Context { string $shouldOrNot ): void { $space = $this->getSpaceByName($user, $spaceName); - $url = "/apps/files_sharing/api/v1/shares"; - - $bodyTable = new TableNode([ - ["space_ref", $space['id']], - ["reshares", true], - ]); + $url = "/apps/files_sharing/api/v1/shares?reshares=true&space_ref=" . $space['id']; $this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody( $user, 'GET', $url, - $bodyTable ); $should = ($shouldOrNot !== "not");