fix:[OCISDEV-617] Expose the signature-auth attribute

This commit is contained in:
Roman Perekhod
2026-02-13 12:20:12 +01:00
parent 76b9843d08
commit 5be7db71b9
5 changed files with 13 additions and 7 deletions

View File

@@ -0,0 +1,6 @@
Bugfix: Expose the signature-auth attribute
Expose the "oc:signature-auth" attribute for the subfolders in the public link propfinds.
This is a necessary change to be able to support archive downloads in password protected public links.
https://github.com/owncloud/ocis/pull/12016

2
go.mod
View File

@@ -64,7 +64,7 @@ require (
github.com/open-policy-agent/opa v1.12.3
github.com/orcaman/concurrent-map v1.0.0
github.com/owncloud/libre-graph-api-go v1.0.5-0.20260116104114-10074a92be64
github.com/owncloud/reva/v2 v2.0.0-20260206095425-032663e2f51a
github.com/owncloud/reva/v2 v2.0.0-20260213104810-a8d45f58b2d5
github.com/pkg/errors v0.9.1
github.com/pkg/xattr v0.4.12
github.com/prometheus/client_golang v1.23.2

4
go.sum
View File

@@ -742,8 +742,8 @@ github.com/orcaman/concurrent-map v1.0.0 h1:I/2A2XPCb4IuQWcQhBhSwGfiuybl/J0ev9HD
github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI=
github.com/owncloud/libre-graph-api-go v1.0.5-0.20260116104114-10074a92be64 h1:z9djjzd+leAy6QZpi8dLy3OVjc/um+1XAGk1SJEvwE8=
github.com/owncloud/libre-graph-api-go v1.0.5-0.20260116104114-10074a92be64/go.mod h1:z61VMGAJRtR1nbgXWiNoCkxUXP1B3Je9rMuJbnGd+Og=
github.com/owncloud/reva/v2 v2.0.0-20260206095425-032663e2f51a h1:XvU5fvmqFzs9pT+JAZHR0QHY1KsCemNAJp000QkPqrM=
github.com/owncloud/reva/v2 v2.0.0-20260206095425-032663e2f51a/go.mod h1:ahCZbT/ltp5J8aURUpTOfpA/dLBeTvHaMm772cvj7+U=
github.com/owncloud/reva/v2 v2.0.0-20260213104810-a8d45f58b2d5 h1:JyDXgzdkdfAPt9uRMQu49AreYpaUl+RinrNVITyfHu4=
github.com/owncloud/reva/v2 v2.0.0-20260213104810-a8d45f58b2d5/go.mod h1:ahCZbT/ltp5J8aURUpTOfpA/dLBeTvHaMm772cvj7+U=
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw=
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0=
github.com/pablodz/inotifywaitgo v0.0.9 h1:njquRbBU7fuwIe5rEvtaniVBjwWzcpdUVptSgzFqZsw=

View File

@@ -37,6 +37,7 @@ import (
link "github.com/cs3org/go-cs3apis/cs3/sharing/link/v1beta1"
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
typesv1beta1 "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
"github.com/iancoleman/strcase"
"github.com/owncloud/reva/v2/internal/grpc/services/storageprovider"
"github.com/owncloud/reva/v2/internal/http/services/owncloud/ocdav/config"
"github.com/owncloud/reva/v2/internal/http/services/owncloud/ocdav/errors"
@@ -52,7 +53,6 @@ import (
"github.com/owncloud/reva/v2/pkg/rhttp/router"
"github.com/owncloud/reva/v2/pkg/storagespace"
"github.com/owncloud/reva/v2/pkg/utils"
"github.com/iancoleman/strcase"
"github.com/rs/zerolog"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
@@ -1538,8 +1538,8 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p
}
case "signature-auth":
if isPublic {
// We only want to add the attribute to the root of the propfind.
if strings.HasSuffix(p, ls.Token) && ls.Signature != nil {
// Required to support archive downloads in password-protected public links.
if strings.Contains(p, ls.Token) && ls.Signature != nil {
expiration := time.Unix(int64(ls.Signature.SignatureExpiration.Seconds), int64(ls.Signature.SignatureExpiration.Nanos))
var sb strings.Builder
sb.WriteString("<oc:signature>")

2
vendor/modules.txt vendored
View File

@@ -1313,7 +1313,7 @@ github.com/orcaman/concurrent-map
# github.com/owncloud/libre-graph-api-go v1.0.5-0.20260116104114-10074a92be64
## explicit; go 1.18
github.com/owncloud/libre-graph-api-go
# github.com/owncloud/reva/v2 v2.0.0-20260206095425-032663e2f51a
# github.com/owncloud/reva/v2 v2.0.0-20260213104810-a8d45f58b2d5
## explicit; go 1.24.0
github.com/owncloud/reva/v2/cmd/revad/internal/grace
github.com/owncloud/reva/v2/cmd/revad/runtime