From 2afcb84186c831f25c56663f5c25ad08b685171b Mon Sep 17 00:00:00 2001 From: jkoberg Date: Mon, 31 Jul 2023 15:53:58 +0200 Subject: [PATCH] bump reva Signed-off-by: jkoberg --- changelog/unreleased/bump-reva.md | 1 + go.mod | 2 +- go.sum | 4 +-- .../grpc/services/appprovider/appprovider.go | 33 +++++++++++++++---- .../owncloud/ocs/data/capabilities.go | 1 + vendor/modules.txt | 2 +- 6 files changed, 33 insertions(+), 10 deletions(-) diff --git a/changelog/unreleased/bump-reva.md b/changelog/unreleased/bump-reva.md index b55e582943..894a94954a 100644 --- a/changelog/unreleased/bump-reva.md +++ b/changelog/unreleased/bump-reva.md @@ -4,3 +4,4 @@ bumps reva version https://github.com/owncloud/ocis/pull/6899 https://github.com/owncloud/ocis/pull/6919 +https://github.com/owncloud/ocis/pull/6928 diff --git a/go.mod b/go.mod index 829a9301aa..90a3d83b82 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/coreos/go-oidc v2.2.1+incompatible github.com/coreos/go-oidc/v3 v3.6.0 github.com/cs3org/go-cs3apis v0.0.0-20230516150832-730ac860c71d - github.com/cs3org/reva/v2 v2.15.1-0.20230731073021-26b2f3432d11 + github.com/cs3org/reva/v2 v2.15.1-0.20230731132956-0fb5212d0551 github.com/disintegration/imaging v1.6.2 github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e github.com/egirna/icap-client v0.1.1 diff --git a/go.sum b/go.sum index 9c0a4fcce4..2a921a5a0c 100644 --- a/go.sum +++ b/go.sum @@ -625,8 +625,8 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4= github.com/crewjam/saml v0.4.13 h1:TYHggH/hwP7eArqiXSJUvtOPNzQDyQ7vwmwEqlFWhMc= github.com/crewjam/saml v0.4.13/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA= -github.com/cs3org/reva/v2 v2.15.1-0.20230731073021-26b2f3432d11 h1:44FU3t+cJFBEiheA1Vj8JxLVXt8eWY1J0h4lNsaOgxo= -github.com/cs3org/reva/v2 v2.15.1-0.20230731073021-26b2f3432d11/go.mod h1:4z5EQghS2LhSWZWocH51Dw9VAs16No1zSFvFgQtgS7w= +github.com/cs3org/reva/v2 v2.15.1-0.20230731132956-0fb5212d0551 h1:8/cX/Fjo0SWzuHH+7SUK2w9t/9yR449woDR2wTzNW7k= +github.com/cs3org/reva/v2 v2.15.1-0.20230731132956-0fb5212d0551/go.mod h1:4UKDbqt/GHQDdNr2fv4XQVlnz6KC9DQdpV2P2fY2Mkg= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= 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 d3b5ff557e..ce1cc6e775 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/log" "google.golang.org/grpc" ) @@ -47,8 +48,10 @@ func init() { } type service struct { - provider app.Provider - conf *config + provider app.Provider + conf *config + context context.Context + cancelFunc context.CancelFunc } type config struct { @@ -58,12 +61,16 @@ type config struct { GatewaySvc string `mapstructure:"gatewaysvc"` MimeTypes []string `mapstructure:"mime_types"` Priority uint64 `mapstructure:"priority"` + RefreshTime time.Duration `mapstructure:"refreshtime"` } func (c *config) init() { if c.Driver == "" { c.Driver = "demo" } + if c.RefreshTime < 1 { + c.RefreshTime = time.Second * 20 + } c.AppProviderURL = sharedconf.GetGatewaySVC(c.AppProviderURL) c.GatewaySvc = sharedconf.GetGatewaySVC(c.GatewaySvc) } @@ -89,14 +96,28 @@ func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { return nil, err } + ctx, cancelFunc := context.WithCancel(context.Background()) + service := &service{ - conf: c, - provider: provider, + conf: c, + provider: provider, + context: ctx, + cancelFunc: cancelFunc, } + t := time.NewTicker(c.RefreshTime) + go func() { - // TODO: implement me to call service.registerProvider with a ticker - service.registerProvider() + for { + select { + case <-t.C: + log.Debug().Msg("app provider tick, registering Provider") + service.registerProvider() + case <-service.context.Done(): + log.Debug().Msg("app provider stopped") + t.Stop() + } + } }() return service, nil } diff --git a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/data/capabilities.go b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/data/capabilities.go index 300a17a857..d2f5471f74 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/data/capabilities.go +++ b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/data/capabilities.go @@ -76,6 +76,7 @@ type CapabilitiesCore struct { WebdavRoot string `json:"webdav-root,omitempty" xml:"webdav-root,omitempty" mapstructure:"webdav_root"` Status *Status `json:"status" xml:"status"` SupportURLSigning ocsBool `json:"support-url-signing" xml:"support-url-signing" mapstructure:"support_url_signing"` + SupportSSE ocsBool `json:"support-sse" xml:"support-sse" mapstructure:"support_sse"` } // CapabilitiesGraph holds the graph capabilities diff --git a/vendor/modules.txt b/vendor/modules.txt index 1ced96053b..d2d0f2675c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -352,7 +352,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.15.1-0.20230731073021-26b2f3432d11 +# github.com/cs3org/reva/v2 v2.15.1-0.20230731132956-0fb5212d0551 ## explicit; go 1.20 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime