Merge pull request #6590 from kobergj/BumpReva

[full-ci] Bump Reva
This commit is contained in:
Phil Davis
2023-06-23 16:16:31 +05:45
committed by GitHub
9 changed files with 49 additions and 33 deletions

View File

@@ -28,3 +28,4 @@ https://github.com/owncloud/ocis/pull/6529
https://github.com/owncloud/ocis/pull/6544
https://github.com/owncloud/ocis/pull/6507
https://github.com/owncloud/ocis/pull/6572
https://github.com/owncloud/ocis/pull/6590

2
go.mod
View File

@@ -13,7 +13,7 @@ require (
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/coreos/go-oidc/v3 v3.6.0
github.com/cs3org/go-cs3apis v0.0.0-20230516150832-730ac860c71d
github.com/cs3org/reva/v2 v2.14.1-0.20230621095551-a4c97189e11a
github.com/cs3org/reva/v2 v2.14.1-0.20230623085734-919a9585f147
github.com/disintegration/imaging v1.6.2
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
github.com/egirna/icap-client v0.1.1

4
go.sum
View File

@@ -625,8 +625,8 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo
github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4=
github.com/crewjam/saml v0.4.13 h1:TYHggH/hwP7eArqiXSJUvtOPNzQDyQ7vwmwEqlFWhMc=
github.com/crewjam/saml v0.4.13/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA=
github.com/cs3org/reva/v2 v2.14.1-0.20230621095551-a4c97189e11a h1:MKQ3H+hxw7geL2ih7wdhIF/YGFY2F1Bl8HBt6WTTkwk=
github.com/cs3org/reva/v2 v2.14.1-0.20230621095551-a4c97189e11a/go.mod h1:E32krZG159YflDSjDWfx/QGIC2529PS5LiPnGNHu3d0=
github.com/cs3org/reva/v2 v2.14.1-0.20230623085734-919a9585f147 h1:2NXX7yxaUNRQ9k8JRFOoyrvWhV/NG0RLd5QsWqxy3R0=
github.com/cs3org/reva/v2 v2.14.1-0.20230623085734-919a9585f147/go.mod h1:E32krZG159YflDSjDWfx/QGIC2529PS5LiPnGNHu3d0=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=

View File

@@ -57,16 +57,6 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiCors/cors.feature:70](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCors/cors.feature#L70)
- [apiCors/cors.feature:71](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiCors/cors.feature#L71)
#### [POST response does not return correct path when creating public link](https://github.com/owncloud/ocis/issues/5139)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:63](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L63)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:64](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L64)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:65](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L65)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:93](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L93)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:167](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L167)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:168](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L168)
- [apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature:169](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/shareSubItemOfSpaceViaPublicLink.feature#L169)
#### [A User can get information of another user with Graph API](https://github.com/owncloud/ocis/issues/5125)
- [apiGraph/getUser.feature:83](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/getUser.feature#L83)

View File

@@ -151,16 +151,16 @@ Feature: Share a file or folder that is inside a space via public link
| shareType | 3 |
| permissions | 1 |
Then the fields of the last response to user "Alice" should include
| item_type | file |
| mimetype | text/plain |
| file_target | /file.txt |
| path | folder/file.txt |
| permissions | 1 |
| share_type | public_link |
| displayname_file_owner | %displayname% |
| displayname_owner | %displayname% |
| uid_file_owner | %username% |
| uid_owner | %username% |
| item_type | file |
| mimetype | text/plain |
| file_target | /file.txt |
| path | /folder/file.txt |
| permissions | 1 |
| share_type | public_link |
| displayname_file_owner | |
| displayname_owner | %displayname% |
#| uid_file_owner | %username% |
| uid_owner | %username% |
And for user "Brian" the space "share sub-item" should contain the last created public link of the file "folder/file.txt"
Examples:
| spaceRole |

View File

@@ -263,11 +263,13 @@ func (s *svc) Handler() http.Handler {
rw.Header().Set("Content-Transfer-Encoding", "binary")
// create the archive
var closeArchive func()
if userAgent.OS == ua.Windows {
err = arch.CreateZip(ctx, rw)
closeArchive, err = arch.CreateZip(ctx, rw)
} else {
err = arch.CreateTar(ctx, rw)
closeArchive, err = arch.CreateTar(ctx, rw)
}
defer closeArchive()
if err != nil {
s.writeHTTPError(rw, err)

View File

@@ -61,8 +61,11 @@ func NewArchiver(r []*provider.ResourceId, w walker.Walker, d downloader.Downloa
}
// CreateTar creates a tar and write it into the dst Writer
func (a *Archiver) CreateTar(ctx context.Context, dst io.Writer) error {
func (a *Archiver) CreateTar(ctx context.Context, dst io.Writer) (func(), error) {
w := tar.NewWriter(dst)
closer := func() {
_ = w.Close()
}
var filesCount, sizeFiles int64
@@ -125,16 +128,19 @@ func (a *Archiver) CreateTar(ctx context.Context, dst io.Writer) error {
})
if err != nil {
return err
return closer, err
}
}
return w.Close()
return closer, nil
}
// CreateZip creates a zip and write it into the dst Writer
func (a *Archiver) CreateZip(ctx context.Context, dst io.Writer) error {
func (a *Archiver) CreateZip(ctx context.Context, dst io.Writer) (func(), error) {
w := zip.NewWriter(dst)
closer := func() {
_ = w.Close()
}
var filesCount, sizeFiles int64
@@ -193,11 +199,11 @@ func (a *Archiver) CreateZip(ctx context.Context, dst io.Writer) error {
})
if err != nil {
return err
return closer, err
}
}
return w.Close()
return closer, nil
}
func isSpaceRoot(info *provider.ResourceInfo) bool {

View File

@@ -308,7 +308,8 @@ func (h *Handler) CreateShare(w http.ResponseWriter, r *http.Request) {
}
s := conversions.PublicShare2ShareData(share, r, h.publicURL)
h.addFileInfo(ctx, s, statRes.Info)
h.addFileInfo(ctx, s, statRes.GetInfo())
h.addPath(ctx, s, statRes.GetInfo())
h.mapUserIds(ctx, client, s)
response.WriteOCSSuccess(w, r, s)
@@ -1225,6 +1226,22 @@ func (h *Handler) addFileInfo(ctx context.Context, s *conversions.ShareData, inf
s.SpaceAlias = utils.ReadPlainFromOpaque(info.GetSpace().GetOpaque(), "spaceAlias")
}
// addPath adds the complete path of the `ResourceInfo` to the `ShareData`. It is an expensive operation and might leak data so use it with care.
func (h *Handler) addPath(ctx context.Context, s *conversions.ShareData, info *provider.ResourceInfo) {
log := appctx.GetLogger(ctx)
client, err := h.getClient()
if err != nil {
log.Error().Err(err).Msg("addPath failed: cannot get gateway client")
return
}
gpRes, err := client.GetPath(ctx, &provider.GetPathRequest{ResourceId: info.Id})
if err != nil || gpRes.GetStatus().GetCode() != rpc.Code_CODE_OK {
log.Error().Err(err).Interface("rpc response code", gpRes.GetStatus().GetCode()).Msg("addPath failed: cannot get path")
return
}
s.Path = gpRes.GetPath()
}
// mustGetIdentifiers always returns a struct with identifiers, if the user or group could not be found they will all be empty
func (h *Handler) mustGetIdentifiers(ctx context.Context, client gateway.GatewayAPIClient, id string, isGroup bool) *userIdentifiers {
sublog := appctx.GetLogger(ctx).With().Str("id", id).Logger()

2
vendor/modules.txt vendored
View File

@@ -352,7 +352,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1
github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1
github.com/cs3org/go-cs3apis/cs3/tx/v1beta1
github.com/cs3org/go-cs3apis/cs3/types/v1beta1
# github.com/cs3org/reva/v2 v2.14.1-0.20230621095551-a4c97189e11a
# github.com/cs3org/reva/v2 v2.14.1-0.20230623085734-919a9585f147
## explicit; go 1.20
github.com/cs3org/reva/v2/cmd/revad/internal/grace
github.com/cs3org/reva/v2/cmd/revad/runtime