Merge pull request #1063 from aduffeck/bump-reva-b8210a

Bump reva to pull in the latest fixes
This commit is contained in:
Andre Duffeck
2025-06-17 11:37:11 +02:00
committed by GitHub
8 changed files with 19 additions and 11 deletions

2
go.mod
View File

@@ -64,7 +64,7 @@ require (
github.com/onsi/gomega v1.37.0
github.com/open-policy-agent/opa v1.5.1
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20250603072916-fa601fb14450
github.com/opencloud-eu/reva/v2 v2.33.2-0.20250612080213-85468735dbd6
github.com/opencloud-eu/reva/v2 v2.33.2-0.20250617081629-b8210a01030e
github.com/orcaman/concurrent-map v1.0.0
github.com/pkg/errors v0.9.1
github.com/pkg/xattr v0.4.11

4
go.sum
View File

@@ -869,8 +869,8 @@ github.com/opencloud-eu/go-micro-plugins/v4/store/nats-js-kv v0.0.0-202505121527
github.com/opencloud-eu/go-micro-plugins/v4/store/nats-js-kv v0.0.0-20250512152754-23325793059a/go.mod h1:pjcozWijkNPbEtX5SIQaxEW/h8VAVZYTLx+70bmB3LY=
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20250603072916-fa601fb14450 h1:QWn9G2f1R/EbyZSbkjtd9jqNq9X0NIphmmD4KYLNZtA=
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20250603072916-fa601fb14450/go.mod h1:pzatilMEHZFT3qV7C/X3MqOa3NlRQuYhlRhZTL+hN6Q=
github.com/opencloud-eu/reva/v2 v2.33.2-0.20250612080213-85468735dbd6 h1:9NUMVWfrRIJtm41kPNc4bXjCsaIyerumuMx3rnFYNro=
github.com/opencloud-eu/reva/v2 v2.33.2-0.20250612080213-85468735dbd6/go.mod h1:o3ilVD4jpf3v6nk2oG9D7rCh/TRVEBAUOzH9z83d+Yc=
github.com/opencloud-eu/reva/v2 v2.33.2-0.20250617081629-b8210a01030e h1:NGAlzzIwtWBBHON+jyXlLwAlIe2v9PVpT90qSu+qLeA=
github.com/opencloud-eu/reva/v2 v2.33.2-0.20250617081629-b8210a01030e/go.mod h1:ky99pvvufLA7wxDHo5RoImfm4H9QqSyvZAHPkcdFTi8=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=

View File

@@ -63,7 +63,7 @@ func (s *svc) handleDelete(ctx context.Context, w http.ResponseWriter, r *http.R
req := &provider.DeleteRequest{
Ref: ref,
LockId: requestLockToken(r),
LockId: requestLock(r),
}
// FIXME the lock token is part of the application level protocol, it should be part of the DeleteRequest message not the opaque

View File

@@ -26,6 +26,7 @@ import (
"io"
"net/http"
"path"
"regexp"
"strconv"
"strings"
"time"
@@ -61,6 +62,8 @@ import (
// we stick to the recommendation and use the URN Namespace
const lockTokenPrefix = "urn:uuid:"
var requestLockRegex = regexp.MustCompile(`\(<(urn:uuid:[0-9a-fA-F-]+)>\)`)
// TODO(jfd) implement lock
// see Web Distributed Authoring and Versioning (WebDAV) Locking Protocol:
// https://www.greenbytes.de/tech/webdav/draft-reschke-webdav-locking-latest.html
@@ -694,6 +697,11 @@ func (s *svc) unlockReference(ctx context.Context, _ http.ResponseWriter, r *htt
return http.StatusInternalServerError, err
}
func requestLockToken(r *http.Request) string {
return strings.TrimSuffix(strings.TrimPrefix(r.Header.Get(net.HeaderLockToken), "<"), ">")
func requestLock(r *http.Request) string {
matches := requestLockRegex.FindStringSubmatch(r.Header.Get(net.HeaderIf))
if len(matches) < 2 {
return ""
}
return matches[1] // the first match is the whole string, the second is the token
}

View File

@@ -297,7 +297,7 @@ func (s *svc) handleMove(ctx context.Context, w http.ResponseWriter, r *http.Req
mReq := &provider.MoveRequest{
Source: src,
Destination: dst,
LockId: requestLockToken(r),
LockId: requestLock(r),
}
mRes, err := client.Move(ctx, mReq)
if err != nil {

View File

@@ -133,14 +133,14 @@ func (s *svc) handleProppatch(ctx context.Context, w http.ResponseWriter, r *htt
rreq := &provider.UnsetArbitraryMetadataRequest{
Ref: ref,
ArbitraryMetadataKeys: []string{""},
LockId: requestLockToken(r),
LockId: requestLock(r),
}
sreq := &provider.SetArbitraryMetadataRequest{
Ref: ref,
ArbitraryMetadata: &provider.ArbitraryMetadata{
Metadata: map[string]string{},
},
LockId: requestLockToken(r),
LockId: requestLock(r),
}
acceptedProps := []xml.Name{}

View File

@@ -276,7 +276,7 @@ func (s *svc) handlePut(ctx context.Context, w http.ResponseWriter, r *http.Requ
uReq := &provider.InitiateFileUploadRequest{
Ref: ref,
Opaque: opaque,
LockId: requestLockToken(r),
LockId: requestLock(r),
}
if ifMatch := r.Header.Get(net.HeaderIfMatch); ifMatch != "" {
uReq.Options = &provider.InitiateFileUploadRequest_IfMatch{IfMatch: ifMatch}

2
vendor/modules.txt vendored
View File

@@ -1210,7 +1210,7 @@ github.com/open-policy-agent/opa/v1/version
# github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20250603072916-fa601fb14450
## explicit; go 1.18
github.com/opencloud-eu/libre-graph-api-go
# github.com/opencloud-eu/reva/v2 v2.33.2-0.20250612080213-85468735dbd6
# github.com/opencloud-eu/reva/v2 v2.33.2-0.20250617081629-b8210a01030e
## explicit; go 1.24.1
github.com/opencloud-eu/reva/v2/cmd/revad/internal/grace
github.com/opencloud-eu/reva/v2/cmd/revad/runtime