fix: update reva to fix status codes

This commit is contained in:
Michael Barz
2024-01-02 12:06:07 +01:00
parent a3a9757c48
commit e7a46dca55
7 changed files with 13 additions and 4 deletions
@@ -709,7 +709,7 @@ func (s *svc) Move(ctx context.Context, req *provider.MoveRequest) (*provider.Mo
if sourceProviderInfo.Address != destProviderInfo.Address {
return &provider.MoveResponse{
Status: status.NewUnimplemented(ctx, nil, "gateway does not support cross storage move, use copy and delete"),
Status: status.NewPermissionDenied(ctx, nil, "cross storage moves are not permitted, use copy and delete"),
}, nil
}
@@ -666,7 +666,7 @@ func (s *service) Move(ctx context.Context, req *provider.MoveRequest) (*provide
if dstReceivedShare.Share.Id.OpaqueId != srcReceivedShare.Share.Id.OpaqueId {
return &provider.MoveResponse{
Status: status.NewUnimplemented(ctx, nil, "sharesstorageprovider: can not move between shares"),
Status: status.NewPermissionDenied(ctx, nil, "cross storage moves are not permitted, use copy and delete"),
}, nil
}
@@ -281,6 +281,8 @@ func (s *svc) handleMove(ctx context.Context, w http.ResponseWriter, r *http.Req
switch mRes.Status.Code {
case rpc.Code_CODE_ABORTED:
status = http.StatusPreconditionFailed
case rpc.Code_CODE_PERMISSION_DENIED:
status = http.StatusForbidden
case rpc.Code_CODE_UNIMPLEMENTED:
// We translate this into a Bad Gateway error as per https://www.rfc-editor.org/rfc/rfc4918#section-9.9.4
// > 502 (Bad Gateway) - This may occur when the destination is on another