Skip to content

Commit

Permalink
chore: bump reva
Browse files Browse the repository at this point in the history
  • Loading branch information
fschade committed Jun 18, 2024
1 parent 1f012ac commit b989156
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 126 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/coreos/go-oidc/v3 v3.10.0
github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781
github.com/cs3org/reva/v2 v2.19.2-0.20240613123928-7fb5f11a24cf
github.com/cs3org/reva/v2 v2.19.2-0.20240618080316-ed0273c9db9b
github.com/dhowden/tag v0.0.0-20230630033851-978a0926ee25
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
github.com/egirna/icap-client v0.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1025,8 +1025,8 @@ github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c=
github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME=
github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781 h1:BUdwkIlf8IS2FasrrPg8gGPHQPOrQ18MS1Oew2tmGtY=
github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cs3org/reva/v2 v2.19.2-0.20240613123928-7fb5f11a24cf h1:AQLf+bZfcEn4zKQiH5vLtBpOx7onvbCQ4Z9X4i6SKNM=
github.com/cs3org/reva/v2 v2.19.2-0.20240613123928-7fb5f11a24cf/go.mod h1:Rb2XnhpGKnH7k6WBFZlMygbyBxW6ma09Z4Uk+ro0v+A=
github.com/cs3org/reva/v2 v2.19.2-0.20240618080316-ed0273c9db9b h1:IPFiNd8Xev9WxAt+LkJUxnbyU8Y1rGi5Ha0S+ZNObr8=
github.com/cs3org/reva/v2 v2.19.2-0.20240618080316-ed0273c9db9b/go.mod h1:Rb2XnhpGKnH7k6WBFZlMygbyBxW6ma09Z4Uk+ro0v+A=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
Expand Down
23 changes: 0 additions & 23 deletions services/frontend/pkg/command/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package command
import (
"context"
"errors"
"fmt"

"github.com/cs3org/reva/v2/pkg/events"
"github.com/cs3org/reva/v2/pkg/events/stream"
Expand Down Expand Up @@ -187,25 +186,3 @@ func updateShareRequest(shareID *collaboration.ShareId, uid *user.UserId) *colla
UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"state"}},
}
}

// getSharesList gets the list of all shares for the given user.
func getSharesList(ctx context.Context, gatewaySelector pool.Selectable[gateway.GatewayAPIClient], uid *user.UserId) (*collaboration.ListReceivedSharesResponse, error) {
gwc, err := gatewaySelector.Next()
if err != nil {
return nil, err
}
shares, err := gwc.ListReceivedShares(ctx, &collaboration.ListReceivedSharesRequest{
Opaque: utils.AppendJSONToOpaque(nil, "userid", uid),
})
if err != nil {
return nil, err
}

if shares.Status.Code != rpc.Code_CODE_OK {
if shares.Status.Code == rpc.Code_CODE_NOT_FOUND {
return nil, fmt.Errorf("not found")
}
return nil, fmt.Errorf(shares.GetStatus().GetMessage())
}
return shares, nil
}
16 changes: 12 additions & 4 deletions services/graph/pkg/errorcode/errorcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,19 @@ func (e Error) GetCode() ErrorCode {

// RenderError render the Graph Error based on a code or default one
func RenderError(w http.ResponseWriter, r *http.Request, err error) {
var errcode Error
if errors.As(err, &errcode) {
errcode.Render(w, r)
RenderErrorWithMessage(w, r, err, err.Error())
}

// RenderErrorWithMessage renders the error,
// but instead of using the error string which could contain private information,
// it uses the msg string.
func RenderErrorWithMessage(w http.ResponseWriter, r *http.Request, err error, msg string) {
var e Error
if errors.As(err, &e) {
e.msg = msg
e.Render(w, r)
return
}

GeneralException.Render(w, r, http.StatusInternalServerError, err.Error())
GeneralException.Render(w, r, http.StatusInternalServerError, msg)
}
8 changes: 4 additions & 4 deletions services/graph/pkg/service/v0/api_drives_drive_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ func (api DrivesDriveItemApi) DeleteDriveItem(w http.ResponseWriter, r *http.Req

shareID := ExtractShareIdFromResourceId(itemID)
if err := api.drivesDriveItemService.UnmountShare(ctx, shareID); err != nil {
api.logger.Debug().Err(err).Msg(err.Error())
errorcode.RenderError(w, r, err)
api.logger.Debug().Err(err).Msg(ErrUnmountShare.Error())
errorcode.RenderErrorWithMessage(w, r, err, ErrUnmountShare.Error())
return
}

Expand Down Expand Up @@ -518,8 +518,8 @@ func (api DrivesDriveItemApi) CreateDriveItem(w http.ResponseWriter, r *http.Req

mountedShares, err := api.drivesDriveItemService.MountShare(ctx, &resourceId, requestDriveItem.GetName())
if err != nil {
api.logger.Debug().Err(err).Msg(err.Error())
errorcode.RenderError(w, r, err)
api.logger.Debug().Err(err).Msg(ErrMountShare.Error())
errorcode.RenderErrorWithMessage(w, r, err, ErrMountShare.Error())
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ Feature: enable or disable sync of incoming shares
| permissionsRole | Viewer |
And the user "Admin" has deleted a user "Alice"
When user "Brian" tries to enable share sync of a resource "<<FILEID>>" using the Graph API
Then the HTTP status code should be "400"
Then the HTTP status code should be "404"
And the JSON data of the response should match
"""
{
Expand All @@ -443,7 +443,7 @@ Feature: enable or disable sync of incoming shares
],
"properties": {
"code" : {
"const": "invalidRequest"
"const": "itemNotFound"
},
"innererror" : {
"type": "object",
Expand All @@ -453,7 +453,7 @@ Feature: enable or disable sync of incoming shares
]
},
"message" : {
"const": "converting to drive items failed"
"const": "mounting share failed"
}
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,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.19.2-0.20240613123928-7fb5f11a24cf
# github.com/cs3org/reva/v2 v2.19.2-0.20240618080316-ed0273c9db9b
## explicit; go 1.21
github.com/cs3org/reva/v2/cmd/revad/internal/grace
github.com/cs3org/reva/v2/cmd/revad/runtime
Expand Down

0 comments on commit b989156

Please sign in to comment.