From 07b6c1309b1e537e99605710149ff0e927c38cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Tue, 19 Nov 2024 09:06:26 +0100 Subject: [PATCH 1/2] Bump reva --- go.mod | 2 +- go.sum | 4 +-- .../applicationauth/applicationauth.go | 3 +- .../grpc/services/appprovider/appprovider.go | 3 +- .../grpc/services/appregistry/appregistry.go | 3 +- .../services/authprovider/authprovider.go | 3 +- .../services/authregistry/authregistry.go | 3 +- .../internal/grpc/services/datatx/datatx.go | 3 +- .../internal/grpc/services/gateway/gateway.go | 3 +- .../services/groupprovider/groupprovider.go | 3 +- .../grpc/services/helloworld/helloworld.go | 3 +- .../internal/grpc/services/ocmcore/ocmcore.go | 3 +- .../ocminvitemanager/ocminvitemanager.go | 3 +- .../ocmproviderauthorizer.go | 3 +- .../ocmshareprovider/ocmshareprovider.go | 3 +- .../grpc/services/permissions/permissions.go | 3 +- .../grpc/services/preferences/preferences.go | 3 +- .../publicshareprovider.go | 3 +- .../publicstorageprovider.go | 3 +- .../sharesstorageprovider.go | 3 +- .../storageprovider/storageprovider.go | 9 +++--- .../storageregistry/storageregistry.go | 3 +- .../services/userprovider/userprovider.go | 3 +- .../usershareprovider/usershareprovider.go | 3 +- .../services/dataprovider/dataprovider.go | 17 +++++----- .../storage/eoshomewrapper/eoshomewrapper.go | 3 +- .../pkg/cbox/storage/eoswrapper/eoswrapper.go | 3 +- .../reva/v2/pkg/ocm/storage/received/ocm.go | 3 +- .../cs3org/reva/v2/pkg/rgrpc/rgrpc.go | 4 +-- .../rhttp/datatx/manager/registry/registry.go | 4 ++- .../pkg/rhttp/datatx/manager/simple/simple.go | 16 +++++++--- .../pkg/rhttp/datatx/manager/spaces/spaces.go | 17 +++++++--- .../v2/pkg/rhttp/datatx/manager/tus/tus.go | 31 ++++++++++++++----- .../reva/v2/pkg/storage/fs/cephfs/cephfs.go | 3 +- .../v2/pkg/storage/fs/cephfs/unsupported.go | 3 +- .../cs3org/reva/v2/pkg/storage/fs/eos/eos.go | 3 +- .../reva/v2/pkg/storage/fs/eosgrpc/eosgrpc.go | 3 +- .../pkg/storage/fs/eosgrpchome/eosgrpchome.go | 3 +- .../reva/v2/pkg/storage/fs/eoshome/eoshome.go | 3 +- .../reva/v2/pkg/storage/fs/hello/hello.go | 3 +- .../reva/v2/pkg/storage/fs/local/local.go | 3 +- .../v2/pkg/storage/fs/localhome/localhome.go | 3 +- .../v2/pkg/storage/fs/nextcloud/nextcloud.go | 3 +- .../reva/v2/pkg/storage/fs/ocis/ocis.go | 3 +- .../pkg/storage/fs/owncloudsql/owncloudsql.go | 3 +- .../reva/v2/pkg/storage/fs/posix/posix.go | 5 +-- .../reva/v2/pkg/storage/fs/posix/tree/tree.go | 4 +-- .../v2/pkg/storage/fs/registry/registry.go | 3 +- .../cs3org/reva/v2/pkg/storage/fs/s3/s3.go | 3 +- .../reva/v2/pkg/storage/fs/s3ng/s3ng.go | 3 +- vendor/modules.txt | 2 +- 51 files changed, 151 insertions(+), 81 deletions(-) diff --git a/go.mod b/go.mod index 34600b1c8..e95ed7313 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible github.com/coreos/go-oidc/v3 v3.11.0 github.com/cs3org/go-cs3apis v0.0.0-20241105092511-3ad35d174fc1 - github.com/cs3org/reva/v2 v2.26.6-0.20241114152615-4ce61d4d09fc + github.com/cs3org/reva/v2 v2.26.6-0.20241119075849-6f05da66906b github.com/davidbyttow/govips/v2 v2.15.0 github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8 github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e diff --git a/go.sum b/go.sum index 5d053d44d..903f95716 100644 --- a/go.sum +++ b/go.sum @@ -255,8 +255,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-20241105092511-3ad35d174fc1 h1:RU6LT6mkD16xZs011+8foU7T3LrPvTTSWeTQ9OgfhkA= github.com/cs3org/go-cs3apis v0.0.0-20241105092511-3ad35d174fc1/go.mod h1:DedpcqXl193qF/08Y04IO0PpxyyMu8+GrkD6kWK2MEQ= -github.com/cs3org/reva/v2 v2.26.6-0.20241114152615-4ce61d4d09fc h1:uhBs3S2G8SpVd38uDzEWazIvR0U3GqL7VfevtkBequ4= -github.com/cs3org/reva/v2 v2.26.6-0.20241114152615-4ce61d4d09fc/go.mod h1:KP0Zomt3dNIr/kU2M1mXzTIVFOtxBVS4qmBDMRCfrOQ= +github.com/cs3org/reva/v2 v2.26.6-0.20241119075849-6f05da66906b h1:RrfFOwT3gZCqlzulV1tq/xfdVG/wvtfe0ChbPJoviv8= +github.com/cs3org/reva/v2 v2.26.6-0.20241119075849-6f05da66906b/go.mod h1:KP0Zomt3dNIr/kU2M1mXzTIVFOtxBVS4qmBDMRCfrOQ= 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= diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/applicationauth/applicationauth.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/applicationauth/applicationauth.go index 3aa6061df..579ea5b40 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/applicationauth/applicationauth.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/applicationauth/applicationauth.go @@ -29,6 +29,7 @@ import ( "github.com/cs3org/reva/v2/pkg/rgrpc/status" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -73,7 +74,7 @@ func parseConfig(m map[string]interface{}) (*config, error) { } // New creates a app auth provider svc -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/appprovider/appprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/appprovider/appprovider.go index 14a69fcf6..eb9b58944 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/appprovider/appprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/appprovider/appprovider.go @@ -39,6 +39,7 @@ import ( "github.com/cs3org/reva/v2/pkg/utils" "github.com/juliangruber/go-intersect" "github.com/mitchellh/mapstructure" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -84,7 +85,7 @@ func parseConfig(m map[string]interface{}) (*config, error) { } // New creates a new AppProviderService -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/appregistry/appregistry.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/appregistry/appregistry.go index a31c556b4..46bd6a64c 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/appregistry/appregistry.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/appregistry/appregistry.go @@ -30,6 +30,7 @@ import ( "github.com/cs3org/reva/v2/pkg/rgrpc" "github.com/cs3org/reva/v2/pkg/rgrpc/status" "github.com/mitchellh/mapstructure" + "github.com/rs/zerolog" ) func init() { @@ -64,7 +65,7 @@ func (c *config) init() { } // New creates a new StorageRegistryService -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/authprovider/authprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/authprovider/authprovider.go index ec2ca9dc6..e8db9757d 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/authprovider/authprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/authprovider/authprovider.go @@ -33,6 +33,7 @@ import ( "github.com/cs3org/reva/v2/pkg/rgrpc/status" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -95,7 +96,7 @@ func getAuthManager(manager string, m map[string]map[string]interface{}) (auth.M } // New returns a new AuthProviderServiceServer. -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/authregistry/authregistry.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/authregistry/authregistry.go index 51967f76f..999843d2b 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/authregistry/authregistry.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/authregistry/authregistry.go @@ -28,6 +28,7 @@ import ( "github.com/cs3org/reva/v2/pkg/rgrpc" "github.com/cs3org/reva/v2/pkg/rgrpc/status" "github.com/mitchellh/mapstructure" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -66,7 +67,7 @@ func (c *config) init() { } // New creates a new AuthRegistry -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/datatx/datatx.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/datatx/datatx.go index c43e75ec8..f0a1491ae 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/datatx/datatx.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/datatx/datatx.go @@ -37,6 +37,7 @@ import ( "github.com/cs3org/reva/v2/pkg/rgrpc/status" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -117,7 +118,7 @@ func parseConfig(m map[string]interface{}) (*config, error) { } // New creates a new datatx svc -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/gateway/gateway.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/gateway/gateway.go index d16bf42cb..016d422cc 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/gateway/gateway.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/gateway/gateway.go @@ -32,6 +32,7 @@ import ( "github.com/cs3org/reva/v2/pkg/token/manager/registry" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -150,7 +151,7 @@ type svc struct { // New creates a new gateway svc that acts as a proxy for any grpc operation. // The gateway is responsible for high-level controls: rate-limiting, coordination between svcs // like sharing and storage acls, asynchronous transactions, ... -func New(m map[string]interface{}, _ *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, _ *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/groupprovider/groupprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/groupprovider/groupprovider.go index ff9c9b2ec..6c818b5cf 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/groupprovider/groupprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/groupprovider/groupprovider.go @@ -31,6 +31,7 @@ import ( "github.com/cs3org/reva/v2/pkg/rgrpc/status" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -68,7 +69,7 @@ func getDriver(c *config) (group.Manager, error) { } // New returns a new GroupProviderServiceServer. -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/helloworld/helloworld.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/helloworld/helloworld.go index 3186eb04d..2dba2dedf 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/helloworld/helloworld.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/helloworld/helloworld.go @@ -26,6 +26,7 @@ import ( "github.com/cs3org/reva/v2/pkg/rgrpc" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -43,7 +44,7 @@ type service struct { // New returns a new PreferencesServiceServer // It can be tested like this: // prototool grpc --address 0.0.0.0:9999 --method 'revad.helloworld.HelloWorldService/Hello' --data '{"name": "Alice"}' -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c := &conf{} if err := mapstructure.Decode(m, c); err != nil { err = errors.Wrap(err, "helloworld: error decoding conf") diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocmcore/ocmcore.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocmcore/ocmcore.go index f3d7e7813..c9946c3c9 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocmcore/ocmcore.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocmcore/ocmcore.go @@ -33,6 +33,7 @@ import ( "github.com/cs3org/reva/v2/pkg/rgrpc" "github.com/cs3org/reva/v2/pkg/rgrpc/status" "github.com/cs3org/reva/v2/pkg/utils/cfg" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -68,7 +69,7 @@ func getShareRepository(c *config) (share.Repository, error) { } // New creates a new ocm core svc. -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { var c config if err := cfg.Decode(m, &c); err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocminvitemanager/ocminvitemanager.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocminvitemanager/ocminvitemanager.go index f9bdc8baf..328cb2b75 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocminvitemanager/ocminvitemanager.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocminvitemanager/ocminvitemanager.go @@ -40,6 +40,7 @@ import ( "github.com/cs3org/reva/v2/pkg/utils" "github.com/cs3org/reva/v2/pkg/utils/cfg" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -89,7 +90,7 @@ func getInviteRepository(c *config) (invite.Repository, error) { } // New creates a new OCM invite manager svc. -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { var c config if err := cfg.Decode(m, &c); err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocmproviderauthorizer/ocmproviderauthorizer.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocmproviderauthorizer/ocmproviderauthorizer.go index 374ebd3f8..1d5e14f94 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocmproviderauthorizer/ocmproviderauthorizer.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocmproviderauthorizer/ocmproviderauthorizer.go @@ -29,6 +29,7 @@ import ( "github.com/cs3org/reva/v2/pkg/rgrpc/status" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -73,7 +74,7 @@ func parseConfig(m map[string]interface{}) (*config, error) { } // New creates a new OCM provider authorizer svc -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocmshareprovider/ocmshareprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocmshareprovider/ocmshareprovider.go index ad7c36ca9..f1b0ed09e 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocmshareprovider/ocmshareprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/ocmshareprovider/ocmshareprovider.go @@ -49,6 +49,7 @@ import ( "github.com/cs3org/reva/v2/pkg/utils" "github.com/cs3org/reva/v2/pkg/utils/cfg" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -102,7 +103,7 @@ func getShareRepository(c *config) (share.Repository, error) { } // New creates a new ocm share provider svc. -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { var c config if err := cfg.Decode(m, &c); err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/permissions/permissions.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/permissions/permissions.go index 1312a7f75..9b95799f5 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/permissions/permissions.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/permissions/permissions.go @@ -29,6 +29,7 @@ import ( "github.com/cs3org/reva/v2/pkg/rgrpc" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -55,7 +56,7 @@ type service struct { } // New returns a new PermissionsServiceServer -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/preferences/preferences.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/preferences/preferences.go index f20698c6f..13ec4a331 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/preferences/preferences.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/preferences/preferences.go @@ -31,6 +31,7 @@ import ( "github.com/cs3org/reva/v2/pkg/rgrpc/status" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" ) func init() { @@ -70,7 +71,7 @@ func parseConfig(m map[string]interface{}) (*config, error) { } // New returns a new PreferencesServiceServer -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicshareprovider/publicshareprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicshareprovider/publicshareprovider.go index 1c9743045..fdddeae2a 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicshareprovider/publicshareprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicshareprovider/publicshareprovider.go @@ -38,6 +38,7 @@ import ( "github.com/cs3org/reva/v2/pkg/utils" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" "github.com/cs3org/reva/v2/pkg/appctx" @@ -128,7 +129,7 @@ func parsePasswordPolicy(m map[string]interface{}) (*passwordPolicy, error) { } // New creates a new public share provider svc initialized from defaults -func NewDefault(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func NewDefault(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicstorageprovider/publicstorageprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicstorageprovider/publicstorageprovider.go index dd685e183..c74337229 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicstorageprovider/publicstorageprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicstorageprovider/publicstorageprovider.go @@ -43,6 +43,7 @@ import ( "github.com/cs3org/reva/v2/pkg/utils" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "go.opentelemetry.io/otel/attribute" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -88,7 +89,7 @@ func parseConfig(m map[string]interface{}) (*config, error) { } // New creates a new publicstorageprovider service. -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go index 86eae8685..8dff672ee 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go @@ -25,6 +25,7 @@ import ( "strings" "github.com/cs3org/reva/v2/pkg/storagespace" + "github.com/rs/zerolog" "golang.org/x/sync/errgroup" "google.golang.org/genproto/protobuf/field_mask" "google.golang.org/grpc" @@ -84,7 +85,7 @@ func (s *service) Register(ss *grpc.Server) { } // NewDefault returns a new instance of the SharesStorageProvider service with default dependencies -func NewDefault(m map[string]interface{}, _ *grpc.Server) (rgrpc.Service, error) { +func NewDefault(m map[string]interface{}, _ *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c := &config{} if err := mapstructure.Decode(m, c); err != nil { err = errors.Wrap(err, "error decoding conf") diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageprovider/storageprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageprovider/storageprovider.go index 80c6ef0b8..05b583e0b 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageprovider/storageprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageprovider/storageprovider.go @@ -49,6 +49,7 @@ import ( "github.com/cs3org/reva/v2/pkg/utils" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "go.opentelemetry.io/otel/attribute" "google.golang.org/grpc" ) @@ -165,7 +166,7 @@ func registerMimeTypes(mappingFile string) error { } // New creates a new storage provider svc -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, log *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { @@ -174,7 +175,7 @@ func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { c.init() - fs, err := getFS(c) + fs, err := getFS(c, log) if err != nil { return nil, err } @@ -1276,7 +1277,7 @@ func (s *Service) addMissingStorageProviderID(resourceID *provider.ResourceId, s } } -func getFS(c *config) (storage.FS, error) { +func getFS(c *config, log *zerolog.Logger) (storage.FS, error) { evstream, err := estreamFromConfig(c.Events) if err != nil { return nil, err @@ -1286,7 +1287,7 @@ func getFS(c *config) (storage.FS, error) { driverConf := c.Drivers[c.Driver] driverConf["mount_id"] = c.MountID // pass the mount id to the driver - return f(driverConf, evstream) + return f(driverConf, evstream, log) } return nil, errtypes.NotFound("driver not found: " + c.Driver) diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageregistry/storageregistry.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageregistry/storageregistry.go index 291809440..bcbfd579f 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageregistry/storageregistry.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageregistry/storageregistry.go @@ -35,6 +35,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage" "github.com/cs3org/reva/v2/pkg/storage/registry/registry" "github.com/mitchellh/mapstructure" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -70,7 +71,7 @@ func (c *config) init() { } // New creates a new StorageBrokerService -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/userprovider/userprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/userprovider/userprovider.go index 94b7351d7..6ec389769 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/userprovider/userprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/userprovider/userprovider.go @@ -34,6 +34,7 @@ import ( "github.com/cs3org/reva/v2/pkg/user/manager/registry" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" ) @@ -88,7 +89,7 @@ func getDriver(c *config) (user.Manager, *plugin.RevaPlugin, error) { } // New returns a new UserProviderServiceServer. -func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func New(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/usershareprovider/usershareprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/usershareprovider/usershareprovider.go index 66096689d..f84736aba 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/usershareprovider/usershareprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/usershareprovider/usershareprovider.go @@ -33,6 +33,7 @@ import ( provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "google.golang.org/grpc" "github.com/cs3org/reva/v2/pkg/appctx" @@ -108,7 +109,7 @@ func parseConfig(m map[string]interface{}) (*config, error) { } // New creates a new user share provider svc initialized from defaults -func NewDefault(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { +func NewDefault(m map[string]interface{}, ss *grpc.Server, _ *zerolog.Logger) (rgrpc.Service, error) { c, err := parseConfig(m) if err != nil { diff --git a/vendor/github.com/cs3org/reva/v2/internal/http/services/dataprovider/dataprovider.go b/vendor/github.com/cs3org/reva/v2/internal/http/services/dataprovider/dataprovider.go index f9c14e7b8..458bb0448 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/http/services/dataprovider/dataprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/http/services/dataprovider/dataprovider.go @@ -22,6 +22,9 @@ import ( "fmt" "net/http" + "github.com/mitchellh/mapstructure" + "github.com/rs/zerolog" + "github.com/cs3org/reva/v2/pkg/appctx" "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/events/stream" @@ -30,8 +33,6 @@ import ( "github.com/cs3org/reva/v2/pkg/rhttp/router" "github.com/cs3org/reva/v2/pkg/storage" "github.com/cs3org/reva/v2/pkg/storage/fs/registry" - "github.com/mitchellh/mapstructure" - "github.com/rs/zerolog" ) func init() { @@ -98,12 +99,12 @@ func New(m map[string]interface{}, log *zerolog.Logger) (global.Service, error) evstream = s } - fs, err := getFS(conf, evstream) + fs, err := getFS(conf, evstream, log) if err != nil { return nil, err } - dataTXs, err := getDataTXs(conf, fs, evstream) + dataTXs, err := getDataTXs(conf, fs, evstream, log) if err != nil { return nil, err } @@ -118,14 +119,14 @@ func New(m map[string]interface{}, log *zerolog.Logger) (global.Service, error) return s, err } -func getFS(c *config, stream events.Stream) (storage.FS, error) { +func getFS(c *config, stream events.Stream, log *zerolog.Logger) (storage.FS, error) { if f, ok := registry.NewFuncs[c.Driver]; ok { - return f(c.Drivers[c.Driver], stream) + return f(c.Drivers[c.Driver], stream, log) } return nil, fmt.Errorf("driver not found: %s", c.Driver) } -func getDataTXs(c *config, fs storage.FS, publisher events.Publisher) (map[string]http.Handler, error) { +func getDataTXs(c *config, fs storage.FS, publisher events.Publisher, log *zerolog.Logger) (map[string]http.Handler, error) { if c.DataTXs == nil { c.DataTXs = make(map[string]map[string]interface{}) } @@ -144,7 +145,7 @@ func getDataTXs(c *config, fs storage.FS, publisher events.Publisher) (map[strin txs := make(map[string]http.Handler) for t := range c.DataTXs { if f, ok := datatxregistry.NewFuncs[t]; ok { - if tx, err := f(c.DataTXs[t], publisher); err == nil { + if tx, err := f(c.DataTXs[t], publisher, log); err == nil { if handler, err := tx.Handler(fs); err == nil { txs[t] = handler } diff --git a/vendor/github.com/cs3org/reva/v2/pkg/cbox/storage/eoshomewrapper/eoshomewrapper.go b/vendor/github.com/cs3org/reva/v2/pkg/cbox/storage/eoshomewrapper/eoshomewrapper.go index e3f31b8d6..319d05c7b 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/cbox/storage/eoshomewrapper/eoshomewrapper.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/cbox/storage/eoshomewrapper/eoshomewrapper.go @@ -33,6 +33,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/utils/eosfs" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" ) func init() { @@ -66,7 +67,7 @@ func parseConfig(m map[string]interface{}) (*eosfs.Config, string, error) { // New returns an implementation of the storage.FS interface that forms a wrapper // around separate connections to EOS. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { c, t, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/cbox/storage/eoswrapper/eoswrapper.go b/vendor/github.com/cs3org/reva/v2/pkg/cbox/storage/eoswrapper/eoswrapper.go index f9ef19690..0b90248f7 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/cbox/storage/eoswrapper/eoswrapper.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/cbox/storage/eoswrapper/eoswrapper.go @@ -30,6 +30,7 @@ import ( provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" ctxpkg "github.com/cs3org/reva/v2/pkg/ctx" "github.com/cs3org/reva/v2/pkg/errtypes" @@ -87,7 +88,7 @@ func parseConfig(m map[string]interface{}) (*eosfs.Config, string, error) { // New returns an implementation of the storage.FS interface that forms a wrapper // around separate connections to EOS. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { c, t, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/ocm/storage/received/ocm.go b/vendor/github.com/cs3org/reva/v2/pkg/ocm/storage/received/ocm.go index f43c24cd3..c76fe8141 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/ocm/storage/received/ocm.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/ocm/storage/received/ocm.go @@ -38,6 +38,7 @@ import ( ocmpb "github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" typepb "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" + "github.com/rs/zerolog" "github.com/studio-b12/gowebdav" "github.com/cs3org/reva/v2/pkg/errtypes" @@ -101,7 +102,7 @@ func (BearerAuthenticator) Close() error { } // New creates an OCM storage driver. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { var c config if err := cfg.Decode(m, &c); err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/rgrpc/rgrpc.go b/vendor/github.com/cs3org/reva/v2/pkg/rgrpc/rgrpc.go index c04bedc3d..01b5021be 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/rgrpc/rgrpc.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/rgrpc/rgrpc.go @@ -78,7 +78,7 @@ func Register(name string, newFunc NewService) { // NewService is the function that gRPC services need to register at init time. // It returns an io.Closer to close the service and a list of service endpoints that need to be unprotected. -type NewService func(conf map[string]interface{}, ss *grpc.Server) (Service, error) +type NewService func(conf map[string]interface{}, ss *grpc.Server, log *zerolog.Logger) (Service, error) // Service represents a grpc service. type Service interface { @@ -220,7 +220,7 @@ func (s *Server) registerServices() error { for svcName := range s.conf.Services { if s.isServiceEnabled(svcName) { newFunc := Services[svcName] - svc, err := newFunc(s.conf.Services[svcName], s.s) + svc, err := newFunc(s.conf.Services[svcName], s.s, &s.log) if err != nil { return errors.Wrapf(err, "rgrpc: grpc service %s could not be started,", svcName) } diff --git a/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/registry/registry.go b/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/registry/registry.go index 349126be9..3958171d6 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/registry/registry.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/registry/registry.go @@ -19,13 +19,15 @@ package registry import ( + "github.com/rs/zerolog" + "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/rhttp/datatx" ) // NewFunc is the function that data transfer implementations // should register at init time. -type NewFunc func(map[string]interface{}, events.Publisher) (datatx.DataTX, error) +type NewFunc func(map[string]interface{}, events.Publisher, *zerolog.Logger) (datatx.DataTX, error) // NewFuncs is a map containing all the registered data transfers. var NewFuncs = map[string]NewFunc{} diff --git a/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/simple/simple.go b/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/simple/simple.go index 24e4a8f89..5074b3861 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/simple/simple.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/simple/simple.go @@ -22,11 +22,12 @@ import ( "net/http" "time" - "github.com/mitchellh/mapstructure" - "github.com/pkg/errors" - userpb "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + "github.com/mitchellh/mapstructure" + "github.com/pkg/errors" + "github.com/rs/zerolog" + "github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/net" "github.com/cs3org/reva/v2/pkg/appctx" "github.com/cs3org/reva/v2/pkg/errtypes" @@ -48,6 +49,7 @@ func init() { type manager struct { conf *cache.Config publisher events.Publisher + log *zerolog.Logger } func parseConfig(m map[string]interface{}) (*cache.Config, error) { @@ -60,22 +62,26 @@ func parseConfig(m map[string]interface{}) (*cache.Config, error) { } // New returns a datatx manager implementation that relies on HTTP PUT/GET. -func New(m map[string]interface{}, publisher events.Publisher) (datatx.DataTX, error) { +func New(m map[string]interface{}, publisher events.Publisher, log *zerolog.Logger) (datatx.DataTX, error) { c, err := parseConfig(m) if err != nil { return nil, err } + l := log.With().Str("datatx", "simple").Logger() + return &manager{ conf: c, publisher: publisher, + log: &l, }, nil } func (m *manager) Handler(fs storage.FS) (http.Handler, error) { h := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + sublog := m.log.With().Str("path", r.URL.Path).Logger() + r = r.WithContext(appctx.WithLogger(r.Context(), &sublog)) ctx := r.Context() - sublog := appctx.GetLogger(ctx).With().Str("datatx", "simple").Logger() switch r.Method { case "GET", "HEAD": diff --git a/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/spaces/spaces.go b/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/spaces/spaces.go index 743e05d4a..300304294 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/spaces/spaces.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/spaces/spaces.go @@ -26,6 +26,10 @@ import ( userpb "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + "github.com/mitchellh/mapstructure" + "github.com/pkg/errors" + "github.com/rs/zerolog" + "github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/net" "github.com/cs3org/reva/v2/pkg/appctx" "github.com/cs3org/reva/v2/pkg/errtypes" @@ -39,8 +43,6 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/cache" "github.com/cs3org/reva/v2/pkg/storagespace" "github.com/cs3org/reva/v2/pkg/utils" - "github.com/mitchellh/mapstructure" - "github.com/pkg/errors" ) func init() { @@ -50,6 +52,7 @@ func init() { type manager struct { conf *cache.Config publisher events.Publisher + log *zerolog.Logger } func parseConfig(m map[string]interface{}) (*cache.Config, error) { @@ -62,25 +65,29 @@ func parseConfig(m map[string]interface{}) (*cache.Config, error) { } // New returns a datatx manager implementation that relies on HTTP PUT/GET. -func New(m map[string]interface{}, publisher events.Publisher) (datatx.DataTX, error) { +func New(m map[string]interface{}, publisher events.Publisher, log *zerolog.Logger) (datatx.DataTX, error) { c, err := parseConfig(m) if err != nil { return nil, err } + l := log.With().Str("datatx", "spaces").Logger() + return &manager{ conf: c, publisher: publisher, + log: &l, }, nil } func (m *manager) Handler(fs storage.FS) (http.Handler, error) { h := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() var spaceID string spaceID, r.URL.Path = router.ShiftPath(r.URL.Path) - sublog := appctx.GetLogger(ctx).With().Str("datatx", "spaces").Str("spaceid", spaceID).Logger() + sublog := m.log.With().Str("spaceid", spaceID).Str("path", r.URL.Path).Logger() + r = r.WithContext(appctx.WithLogger(r.Context(), &sublog)) + ctx := r.Context() switch r.Method { case "GET", "HEAD": diff --git a/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/tus/tus.go b/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/tus/tus.go index bb724c522..142c23bad 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/tus/tus.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/rhttp/datatx/manager/tus/tus.go @@ -24,11 +24,13 @@ import ( "path" "regexp" + provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + "github.com/mitchellh/mapstructure" "github.com/pkg/errors" "github.com/rs/zerolog" tusd "github.com/tus/tusd/v2/pkg/handler" + "golang.org/x/exp/slog" - provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" "github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/net" "github.com/cs3org/reva/v2/pkg/appctx" "github.com/cs3org/reva/v2/pkg/errtypes" @@ -38,8 +40,6 @@ import ( "github.com/cs3org/reva/v2/pkg/rhttp/datatx/metrics" "github.com/cs3org/reva/v2/pkg/storage" "github.com/cs3org/reva/v2/pkg/storagespace" - "github.com/mitchellh/mapstructure" - "golang.org/x/exp/slog" ) func init() { @@ -59,6 +59,7 @@ type TusConfig struct { type manager struct { conf *TusConfig publisher events.Publisher + log *zerolog.Logger } func parseConfig(m map[string]interface{}) (*TusConfig, error) { @@ -71,14 +72,18 @@ func parseConfig(m map[string]interface{}) (*TusConfig, error) { } // New returns a datatx manager implementation that relies on HTTP PUT/GET. -func New(m map[string]interface{}, publisher events.Publisher) (datatx.DataTX, error) { +func New(m map[string]interface{}, publisher events.Publisher, log *zerolog.Logger) (datatx.DataTX, error) { c, err := parseConfig(m) if err != nil { return nil, err } + + l := log.With().Str("datatx", "tus").Logger() + return &manager{ conf: c, publisher: publisher, + log: &l, }, nil } @@ -100,7 +105,7 @@ func (m *manager) Handler(fs storage.FS) (http.Handler, error) { config := tusd.Config{ StoreComposer: composer, NotifyCompleteUploads: true, - Logger: slog.New(tusdLogger{log: appctx.GetLogger(context.Background())}), // Note: this is a noop logger + Logger: slog.New(tusdLogger{log: m.log}), } if m.conf.CorsEnabled { @@ -154,6 +159,8 @@ func (m *manager) Handler(fs storage.FS) (http.Handler, error) { } h := handler.Middleware(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + sublog := m.log.With().Str("uploadid", r.URL.Path).Logger() + r = r.WithContext(appctx.WithLogger(r.Context(), &sublog)) method := r.Method // https://github.com/tus/tus-resumable-upload-protocol/blob/master/protocol.md#x-http-method-override if r.Header.Get("X-HTTP-Method-Override") != "" { @@ -251,8 +258,16 @@ func (l tusdLogger) Handle(_ context.Context, r slog.Record) error { // Enabled returns true func (l tusdLogger) Enabled(_ context.Context, _ slog.Level) bool { return true } -// WithAttrs is not implemented -func (l tusdLogger) WithAttrs(_ []slog.Attr) slog.Handler { return l } +// WithAttrs creates a new logger with the given attributes +func (l tusdLogger) WithAttrs(attr []slog.Attr) slog.Handler { + fields := make(map[string]interface{}, len(attr)) + for _, a := range attr { + fields[a.Key] = a.Value + } + c := l.log.With().Fields(fields).Logger() + sLog := tusdLogger{log: &c} + return sLog +} // WithGroup is not implemented -func (l tusdLogger) WithGroup(_ string) slog.Handler { return l } +func (l tusdLogger) WithGroup(name string) slog.Handler { return l } diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/cephfs/cephfs.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/cephfs/cephfs.go index 08180f522..554de78b9 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/cephfs/cephfs.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/cephfs/cephfs.go @@ -35,6 +35,7 @@ import ( provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "github.com/cs3org/reva/v2/pkg/appctx" "github.com/cs3org/reva/v2/pkg/errtypes" @@ -66,7 +67,7 @@ func init() { // New returns an implementation to of the storage.FS interface that talk to // a ceph filesystem. -func New(m map[string]interface{}, _ events.Stream) (fs storage.FS, err error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (fs storage.FS, err error) { c := &Options{} if err = mapstructure.Decode(m, c); err != nil { return nil, errors.Wrap(err, "error decoding conf") diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/cephfs/unsupported.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/cephfs/unsupported.go index e11e80516..ee778d577 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/cephfs/unsupported.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/cephfs/unsupported.go @@ -23,6 +23,7 @@ package cephfs import ( "github.com/pkg/errors" + "github.com/rs/zerolog" "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/storage" @@ -35,6 +36,6 @@ func init() { // New returns an implementation to of the storage.FS interface that talk to // a ceph filesystem. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { return nil, errors.New("cephfs: revad was compiled without CephFS support") } diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eos/eos.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eos/eos.go index e8b3f4822..02b5013ef 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eos/eos.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eos/eos.go @@ -25,6 +25,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/utils/eosfs" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" ) func init() { @@ -47,7 +48,7 @@ func parseConfig(m map[string]interface{}) (*eosfs.Config, error) { } // New returns a new implementation of the storage.FS interface that connects to EOS. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eosgrpc/eosgrpc.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eosgrpc/eosgrpc.go index 6ce66df7e..1b55e48f7 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eosgrpc/eosgrpc.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eosgrpc/eosgrpc.go @@ -25,6 +25,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/utils/eosfs" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" ) func init() { @@ -47,7 +48,7 @@ func parseConfig(m map[string]interface{}) (*eosfs.Config, error) { } // New returns a new implementation of the storage.FS interface that connects to EOS. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eosgrpchome/eosgrpchome.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eosgrpchome/eosgrpchome.go index 8dc36527b..a78d4ee0b 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eosgrpchome/eosgrpchome.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eosgrpchome/eosgrpchome.go @@ -25,6 +25,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/utils/eosfs" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" ) func init() { @@ -47,7 +48,7 @@ func parseConfig(m map[string]interface{}) (*eosfs.Config, error) { } // New returns a new implementation of the storage.FS interface that connects to EOS. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eoshome/eoshome.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eoshome/eoshome.go index 0e8cfb85d..3a14c943b 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eoshome/eoshome.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/eoshome/eoshome.go @@ -25,6 +25,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/utils/eosfs" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" ) func init() { @@ -47,7 +48,7 @@ func parseConfig(m map[string]interface{}) (*eosfs.Config, error) { } // New returns a new implementation of the storage.FS interface that connects to EOS. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/hello/hello.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/hello/hello.go index f87062feb..3b50ee82b 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/hello/hello.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/hello/hello.go @@ -29,6 +29,7 @@ import ( "time" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" + "github.com/rs/zerolog" "github.com/cs3org/reva/v2/pkg/errtypes" "github.com/cs3org/reva/v2/pkg/events" @@ -144,7 +145,7 @@ func calcEtag(t time.Time, nodeid string) string { // New returns an implementation to of the storage.FS interface that talks to // a local filesystem with user homes disabled. -func New(_ map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(_ map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { return &hellofs{ bootTime: time.Now(), }, nil diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/local/local.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/local/local.go index a5510262a..29b4eab89 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/local/local.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/local/local.go @@ -25,6 +25,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/utils/localfs" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" ) func init() { @@ -49,7 +50,7 @@ func parseConfig(m map[string]interface{}) (*config, error) { // New returns an implementation to of the storage.FS interface that talks to // a local filesystem with user homes disabled. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/localhome/localhome.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/localhome/localhome.go index a442acbb5..dc7c0494c 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/localhome/localhome.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/localhome/localhome.go @@ -25,6 +25,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/utils/localfs" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" ) func init() { @@ -48,7 +49,7 @@ func parseConfig(m map[string]interface{}) (*config, error) { // New returns an implementation to of the storage.FS interface that talks to // a local filesystem with user homes. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/nextcloud/nextcloud.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/nextcloud/nextcloud.go index efad4295e..569aec1c0 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/nextcloud/nextcloud.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/nextcloud/nextcloud.go @@ -33,6 +33,7 @@ import ( types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" "github.com/cs3org/reva/v2/pkg/appctx" ctxpkg "github.com/cs3org/reva/v2/pkg/ctx" @@ -72,7 +73,7 @@ func parseConfig(m map[string]interface{}) (*StorageDriverConfig, error) { // New returns an implementation to of the storage.FS interface that talks to // a Nextcloud instance over http. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { conf, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/ocis/ocis.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/ocis/ocis.go index 812b44e4f..f8ec0a85f 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/ocis/ocis.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/ocis/ocis.go @@ -27,6 +27,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/fs/registry" "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs" "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/options" + "github.com/rs/zerolog" ) func init() { @@ -35,7 +36,7 @@ func init() { // New returns an implementation to of the storage.FS interface that talk to // a local filesystem. -func New(m map[string]interface{}, stream events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, stream events.Stream, _ *zerolog.Logger) (storage.FS, error) { o, err := options.New(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/owncloudsql/owncloudsql.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/owncloudsql/owncloudsql.go index 5cfaaca8b..793f2eeb7 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/owncloudsql/owncloudsql.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/owncloudsql/owncloudsql.go @@ -42,6 +42,7 @@ import ( "github.com/mitchellh/mapstructure" "github.com/pkg/errors" "github.com/pkg/xattr" + "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/cs3org/reva/v2/internal/grpc/services/storageprovider" @@ -152,7 +153,7 @@ func (c *config) init(m map[string]interface{}) { // New returns an implementation to of the storage.FS interface that talk to // a local filesystem. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/posix.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/posix.go index 537689d45..340f89b1f 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/posix.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/posix.go @@ -27,6 +27,7 @@ import ( "os" "syscall" + "github.com/rs/zerolog" tusd "github.com/tus/tusd/v2/pkg/handler" microstore "go-micro.dev/v4/store" @@ -64,7 +65,7 @@ type posixFS struct { // New returns an implementation to of the storage.FS interface that talk to // a local filesystem. -func New(m map[string]interface{}, stream events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, stream events.Stream, log *zerolog.Logger) (storage.FS, error) { o, err := options.New(m) if err != nil { return nil, err @@ -111,7 +112,7 @@ func New(m map[string]interface{}, stream events.Stream) (storage.FS, error) { microstore.Table(o.IDCache.Table), store.DisablePersistence(o.IDCache.DisablePersistence), store.Authentication(o.IDCache.AuthUsername, o.IDCache.AuthPassword), - )) + ), log) if err != nil { return nil, err } diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/tree.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/tree.go index 2ba94a88a..7bf7e34a1 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/tree.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/tree.go @@ -41,7 +41,6 @@ import ( "github.com/cs3org/reva/v2/pkg/appctx" "github.com/cs3org/reva/v2/pkg/errtypes" "github.com/cs3org/reva/v2/pkg/events" - "github.com/cs3org/reva/v2/pkg/logger" "github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup" "github.com/cs3org/reva/v2/pkg/storage/fs/posix/options" "github.com/cs3org/reva/v2/pkg/storage/fs/posix/trashbin" @@ -100,8 +99,7 @@ type Tree struct { type PermissionCheckFunc func(rp *provider.ResourcePermissions) bool // New returns a new instance of Tree -func New(lu node.PathLookup, bs Blobstore, um usermapper.Mapper, trashbin *trashbin.Trashbin, o *options.Options, es events.Stream, cache store.Store) (*Tree, error) { - log := logger.New() +func New(lu node.PathLookup, bs Blobstore, um usermapper.Mapper, trashbin *trashbin.Trashbin, o *options.Options, es events.Stream, cache store.Store, log *zerolog.Logger) (*Tree, error) { scanQueue := make(chan scanItem) t := &Tree{ lookup: lu, diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/registry/registry.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/registry/registry.go index a75c8cf27..7e2aeb54d 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/registry/registry.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/registry/registry.go @@ -21,11 +21,12 @@ package registry import ( "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/storage" + "github.com/rs/zerolog" ) // NewFunc is the function that storage implementations // should register at init time. -type NewFunc func(map[string]interface{}, events.Stream) (storage.FS, error) +type NewFunc func(map[string]interface{}, events.Stream, *zerolog.Logger) (storage.FS, error) // NewFuncs is a map containing all the registered storage backends. var NewFuncs = map[string]NewFunc{} diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/s3/s3.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/s3/s3.go index 7717b716c..b604e287f 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/s3/s3.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/s3/s3.go @@ -44,6 +44,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/fs/registry" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" + "github.com/rs/zerolog" ) func init() { @@ -70,7 +71,7 @@ func parseConfig(m map[string]interface{}) (*config, error) { // New returns an implementation to of the storage.FS interface that talk to // a s3 api. -func New(m map[string]interface{}, _ events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.FS, error) { c, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/s3ng/s3ng.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/s3ng/s3ng.go index 16360c898..d261ad0ea 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/s3ng/s3ng.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/s3ng/s3ng.go @@ -26,6 +26,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/fs/registry" "github.com/cs3org/reva/v2/pkg/storage/fs/s3ng/blobstore" "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs" + "github.com/rs/zerolog" ) func init() { @@ -34,7 +35,7 @@ func init() { // New returns an implementation to of the storage.FS interface that talk to // a local filesystem. -func New(m map[string]interface{}, stream events.Stream) (storage.FS, error) { +func New(m map[string]interface{}, stream events.Stream, _ *zerolog.Logger) (storage.FS, error) { o, err := parseConfig(m) if err != nil { return nil, err diff --git a/vendor/modules.txt b/vendor/modules.txt index e58529701..1e5e98b18 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -367,7 +367,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.26.6-0.20241114152615-4ce61d4d09fc +# github.com/cs3org/reva/v2 v2.26.6-0.20241119075849-6f05da66906b ## explicit; go 1.22.0 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime From e2b40a2d679c0fff21f1fe46c36a4e7bfeba295c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Tue, 19 Nov 2024 09:06:35 +0100 Subject: [PATCH 2/2] Adapt to changed signature --- services/storage-users/pkg/command/uploads.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go index a2d151812..2e18a4846 100644 --- a/services/storage-users/pkg/command/uploads.go +++ b/services/storage-users/pkg/command/uploads.go @@ -104,7 +104,7 @@ func ListUploadSessions(cfg *config.Config) *cli.Command { os.Exit(1) } drivers := revaconfig.StorageProviderDrivers(cfg) - fs, err := f(drivers[cfg.Driver].(map[string]interface{}), nil) + fs, err := f(drivers[cfg.Driver].(map[string]interface{}), nil, nil) if err != nil { fmt.Fprintf(os.Stderr, "Failed to initialize filesystem driver '%s'\n", cfg.Driver) return err