diff --git a/changelog/unreleased/fix-sharees-api.md b/changelog/unreleased/fix-sharees-api.md new file mode 100644 index 0000000000..b05f657866 --- /dev/null +++ b/changelog/unreleased/fix-sharees-api.md @@ -0,0 +1,5 @@ +Bugfix: Fix response format of the sharees API + +The sharees API wasn't returning the users and groups arrays correctly. + +https://github.com/cs3org/reva/pull/1954 diff --git a/internal/http/services/owncloud/ocs/conversions/main.go b/internal/http/services/owncloud/ocs/conversions/main.go index ffd714fded..0097f84b9b 100644 --- a/internal/http/services/owncloud/ocs/conversions/main.go +++ b/internal/http/services/owncloud/ocs/conversions/main.go @@ -146,21 +146,21 @@ type ShareData struct { // ShareeData holds share recipient search results type ShareeData struct { Exact *ExactMatchesData `json:"exact" xml:"exact"` - Users []*MatchData `json:"users" xml:"users"` - Groups []*MatchData `json:"groups" xml:"groups"` - Remotes []*MatchData `json:"remotes" xml:"remotes"` + Users []*MatchData `json:"users" xml:"users>element"` + Groups []*MatchData `json:"groups" xml:"groups>element"` + Remotes []*MatchData `json:"remotes" xml:"remotes>element"` } // ExactMatchesData hold exact matches type ExactMatchesData struct { - Users []*MatchData `json:"users" xml:"users"` - Groups []*MatchData `json:"groups" xml:"groups"` - Remotes []*MatchData `json:"remotes" xml:"remotes"` + Users []*MatchData `json:"users" xml:"users>element"` + Groups []*MatchData `json:"groups" xml:"groups>element"` + Remotes []*MatchData `json:"remotes" xml:"remotes>element"` } // MatchData describes a single match type MatchData struct { - Label string `json:"label" xml:"label"` + Label string `json:"label" xml:"label,omitempty"` Value *MatchValueData `json:"value" xml:"value"` } diff --git a/tests/acceptance/expected-failures-on-OCIS-storage.md b/tests/acceptance/expected-failures-on-OCIS-storage.md index c606cecaef..8a062495e4 100644 --- a/tests/acceptance/expected-failures-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-on-OCIS-storage.md @@ -335,14 +335,9 @@ File and sync features in a shared scenario - [apiWebdavEtagPropagation1/moveFileFolder.feature:315](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavEtagPropagation1/moveFileFolder.feature#L315) #### [Searching sharee with displayname](https://github.com/owncloud/ocis/issues/547) -- [apiSharees/sharees.feature:32](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L32) -- [apiSharees/sharees.feature:33](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L33) -- [apiSharees/sharees.feature:53](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L53) -- [apiSharees/sharees.feature:54](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L54) +These tests fail because they contain some configuration steps for oc10 specific configuration. - [apiSharees/sharees.feature:74](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L74) - [apiSharees/sharees.feature:75](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L75) -- [apiSharees/sharees.feature:98](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L98) -- [apiSharees/sharees.feature:99](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L99) - [apiSharees/sharees.feature:118](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L118) - [apiSharees/sharees.feature:119](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L119) - [apiSharees/sharees.feature:137](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L137) @@ -365,42 +360,33 @@ File and sync features in a shared scenario - [apiSharees/sharees.feature:298](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L298) - [apiSharees/sharees.feature:317](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L317) - [apiSharees/sharees.feature:318](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L318) -- [apiSharees/sharees.feature:336](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L336) -- [apiSharees/sharees.feature:337](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L337) -- [apiSharees/sharees.feature:355](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L355) -- [apiSharees/sharees.feature:356](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L356) -- [apiSharees/sharees.feature:374](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L374) -- [apiSharees/sharees.feature:375](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L375) -- [apiSharees/sharees.feature:393](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L393) -- [apiSharees/sharees.feature:394](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L394) -- [apiSharees/sharees.feature:412](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L412) -- [apiSharees/sharees.feature:413](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L413) -- [apiSharees/sharees.feature:430](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L430) -- [apiSharees/sharees.feature:431](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L431) - [apiSharees/sharees.feature:450](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L450) - [apiSharees/sharees.feature:451](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L451) -- [apiSharees/sharees.feature:475](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L475) -- [apiSharees/sharees.feature:476](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L476) - [apiSharees/sharees.feature:495](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L495) - [apiSharees/sharees.feature:496](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L496) - [apiSharees/sharees.feature:515](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L515) - [apiSharees/sharees.feature:516](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L516) - [apiSharees/sharees.feature:537](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L537) - [apiSharees/sharees.feature:538](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L538) -- [apiSharees/sharees.feature:560](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L560) -- [apiSharees/sharees.feature:561](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L561) - [apiSharees/sharees.feature:586](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L586) - [apiSharees/sharees.feature:587](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L587) - [apiSharees/sharees.feature:607](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L607) - [apiSharees/sharees.feature:608](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L608) -- [apiSharees/sharees.feature:632](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L632) -- [apiSharees/sharees.feature:633](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L633) -- [apiSharees/sharees.feature:657](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L657) -- [apiSharees/sharees.feature:658](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L658) - [apiSharees/sharees.feature:682](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L682) - [apiSharees/sharees.feature:683](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L683) - [apiSharees/sharees.feature:702](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L702) - [apiSharees/sharees.feature:703](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L703) +These tests fail because we currently can't differentiate between exact matches and not exact matches. +- [apiSharees/sharees.feature:336](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L336) +- [apiSharees/sharees.feature:337](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L337) +- [apiSharees/sharees.feature:355](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L355) +- [apiSharees/sharees.feature:356](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L356) +- [apiSharees/sharees.feature:374](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L374) +- [apiSharees/sharees.feature:375](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L375) +- [apiSharees/sharees.feature:393](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L393) +- [apiSharees/sharees.feature:394](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L394) +- [apiSharees/sharees.feature:412](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L412) +- [apiSharees/sharees.feature:413](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L413) #### User cannot create a folder named Share - [apiShareManagementToShares/acceptShares.feature:291](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L291) diff --git a/tests/acceptance/expected-failures-on-S3NG-storage.md b/tests/acceptance/expected-failures-on-S3NG-storage.md index c9f736c2d0..ffacc7ab96 100644 --- a/tests/acceptance/expected-failures-on-S3NG-storage.md +++ b/tests/acceptance/expected-failures-on-S3NG-storage.md @@ -341,14 +341,9 @@ File and sync features in a shared scenario - [apiWebdavEtagPropagation1/moveFileFolder.feature:315](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavEtagPropagation1/moveFileFolder.feature#L315) #### [Searching sharee with displayname](https://github.com/owncloud/ocis/issues/547) -- [apiSharees/sharees.feature:32](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L32) -- [apiSharees/sharees.feature:33](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L33) -- [apiSharees/sharees.feature:53](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L53) -- [apiSharees/sharees.feature:54](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L54) +These tests fail because they contain some configuration steps for oc10 specific configuration. - [apiSharees/sharees.feature:74](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L74) - [apiSharees/sharees.feature:75](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L75) -- [apiSharees/sharees.feature:98](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L98) -- [apiSharees/sharees.feature:99](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L99) - [apiSharees/sharees.feature:118](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L118) - [apiSharees/sharees.feature:119](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L119) - [apiSharees/sharees.feature:137](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L137) @@ -371,42 +366,33 @@ File and sync features in a shared scenario - [apiSharees/sharees.feature:298](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L298) - [apiSharees/sharees.feature:317](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L317) - [apiSharees/sharees.feature:318](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L318) -- [apiSharees/sharees.feature:336](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L336) -- [apiSharees/sharees.feature:337](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L337) -- [apiSharees/sharees.feature:355](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L355) -- [apiSharees/sharees.feature:356](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L356) -- [apiSharees/sharees.feature:374](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L374) -- [apiSharees/sharees.feature:375](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L375) -- [apiSharees/sharees.feature:393](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L393) -- [apiSharees/sharees.feature:394](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L394) -- [apiSharees/sharees.feature:412](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L412) -- [apiSharees/sharees.feature:413](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L413) -- [apiSharees/sharees.feature:430](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L430) -- [apiSharees/sharees.feature:431](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L431) - [apiSharees/sharees.feature:450](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L450) - [apiSharees/sharees.feature:451](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L451) -- [apiSharees/sharees.feature:475](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L475) -- [apiSharees/sharees.feature:476](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L476) - [apiSharees/sharees.feature:495](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L495) - [apiSharees/sharees.feature:496](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L496) - [apiSharees/sharees.feature:515](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L515) - [apiSharees/sharees.feature:516](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L516) - [apiSharees/sharees.feature:537](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L537) - [apiSharees/sharees.feature:538](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L538) -- [apiSharees/sharees.feature:560](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L560) -- [apiSharees/sharees.feature:561](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L561) - [apiSharees/sharees.feature:586](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L586) - [apiSharees/sharees.feature:587](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L587) - [apiSharees/sharees.feature:607](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L607) - [apiSharees/sharees.feature:608](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L608) -- [apiSharees/sharees.feature:632](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L632) -- [apiSharees/sharees.feature:633](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L633) -- [apiSharees/sharees.feature:657](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L657) -- [apiSharees/sharees.feature:658](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L658) - [apiSharees/sharees.feature:682](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L682) - [apiSharees/sharees.feature:683](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L683) - [apiSharees/sharees.feature:702](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L702) - [apiSharees/sharees.feature:703](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L703) +These tests fail because we currently can't differentiate between exact matches and not exact matches. +- [apiSharees/sharees.feature:336](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L336) +- [apiSharees/sharees.feature:337](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L337) +- [apiSharees/sharees.feature:355](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L355) +- [apiSharees/sharees.feature:356](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L356) +- [apiSharees/sharees.feature:374](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L374) +- [apiSharees/sharees.feature:375](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L375) +- [apiSharees/sharees.feature:393](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L393) +- [apiSharees/sharees.feature:394](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L394) +- [apiSharees/sharees.feature:412](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L412) +- [apiSharees/sharees.feature:413](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSharees/sharees.feature#L413) #### User cannot create a folder named Share - [apiShareManagementToShares/acceptShares.feature:291](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L291)