From 918bc858790a7c0d0caccd0193a64e9a46c46666 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Tue, 27 Sep 2022 10:36:42 +0200 Subject: [PATCH 01/19] Bump reva to latest edge (#4660) Fixes: #4628, #4657 --- go.mod | 8 +++++++- go.sum | 25 +++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5180710997b..297985e7710 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.3 github.com/coreos/go-oidc/v3 v3.4.0 github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d - github.com/cs3org/reva/v2 v2.10.1-0.20220923132218-42ec8133342b + github.com/cs3org/reva/v2 v2.10.1-0.20220926153309-83c796b662f2 github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 @@ -143,6 +143,7 @@ require ( github.com/deckarep/golang-set v1.8.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/ristretto v0.1.0 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dlclark/regexp2 v1.4.0 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect @@ -164,6 +165,9 @@ require ( github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-micro/plugins/v4/store/nats-js v1.1.0 // indirect + github.com/go-micro/plugins/v4/store/redis v1.1.0 // indirect + github.com/go-redis/redis/v8 v8.10.0 // indirect github.com/go-sql-driver/mysql v1.6.0 // indirect github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect github.com/gobwas/httphead v0.1.0 // indirect @@ -265,6 +269,8 @@ require ( github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect go.etcd.io/etcd/api/v3 v3.5.5 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect + go.opentelemetry.io/otel/internal/metric v0.27.0 // indirect + go.opentelemetry.io/otel/metric v0.27.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.23.0 // indirect diff --git a/go.sum b/go.sum index ee2ed6998ed..57508f73a6a 100644 --- a/go.sum +++ b/go.sum @@ -297,8 +297,8 @@ github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4= github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A= github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d h1:toyZ7IsXlUdEPZ/IG8fg7hbM8HcLPY0bkX4FKBmgLVI= github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.10.1-0.20220923132218-42ec8133342b h1:1/OdNjQFlSRci864LaUzCqfnJr5SaU8oHFtr5ZgOtus= -github.com/cs3org/reva/v2 v2.10.1-0.20220923132218-42ec8133342b/go.mod h1:rluMvfscNljIcK4EBHwhCDmnFqfqqW76ChRxV/v9W5g= +github.com/cs3org/reva/v2 v2.10.1-0.20220926153309-83c796b662f2 h1:utMnpYVAar5r6nfslHVyw4ukzS9vp5v9OFpKVIXlwtE= +github.com/cs3org/reva/v2 v2.10.1-0.20220926153309-83c796b662f2/go.mod h1:NfAt4eTciYZ8EZy/3U2oJDhkYGPZOjovulh8DRHV5RI= 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= @@ -316,6 +316,8 @@ github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c= @@ -448,6 +450,10 @@ github.com/go-micro/plugins/v4/server/grpc v1.1.1 h1:7V5K8RTQhzzFsJCPkKXTJr4YrWy github.com/go-micro/plugins/v4/server/grpc v1.1.1/go.mod h1:GntDOa4zIHmyBLAvSXP05gK6im+Fw+Dh8fxUk/yiwaI= github.com/go-micro/plugins/v4/server/http v1.1.0 h1:3zigMm74qsuGJDMHCuYFy+2PEvnKND3S5AcabuWWyr8= github.com/go-micro/plugins/v4/server/http v1.1.0/go.mod h1:ZjVZi1l16RjzyT3IISirh9BEZdqzaLLwiE/1fvdSbnI= +github.com/go-micro/plugins/v4/store/nats-js v1.1.0 h1:6Fe1/eLtg8kRyaGvMILp4olYtTDGwYNBXyb1sYfAWGk= +github.com/go-micro/plugins/v4/store/nats-js v1.1.0/go.mod h1:jJf7Gm39OafZlT3s3UE2/9NIYj6OlI2fmZ4czSA3gvo= +github.com/go-micro/plugins/v4/store/redis v1.1.0 h1:QWl5FAfMaekppZGNcj0mSyi8vCkjZGvHoGdaBNeKNm4= +github.com/go-micro/plugins/v4/store/redis v1.1.0/go.mod h1:yXFv4vhmr1ccxRfHxvuSetIBZDOJvRA404PZk5z6/bc= github.com/go-micro/plugins/v4/transport/grpc v1.1.0 h1:mXfDYfFQLnVDzjGY3o84oe4prfux9h8txsnA19dKsj8= github.com/go-micro/plugins/v4/wrapper/breaker/gobreaker v1.1.0 h1:X+j/pAJV9sfOYzMrjMDYdtAKiJ1vozw8p98ZsBDmVAc= github.com/go-micro/plugins/v4/wrapper/breaker/gobreaker v1.1.0/go.mod h1:+Z5TSrTYBaoruuGsgqpzjK/Jc2pnRF5nV5sMwmjqTM4= @@ -478,6 +484,8 @@ github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvSc github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-redis/redis/v8 v8.10.0 h1:OZwrQKuZqdJ4QIM8wn8rnuz868Li91xA3J2DEq+TPGA= +github.com/go-redis/redis/v8 v8.10.0/go.mod h1:vXLTvigok0VtUX0znvbcEW1SOt4OA9CU1ZfnOtKOaiM= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -979,6 +987,7 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.2.0 h1:3ZNA3L1c5FYDFTTxbFeVGGD8jYvjYauHD30YgLxVsNI= @@ -986,6 +995,7 @@ github.com/onsi/ginkgo/v2 v2.2.0/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7 github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/onsi/gomega v1.20.2 h1:8uQq0zMgLEfa0vRrrBgaJF2gyW9Da9BmfGV+OyUzfkY= github.com/onsi/gomega v1.20.2/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -1274,12 +1284,22 @@ go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.0 h1:+jrwcA4gF8tIZmdKWgTUysKtYW2VIzywjkfgd/5OPEM= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.0/go.mod h1:h8TWwRAhQpOd0aM5nYsRD8+flnkj+526GEIVlarH7eY= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= go.opentelemetry.io/otel/exporters/jaeger v1.10.0 h1:7W3aVVjEYayu/GOqOVF4mbTvnCuxF1wWu3eRxFGQXvw= go.opentelemetry.io/otel/exporters/jaeger v1.10.0/go.mod h1:n9IGyx0fgyXXZ/i0foLHNxtET9CzXHzZeKCucvRBFgA= +go.opentelemetry.io/otel/internal/metric v0.27.0 h1:9dAVGAfFiiEq5NVB9FUJ5et+btbDQAUIJehJ+ikyryk= +go.opentelemetry.io/otel/internal/metric v0.27.0/go.mod h1:n1CVxRqKqYZtqyTh9U/onvKapPGv7y/rpyOTI+LFNzw= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/metric v0.27.0 h1:HhJPsGhJoKRSegPQILFbODU56NS/L1UE4fS1sC5kIwQ= +go.opentelemetry.io/otel/metric v0.27.0/go.mod h1:raXDJ7uP2/Jc0nVZWQjJtzoyssOYWu/+pjZqRzfvZ7g= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY= go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE= go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E= go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= @@ -1420,6 +1440,7 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= From 68b17eb68d6c854f8d6012d643f2cc483d9c9824 Mon Sep 17 00:00:00 2001 From: Andre Duffeck Date: Tue, 27 Sep 2022 10:38:15 +0200 Subject: [PATCH 02/19] Search dav spaces (#4661) * Add a Ref option to SearchRequest, e.g. for limiting the search to a space * Enable REPORT requests for /dav/spaces URLs * Limit the search to the according space in case of /dav/spaces searches * Add changelog * Adapt expected failures * Comment exported functions --- changelog/unreleased/dav-spaces-search.md | 6 + .../ocis/messages/settings/v0/settings.pb.go | 3 - .../gen/ocis/services/search/v0/search.pb.go | 235 +++++++++--------- .../services/search/v0/search.swagger.json | 3 + .../services/thumbnails/v0/thumbnails.pb.go | 1 - .../ocis/services/search/v0/search.proto | 1 + .../pkg/config/defaults/defaultconfig.go | 8 +- .../pkg/config/defaults/defaultconfig.go | 2 + .../search/pkg/search/provider/events_test.go | 157 ++++++------ .../pkg/search/provider/searchprovider.go | 8 + .../search/provider/searchprovider_test.go | 25 +- services/search/pkg/service/v0/service.go | 1 + services/webdav/pkg/service/v0/search.go | 25 +- services/webdav/pkg/service/v0/service.go | 4 +- .../expected-failures-API-on-OCIS-storage.md | 8 - 15 files changed, 286 insertions(+), 201 deletions(-) create mode 100644 changelog/unreleased/dav-spaces-search.md diff --git a/changelog/unreleased/dav-spaces-search.md b/changelog/unreleased/dav-spaces-search.md new file mode 100644 index 00000000000..a06f3270e32 --- /dev/null +++ b/changelog/unreleased/dav-spaces-search.md @@ -0,0 +1,6 @@ +Enhancement: Add support for REPORT requests to /dav/spaces URLs + +We added support for /dav/spaces REPORT requests which allow for searching specific spaces. + +https://github.com/owncloud/ocis/pull/4661 +https://github.com/owncloud/ocis/issues/4034 diff --git a/protogen/gen/ocis/messages/settings/v0/settings.pb.go b/protogen/gen/ocis/messages/settings/v0/settings.pb.go index b30e14dc3dc..8e08272ef01 100644 --- a/protogen/gen/ocis/messages/settings/v0/settings.pb.go +++ b/protogen/gen/ocis/messages/settings/v0/settings.pb.go @@ -589,7 +589,6 @@ type Setting struct { DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` // Types that are assignable to Value: - // // *Setting_IntValue // *Setting_StringValue // *Setting_BoolValue @@ -1194,7 +1193,6 @@ type Value struct { AccountUuid string `protobuf:"bytes,4,opt,name=account_uuid,json=accountUuid,proto3" json:"account_uuid,omitempty"` Resource *Resource `protobuf:"bytes,5,opt,name=resource,proto3" json:"resource,omitempty"` // Types that are assignable to Value: - // // *Value_BoolValue // *Value_IntValue // *Value_StringValue @@ -1385,7 +1383,6 @@ type ListOptionValue struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Option: - // // *ListOptionValue_StringValue // *ListOptionValue_IntValue Option isListOptionValue_Option `protobuf_oneof:"option"` diff --git a/protogen/gen/ocis/services/search/v0/search.pb.go b/protogen/gen/ocis/services/search/v0/search.pb.go index 5a43c9fbe57..f586f967017 100644 --- a/protogen/gen/ocis/services/search/v0/search.pb.go +++ b/protogen/gen/ocis/services/search/v0/search.pb.go @@ -33,8 +33,9 @@ type SearchRequest struct { PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // Optional. A pagination token returned from a previous call to `Get` // that indicates from where search should continue - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` + Ref *v0.Reference `protobuf:"bytes,4,opt,name=ref,proto3" json:"ref,omitempty"` } func (x *SearchRequest) Reset() { @@ -90,6 +91,13 @@ func (x *SearchRequest) GetQuery() string { return "" } +func (x *SearchRequest) GetRef() *v0.Reference { + if x != nil { + return x.Ref + } + return nil +} + type SearchResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -405,101 +413,105 @@ var file_ocis_services_search_v0_search_proto_rawDesc = []byte{ 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6d, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x01, - 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, - 0xe2, 0x41, 0x01, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x97, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x63, 0x69, 0x73, - 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x2e, 0x76, 0x30, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, - 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x22, - 0xae, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x01, 0x52, - 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, - 0x41, 0x01, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, - 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x01, 0x52, 0x03, 0x72, 0x65, 0x66, - 0x22, 0x9c, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x63, 0x69, 0x73, - 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x2e, 0x76, 0x30, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, - 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x22, - 0x47, 0x0a, 0x11, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, - 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x9c, - 0x02, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x12, 0x7b, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x26, 0x2e, 0x6f, 0x63, - 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1a, 0x22, 0x15, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x3a, 0x01, 0x2a, 0x12, 0x8c, - 0x01, 0x0a, 0x0a, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2a, 0x2e, - 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, - 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x63, 0x69, 0x73, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x2e, 0x76, 0x30, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x22, 0x1a, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x32, 0x9d, 0x01, - 0x0a, 0x0d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, - 0x8b, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x2b, 0x2e, 0x6f, 0x63, 0x69, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x01, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x04, 0xe2, 0x41, 0x01, + 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x04, 0xe2, 0x41, 0x01, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x01, 0x52, 0x03, 0x72, + 0x65, 0x66, 0x22, 0x97, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, + 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, + 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, + 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x22, 0xae, 0x01, 0x0a, + 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x01, 0x52, 0x08, 0x70, 0x61, + 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x01, + 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x3a, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x73, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x01, 0x52, 0x03, 0x72, 0x65, 0x66, 0x22, 0x9c, 0x01, + 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, + 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, + 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, + 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x22, 0x47, 0x0a, 0x11, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, + 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x9c, 0x02, 0x0a, 0x0e, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x7b, + 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x26, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, + 0x76, 0x30, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x27, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1a, 0x22, 0x15, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x3a, 0x01, 0x2a, 0x12, 0x8c, 0x01, 0x0a, 0x0a, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2a, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, + 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, + 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x22, 0x1a, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x32, 0x9d, 0x01, 0x0a, 0x0d, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x8b, 0x01, 0x0a, + 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x2b, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, - 0x30, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x1b, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x3a, 0x01, 0x2a, 0x42, 0xdc, 0x02, - 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x77, 0x6e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6f, 0x63, 0x69, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x63, 0x69, 0x73, 0x2f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x76, 0x30, 0x92, 0x41, - 0x9a, 0x02, 0x12, 0xb4, 0x01, 0x0a, 0x1e, 0x6f, 0x77, 0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, - 0x49, 0x6e, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x65, 0x20, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x20, 0x73, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x22, 0x47, 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x20, 0x47, 0x6d, 0x62, 0x48, 0x12, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x77, 0x6e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2f, 0x6f, 0x63, 0x69, 0x73, 0x1a, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, - 0x74, 0x40, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6d, 0x2a, 0x42, - 0x0a, 0x0a, 0x41, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2d, 0x32, 0x2e, 0x30, 0x12, 0x34, 0x68, 0x74, - 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6f, 0x63, 0x69, 0x73, 0x2f, 0x62, - 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, - 0x53, 0x45, 0x32, 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, - 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, - 0x6e, 0x72, 0x39, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x20, 0x4d, - 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x12, 0x25, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x6f, - 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x30, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6f, 0x63, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2e, 0x76, 0x30, 0x2e, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x1b, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x30, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x3a, 0x01, 0x2a, 0x42, 0xdc, 0x02, 0x5a, 0x3c, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2f, 0x6f, 0x63, 0x69, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x63, 0x69, 0x73, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x76, 0x30, 0x92, 0x41, 0x9a, 0x02, 0x12, + 0xb4, 0x01, 0x0a, 0x1e, 0x6f, 0x77, 0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, 0x49, 0x6e, 0x66, + 0x69, 0x6e, 0x69, 0x74, 0x65, 0x20, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x20, 0x73, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x22, 0x47, 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, 0x47, + 0x6d, 0x62, 0x48, 0x12, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2f, 0x6f, 0x63, 0x69, 0x73, 0x1a, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, 0x6f, + 0x77, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6d, 0x2a, 0x42, 0x0a, 0x0a, 0x41, + 0x70, 0x61, 0x63, 0x68, 0x65, 0x2d, 0x32, 0x2e, 0x30, 0x12, 0x34, 0x68, 0x74, 0x74, 0x70, 0x73, + 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x77, + 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6f, 0x63, 0x69, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x62, + 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, + 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x72, 0x39, + 0x0a, 0x10, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x20, 0x4d, 0x61, 0x6e, 0x75, + 0x61, 0x6c, 0x12, 0x25, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x6f, 0x77, 0x6e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x2f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -522,24 +534,25 @@ var file_ocis_services_search_v0_search_proto_goTypes = []interface{}{ (*SearchIndexResponse)(nil), // 3: ocis.services.search.v0.SearchIndexResponse (*IndexSpaceRequest)(nil), // 4: ocis.services.search.v0.IndexSpaceRequest (*IndexSpaceResponse)(nil), // 5: ocis.services.search.v0.IndexSpaceResponse - (*v0.Match)(nil), // 6: ocis.messages.search.v0.Match - (*v0.Reference)(nil), // 7: ocis.messages.search.v0.Reference + (*v0.Reference)(nil), // 6: ocis.messages.search.v0.Reference + (*v0.Match)(nil), // 7: ocis.messages.search.v0.Match } var file_ocis_services_search_v0_search_proto_depIdxs = []int32{ - 6, // 0: ocis.services.search.v0.SearchResponse.matches:type_name -> ocis.messages.search.v0.Match - 7, // 1: ocis.services.search.v0.SearchIndexRequest.ref:type_name -> ocis.messages.search.v0.Reference - 6, // 2: ocis.services.search.v0.SearchIndexResponse.matches:type_name -> ocis.messages.search.v0.Match - 0, // 3: ocis.services.search.v0.SearchProvider.Search:input_type -> ocis.services.search.v0.SearchRequest - 4, // 4: ocis.services.search.v0.SearchProvider.IndexSpace:input_type -> ocis.services.search.v0.IndexSpaceRequest - 2, // 5: ocis.services.search.v0.IndexProvider.Search:input_type -> ocis.services.search.v0.SearchIndexRequest - 1, // 6: ocis.services.search.v0.SearchProvider.Search:output_type -> ocis.services.search.v0.SearchResponse - 5, // 7: ocis.services.search.v0.SearchProvider.IndexSpace:output_type -> ocis.services.search.v0.IndexSpaceResponse - 3, // 8: ocis.services.search.v0.IndexProvider.Search:output_type -> ocis.services.search.v0.SearchIndexResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 6, // 0: ocis.services.search.v0.SearchRequest.ref:type_name -> ocis.messages.search.v0.Reference + 7, // 1: ocis.services.search.v0.SearchResponse.matches:type_name -> ocis.messages.search.v0.Match + 6, // 2: ocis.services.search.v0.SearchIndexRequest.ref:type_name -> ocis.messages.search.v0.Reference + 7, // 3: ocis.services.search.v0.SearchIndexResponse.matches:type_name -> ocis.messages.search.v0.Match + 0, // 4: ocis.services.search.v0.SearchProvider.Search:input_type -> ocis.services.search.v0.SearchRequest + 4, // 5: ocis.services.search.v0.SearchProvider.IndexSpace:input_type -> ocis.services.search.v0.IndexSpaceRequest + 2, // 6: ocis.services.search.v0.IndexProvider.Search:input_type -> ocis.services.search.v0.SearchIndexRequest + 1, // 7: ocis.services.search.v0.SearchProvider.Search:output_type -> ocis.services.search.v0.SearchResponse + 5, // 8: ocis.services.search.v0.SearchProvider.IndexSpace:output_type -> ocis.services.search.v0.IndexSpaceResponse + 3, // 9: ocis.services.search.v0.IndexProvider.Search:output_type -> ocis.services.search.v0.SearchIndexResponse + 7, // [7:10] is the sub-list for method output_type + 4, // [4:7] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_ocis_services_search_v0_search_proto_init() } diff --git a/protogen/gen/ocis/services/search/v0/search.swagger.json b/protogen/gen/ocis/services/search/v0/search.swagger.json index 466cb30f4b6..0901be95f8a 100644 --- a/protogen/gen/ocis/services/search/v0/search.swagger.json +++ b/protogen/gen/ocis/services/search/v0/search.swagger.json @@ -304,6 +304,9 @@ }, "query": { "type": "string" + }, + "ref": { + "$ref": "#/definitions/v0Reference" } } }, diff --git a/protogen/gen/ocis/services/thumbnails/v0/thumbnails.pb.go b/protogen/gen/ocis/services/thumbnails/v0/thumbnails.pb.go index 29930a15bc7..9d0293e6fb5 100644 --- a/protogen/gen/ocis/services/thumbnails/v0/thumbnails.pb.go +++ b/protogen/gen/ocis/services/thumbnails/v0/thumbnails.pb.go @@ -37,7 +37,6 @@ type GetThumbnailRequest struct { // The height of the thumbnail Height int32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"` // Types that are assignable to Source: - // // *GetThumbnailRequest_WebdavSource // *GetThumbnailRequest_Cs3Source Source isGetThumbnailRequest_Source `protobuf_oneof:"source"` diff --git a/protogen/proto/ocis/services/search/v0/search.proto b/protogen/proto/ocis/services/search/v0/search.proto index a5993bf1664..fc30a12fcf9 100644 --- a/protogen/proto/ocis/services/search/v0/search.proto +++ b/protogen/proto/ocis/services/search/v0/search.proto @@ -68,6 +68,7 @@ message SearchRequest { string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; string query = 3; + ocis.messages.search.v0.Reference ref = 4 [(google.api.field_behavior) = OPTIONAL]; } message SearchResponse { diff --git a/services/proxy/pkg/config/defaults/defaultconfig.go b/services/proxy/pkg/config/defaults/defaultconfig.go index 931a5c3a762..436c365a4b8 100644 --- a/services/proxy/pkg/config/defaults/defaultconfig.go +++ b/services/proxy/pkg/config/defaults/defaultconfig.go @@ -127,6 +127,11 @@ func DefaultPolicies() []config.Policy { Endpoint: "/remote.php/webdav", Backend: "http://localhost:9115", // TODO use registry? }, + { + Method: "REPORT", + Endpoint: "/dav/spaces", + Backend: "http://localhost:9115", + }, { Type: config.QueryRoute, Endpoint: "/dav/?preview=1", @@ -204,6 +209,7 @@ func DefaultPolicies() []config.Policy { } } +// EnsureDefaults adds default values to the configuration if they are not set yet func EnsureDefaults(cfg *config.Config) { // provide with defaults for shared logging, since we need a valid destination address for "envdecode". if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil { @@ -249,8 +255,8 @@ func EnsureDefaults(cfg *config.Config) { } } +// Sanitize sanitizes the configuration func Sanitize(cfg *config.Config) { - // sanitize config if cfg.Policies == nil { cfg.Policies = DefaultPolicies() } diff --git a/services/search/pkg/config/defaults/defaultconfig.go b/services/search/pkg/config/defaults/defaultconfig.go index 78690be1861..58eef066196 100644 --- a/services/search/pkg/config/defaults/defaultconfig.go +++ b/services/search/pkg/config/defaults/defaultconfig.go @@ -41,6 +41,7 @@ func DefaultConfig() *config.Config { } } +// EnsureDefaults adds default values to the configuration if they are not set yet func EnsureDefaults(cfg *config.Config) { // provide with defaults for shared logging, since we need a valid destination address for "envdecode". if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil { @@ -78,6 +79,7 @@ func EnsureDefaults(cfg *config.Config) { } } +// Sanitize sanitizes the configuration func Sanitize(cfg *config.Config) { // no http endpoint to be sanitized } diff --git a/services/search/pkg/search/provider/events_test.go b/services/search/pkg/search/provider/events_test.go index b1c9dfdc513..77f644ef49a 100644 --- a/services/search/pkg/search/provider/events_test.go +++ b/services/search/pkg/search/provider/events_test.go @@ -78,93 +78,104 @@ var _ = Describe("Searchprovider", func() { }) Describe("events", func() { - It("triggers an index update when a file has been uploaded", func() { - called := false - indexClient.On("Add", mock.Anything, mock.MatchedBy(func(riToIndex *sprovider.ResourceInfo) bool { - return riToIndex.Id.OpaqueId == ri.Id.OpaqueId - })).Return(nil).Run(func(args mock.Arguments) { - called = true + Context("with the file being in the original location", func() { + BeforeEach(func() { + gwClient.On("GetPath", mock.Anything, mock.MatchedBy(func(req *sprovider.GetPathRequest) bool { + return req.ResourceId.OpaqueId == ri.Id.OpaqueId + })).Return(&sprovider.GetPathResponse{ + Status: status.NewOK(context.Background()), + Path: ri.Path, + }, nil) }) - eventsChan <- events.FileUploaded{ - Ref: ref, - Executant: user.Id, - } - Eventually(func() bool { - return called - }, "2s").Should(BeTrue()) - }) + It("triggers an index update when a file has been uploaded", func() { + called := false + indexClient.On("Add", mock.Anything, mock.MatchedBy(func(riToIndex *sprovider.ResourceInfo) bool { + return riToIndex.Id.OpaqueId == ri.Id.OpaqueId + })).Return(nil).Run(func(args mock.Arguments) { + called = true + }) + eventsChan <- events.FileUploaded{ + Ref: ref, + Executant: user.Id, + } - It("triggers an index update when a file has been touched", func() { - called := false - indexClient.On("Add", mock.Anything, mock.MatchedBy(func(riToIndex *sprovider.ResourceInfo) bool { - return riToIndex.Id.OpaqueId == ri.Id.OpaqueId - })).Return(nil).Run(func(args mock.Arguments) { - called = true + Eventually(func() bool { + return called + }, "2s").Should(BeTrue()) }) - eventsChan <- events.FileTouched{ - Ref: ref, - Executant: user.Id, - } - Eventually(func() bool { - return called - }, "2s").Should(BeTrue()) - }) + It("triggers an index update when a file has been touched", func() { + called := false + indexClient.On("Add", mock.Anything, mock.MatchedBy(func(riToIndex *sprovider.ResourceInfo) bool { + return riToIndex.Id.OpaqueId == ri.Id.OpaqueId + })).Return(nil).Run(func(args mock.Arguments) { + called = true + }) + eventsChan <- events.FileTouched{ + Ref: ref, + Executant: user.Id, + } - It("removes an entry from the index when the file has been deleted", func() { - called := false - gwClient.On("Stat", mock.Anything, mock.Anything).Return(&sprovider.StatResponse{ - Status: status.NewNotFound(context.Background(), ""), - }, nil) - indexClient.On("Delete", mock.MatchedBy(func(id *sprovider.ResourceId) bool { - return id.OpaqueId == ri.Id.OpaqueId - })).Return(nil).Run(func(args mock.Arguments) { - called = true + Eventually(func() bool { + return called + }, "2s").Should(BeTrue()) }) - eventsChan <- events.ItemTrashed{ - Ref: ref, - ID: ri.Id, - Executant: user.Id, - } - Eventually(func() bool { - return called - }, "2s").Should(BeTrue()) - }) + It("removes an entry from the index when the file has been deleted", func() { + called := false + gwClient.On("Stat", mock.Anything, mock.Anything).Return(&sprovider.StatResponse{ + Status: status.NewNotFound(context.Background(), ""), + }, nil) + indexClient.On("Delete", mock.MatchedBy(func(id *sprovider.ResourceId) bool { + return id.OpaqueId == ri.Id.OpaqueId + })).Return(nil).Run(func(args mock.Arguments) { + called = true + }) + eventsChan <- events.ItemTrashed{ + Ref: ref, + ID: ri.Id, + Executant: user.Id, + } - It("indexes items when they are being restored", func() { - called := false - indexClient.On("Restore", mock.MatchedBy(func(id *sprovider.ResourceId) bool { - return id.OpaqueId == ri.Id.OpaqueId - })).Return(nil).Run(func(args mock.Arguments) { - called = true + Eventually(func() bool { + return called + }, "2s").Should(BeTrue()) }) - eventsChan <- events.ItemRestored{ - Ref: ref, - Executant: user.Id, - } - Eventually(func() bool { - return called - }, "2s").Should(BeTrue()) - }) + It("indexes items when they are being restored", func() { + called := false + indexClient.On("Restore", mock.MatchedBy(func(id *sprovider.ResourceId) bool { + return id.OpaqueId == ri.Id.OpaqueId + })).Return(nil).Run(func(args mock.Arguments) { + called = true + }) + eventsChan <- events.ItemRestored{ + Ref: ref, + Executant: user.Id, + } - It("indexes items when a version has been restored", func() { - called := false - indexClient.On("Add", mock.Anything, mock.MatchedBy(func(riToIndex *sprovider.ResourceInfo) bool { - return riToIndex.Id.OpaqueId == ri.Id.OpaqueId - })).Return(nil).Run(func(args mock.Arguments) { - called = true + Eventually(func() bool { + return called + }, "2s").Should(BeTrue()) }) - eventsChan <- events.FileVersionRestored{ - Ref: ref, - Executant: user.Id, - } - Eventually(func() bool { - return called - }, "2s").Should(BeTrue()) + It("indexes items when a version has been restored", func() { + called := false + indexClient.On("Add", mock.Anything, mock.MatchedBy(func(riToIndex *sprovider.ResourceInfo) bool { + return riToIndex.Id.OpaqueId == ri.Id.OpaqueId + })).Return(nil).Run(func(args mock.Arguments) { + called = true + }) + eventsChan <- events.FileVersionRestored{ + Ref: ref, + Executant: user.Id, + } + + Eventually(func() bool { + return called + }, "2s").Should(BeTrue()) + }) }) It("indexes items when they are being moved", func() { diff --git a/services/search/pkg/search/provider/searchprovider.go b/services/search/pkg/search/provider/searchprovider.go index 9e5d22c51c2..bcdaab4cdf7 100644 --- a/services/search/pkg/search/provider/searchprovider.go +++ b/services/search/pkg/search/provider/searchprovider.go @@ -138,6 +138,14 @@ func (p *Provider) Search(ctx context.Context, req *searchsvc.SearchRequest) (*s SpaceId: space.Root.SpaceId, OpaqueId: space.Root.OpaqueId, } + + if req.Ref != nil && + (req.Ref.ResourceId.StorageId != searchRootId.StorageId || + req.Ref.ResourceId.SpaceId != searchRootId.SpaceId || + req.Ref.ResourceId.OpaqueId != searchRootId.OpaqueId) { + continue + } + var ( mountpointRootID *searchmsg.ResourceID rootName string diff --git a/services/search/pkg/search/provider/searchprovider_test.go b/services/search/pkg/search/provider/searchprovider_test.go index f16e6f6f1f8..8caa5ea72d4 100644 --- a/services/search/pkg/search/provider/searchprovider_test.go +++ b/services/search/pkg/search/provider/searchprovider_test.go @@ -50,7 +50,7 @@ var _ = Describe("Searchprovider", func() { }, }, Id: &sprovider.StorageSpaceId{OpaqueId: "storageid$personalspace!personalspace"}, - Root: &sprovider.ResourceId{StorageId: "storageid", SpaceId: "personalspace", OpaqueId: "storageid"}, + Root: &sprovider.ResourceId{StorageId: "storageid", SpaceId: "personalspace", OpaqueId: "personalspace"}, Name: "personalspace", } @@ -80,6 +80,12 @@ var _ = Describe("Searchprovider", func() { Status: status.NewOK(context.Background()), Info: ri, }, nil) + gwClient.On("GetPath", mock.Anything, mock.MatchedBy(func(req *sprovider.GetPathRequest) bool { + return req.ResourceId.OpaqueId == ri.Id.OpaqueId + })).Return(&sprovider.GetPathResponse{ + Status: status.NewOK(context.Background()), + Path: ri.Path, + }, nil) indexClient.On("DocCount").Return(uint64(1), nil) }) @@ -370,6 +376,23 @@ var _ = Describe("Searchprovider", func() { }, nil) }) + It("considers the search Ref parameter", func() { + res, err := p.Search(ctx, &searchsvc.SearchRequest{ + Query: "foo", + Ref: &searchmsg.Reference{ + ResourceId: &searchmsg.ResourceID{ + StorageId: "storageid", + SpaceId: "personalspace", + OpaqueId: "personalspace", + }, + }, + }) + Expect(err).ToNot(HaveOccurred()) + Expect(res).ToNot(BeNil()) + Expect(len(res.Matches)).To(Equal(1)) + Expect(res.Matches[0].Entity.Id.OpaqueId).To(Equal("foo-id")) + }) + It("finds matches in both the personal space AND the grant", func() { res, err := p.Search(ctx, &searchsvc.SearchRequest{ Query: "foo", diff --git a/services/search/pkg/service/v0/service.go b/services/search/pkg/service/v0/service.go index b46a7111dc2..99912b01877 100644 --- a/services/search/pkg/service/v0/service.go +++ b/services/search/pkg/service/v0/service.go @@ -96,6 +96,7 @@ func (s Service) Search(ctx context.Context, in *searchsvc.SearchRequest, out *s res, err := s.provider.Search(ctx, &searchsvc.SearchRequest{ Query: in.Query, PageSize: in.PageSize, + Ref: in.Ref, }) if err != nil { switch err.(type) { diff --git a/services/webdav/pkg/service/v0/search.go b/services/webdav/pkg/service/v0/search.go index 18258de6a27..55a6758fe92 100644 --- a/services/webdav/pkg/service/v0/search.go +++ b/services/webdav/pkg/service/v0/search.go @@ -8,6 +8,7 @@ import ( "net/http" "path" "strconv" + "strings" "time" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" @@ -46,10 +47,30 @@ func (g Webdav) Search(w http.ResponseWriter, r *http.Request) { t := r.Header.Get(TokenHeader) ctx := revactx.ContextSetToken(r.Context(), t) ctx = metadata.Set(ctx, revactx.TokenHeader, t) - rsp, err := g.searchClient.Search(ctx, &searchsvc.SearchRequest{ + + req := &searchsvc.SearchRequest{ Query: rep.SearchFiles.Search.Pattern, PageSize: int32(rep.SearchFiles.Search.Limit), - }) + } + + // Limit search to the according space when searching /dav/spaces/ + if strings.HasPrefix(r.URL.Path, "/dav/spaces") { + space := strings.TrimPrefix(r.URL.Path, "/dav/spaces/") + rid, err := storagespace.ParseID(space) + if err != nil { + g.log.Error().Err(err).Msg("error parsing the space id for filtering") + } else { + req.Ref = &searchmsg.Reference{ + ResourceId: &searchmsg.ResourceID{ + StorageId: rid.StorageId, + SpaceId: rid.SpaceId, + OpaqueId: rid.SpaceId, + }, + } + } + } + + rsp, err := g.searchClient.Search(ctx, req) if err != nil { e := merrors.Parse(err.Error()) switch e.Code { diff --git a/services/webdav/pkg/service/v0/service.go b/services/webdav/pkg/service/v0/service.go index 60f9096aa21..13e74c90648 100644 --- a/services/webdav/pkg/service/v0/service.go +++ b/services/webdav/pkg/service/v0/service.go @@ -113,8 +113,10 @@ func NewService(opts ...Option) (Service, error) { // back to using `chi.RegisterMethod`. m.MethodNotAllowed(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { routePrefix := path.Join(options.Config.HTTP.Root, "/remote.php/dav/files/") + spacesPrefix := path.Join(options.Config.HTTP.Root, "/dav/spaces/") legacyRoutePrefix := path.Join(options.Config.HTTP.Root, "/remote.php/webdav") - if req.Method == "REPORT" && (strings.HasPrefix(req.URL.Path, routePrefix) || strings.HasPrefix(req.URL.Path, legacyRoutePrefix)) { + if req.Method == "REPORT" && + (strings.HasPrefix(req.URL.Path, spacesPrefix) || strings.HasPrefix(req.URL.Path, routePrefix) || strings.HasPrefix(req.URL.Path, legacyRoutePrefix)) { // The URLParam will not be available here. If it is needed it // needs to be passed manually or chi needs to be fixed // To use it properly. diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index 445e472a2ad..728ce935d9e 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -590,18 +590,10 @@ _ocdav: api compatibility, return correct status code_ #### [/webdav and spaces endpoint does not allow REPORT requests](https://github.com/owncloud/ocis/issues/4034) -- [apiWebdavOperations/search.feature:48](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/search.feature#L48) -- [apiWebdavOperations/search.feature:70](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/search.feature#L70) -- [apiWebdavOperations/search.feature:93](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/search.feature#L93) -- [apiWebdavOperations/search.feature:108](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/search.feature#L108) -- [apiWebdavOperations/search.feature:132](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/search.feature#L132) -- [apiWebdavOperations/search.feature:156](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/search.feature#L156) -- [apiWebdavOperations/search.feature:180](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/search.feature#L180) - [apiWebdavOperations/search.feature:207](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/search.feature#L207) - [apiWebdavOperations/search.feature:213](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/search.feature#L213) - [apiWebdavOperations/search.feature:239](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/search.feature#L239) - [apiWebdavOperations/search.feature:245](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/search.feature#L245) -- [apiWebdavOperations/search.feature:270](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/search.feature#L270) ### [No permissions property in response while searching for files and folders on ocis with new webdav](https://github.com/owncloud/ocis/issues/4009) From eaba39639433e895936f03ad095d9a0289a97534 Mon Sep 17 00:00:00 2001 From: Andre Duffeck Date: Tue, 27 Sep 2022 10:39:42 +0200 Subject: [PATCH 03/19] Fix unfindable entities (#4651) * Fix unfindable entities from shares/publicshares Directories or empty files weren't added to the search index properly because they were indexed relative to the share instead of the space root. Fixes https://github.com/owncloud/ocis/issues/4489 * Add changelog * Fix tests * Reuse existing authorized context --- .../unreleased/fix-unfindable-entities.md | 8 ++++ services/search/pkg/search/provider/events.go | 44 +++++++++++-------- .../search/pkg/search/provider/events_test.go | 2 + .../pkg/search/provider/searchprovider.go | 26 +++++++++++ .../search/provider/searchprovider_test.go | 2 +- 5 files changed, 63 insertions(+), 19 deletions(-) create mode 100644 changelog/unreleased/fix-unfindable-entities.md diff --git a/changelog/unreleased/fix-unfindable-entities.md b/changelog/unreleased/fix-unfindable-entities.md new file mode 100644 index 00000000000..772cf5c4791 --- /dev/null +++ b/changelog/unreleased/fix-unfindable-entities.md @@ -0,0 +1,8 @@ +Bugfix: Fix unfindable entities from shares/publicshares + +We fixed a problem where directories or empty files weren't findable because +they were to the search index improperly when created through a share or +publicshare. + +https://github.com/owncloud/ocis/pull/4651 +https://github.com/owncloud/ocis/issues/4489 diff --git a/services/search/pkg/search/provider/events.go b/services/search/pkg/search/provider/events.go index b68a13a418a..525daf3e8da 100644 --- a/services/search/pkg/search/provider/events.go +++ b/services/search/pkg/search/provider/events.go @@ -32,7 +32,11 @@ func (p *Provider) handleEvent(ev interface{}) { Id: e.Executant, } - statRes, err := p.statResource(ref, owner) + ownerCtx, err := p.getAuthContext(owner) + if err != nil { + return + } + statRes, err := p.statResource(ownerCtx, ref, owner) if err != nil { p.logger.Error().Err(err).Msg("failed to stat the changed resource") return @@ -56,7 +60,11 @@ func (p *Provider) handleEvent(ev interface{}) { Id: e.Executant, } - statRes, err := p.statResource(ref, owner) + ownerCtx, err := p.getAuthContext(owner) + if err != nil { + return + } + statRes, err := p.statResource(ownerCtx, ref, owner) if err != nil { p.logger.Error().Err(err).Msg("failed to stat the moved resource") return @@ -66,7 +74,7 @@ func (p *Provider) handleEvent(ev interface{}) { return } - gpRes, err := p.getPath(statRes.Info.Id, owner) + gpRes, err := p.getPath(ownerCtx, statRes.Info.Id, owner) if err != nil { p.logger.Error().Err(err).Interface("ref", ref).Msg("failed to get path for moved resource") return @@ -107,7 +115,12 @@ func (p *Provider) handleEvent(ev interface{}) { } p.logger.Debug().Interface("event", ev).Msg("resource has been changed, updating the document") - statRes, err := p.statResource(ref, owner) + ownerCtx, err := p.getAuthContext(owner) + if err != nil { + return + } + + statRes, err := p.statResource(ownerCtx, ref, owner) if err != nil { p.logger.Error().Err(err).Msg("failed to stat the changed resource") return @@ -117,6 +130,11 @@ func (p *Provider) handleEvent(ev interface{}) { return } + ref, err = p.resolveReference(ownerCtx, ref, statRes.Info) + if err != nil { + p.logger.Error().Err(err).Msg("error resolving reference") + return + } err = p.indexClient.Add(ref, statRes.Info) if err != nil { p.logger.Error().Err(err).Msg("error adding updating the resource in the index") @@ -125,22 +143,12 @@ func (p *Provider) handleEvent(ev interface{}) { } } -func (p *Provider) statResource(ref *provider.Reference, owner *user.User) (*provider.StatResponse, error) { - ownerCtx, err := p.getAuthContext(owner) - if err != nil { - return nil, err - } - - return p.gwClient.Stat(ownerCtx, &provider.StatRequest{Ref: ref}) +func (p *Provider) statResource(ctx context.Context, ref *provider.Reference, owner *user.User) (*provider.StatResponse, error) { + return p.gwClient.Stat(ctx, &provider.StatRequest{Ref: ref}) } -func (p *Provider) getPath(id *provider.ResourceId, owner *user.User) (*provider.GetPathResponse, error) { - ownerCtx, err := p.getAuthContext(owner) - if err != nil { - return nil, err - } - - return p.gwClient.GetPath(ownerCtx, &provider.GetPathRequest{ResourceId: id}) +func (p *Provider) getPath(ctx context.Context, id *provider.ResourceId, owner *user.User) (*provider.GetPathResponse, error) { + return p.gwClient.GetPath(ctx, &provider.GetPathRequest{ResourceId: id}) } func (p *Provider) getAuthContext(owner *user.User) (context.Context, error) { diff --git a/services/search/pkg/search/provider/events_test.go b/services/search/pkg/search/provider/events_test.go index 77f644ef49a..7ee7f45f2a7 100644 --- a/services/search/pkg/search/provider/events_test.go +++ b/services/search/pkg/search/provider/events_test.go @@ -37,6 +37,7 @@ var _ = Describe("Searchprovider", func() { ref = &sprovider.Reference{ ResourceId: &sprovider.ResourceId{ StorageId: "storageid", + SpaceId: "rootopaqueid", OpaqueId: "rootopaqueid", }, Path: "./foo.pdf", @@ -44,6 +45,7 @@ var _ = Describe("Searchprovider", func() { ri = &sprovider.ResourceInfo{ Id: &sprovider.ResourceId{ StorageId: "storageid", + SpaceId: "rootopaqueid", OpaqueId: "opaqueid", }, Path: "foo.pdf", diff --git a/services/search/pkg/search/provider/searchprovider.go b/services/search/pkg/search/provider/searchprovider.go index bcdaab4cdf7..9e314a97fb6 100644 --- a/services/search/pkg/search/provider/searchprovider.go +++ b/services/search/pkg/search/provider/searchprovider.go @@ -282,6 +282,11 @@ func (p *Provider) IndexSpace(ctx context.Context, req *searchsvc.IndexSpaceRequ Path: utils.MakeRelativePath(filepath.Join(wd, info.Path)), ResourceId: &rootId, } + ref, err = p.resolveReference(ownerCtx, ref, info) + if err != nil { + p.logger.Error().Err(err).Msg("error resolving reference") + return nil + } err = p.indexClient.Add(ref, info) if err != nil { p.logger.Error().Err(err).Msg("error adding resource to the index") @@ -298,6 +303,27 @@ func (p *Provider) IndexSpace(ctx context.Context, req *searchsvc.IndexSpaceRequ return &searchsvc.IndexSpaceResponse{}, nil } +func (p *Provider) resolveReference(ctx context.Context, ref *provider.Reference, ri *provider.ResourceInfo) (*provider.Reference, error) { + if ref.GetResourceId().GetOpaqueId() == ref.GetResourceId().GetSpaceId() { + return ref, nil + } + + gpRes, err := p.gwClient.GetPath(ctx, &provider.GetPathRequest{ + ResourceId: ri.Id, + }) + if err != nil || gpRes.Status.Code != rpcv1beta1.Code_CODE_OK { + return nil, err + } + return &provider.Reference{ + ResourceId: &provider.ResourceId{ + StorageId: ref.GetResourceId().GetStorageId(), + SpaceId: ref.GetResourceId().GetSpaceId(), + OpaqueId: ref.GetResourceId().GetSpaceId(), + }, + Path: utils.MakeRelativePath(gpRes.Path), + }, nil +} + func (p *Provider) logDocCount() { c, err := p.indexClient.DocCount() if err != nil { diff --git a/services/search/pkg/search/provider/searchprovider_test.go b/services/search/pkg/search/provider/searchprovider_test.go index 8caa5ea72d4..933200ab4cf 100644 --- a/services/search/pkg/search/provider/searchprovider_test.go +++ b/services/search/pkg/search/provider/searchprovider_test.go @@ -107,7 +107,7 @@ var _ = Describe("Searchprovider", func() { })).Return(nil) res, err := p.IndexSpace(ctx, &searchsvc.IndexSpaceRequest{ - SpaceId: "storageid", + SpaceId: "storageid$spaceid!spaceid", UserId: "user", }) Expect(err).ToNot(HaveOccurred()) From 6ca8a04311bd831b2d50e30119e24a3d6ca115ae Mon Sep 17 00:00:00 2001 From: Andre Duffeck Date: Tue, 27 Sep 2022 08:42:02 +0000 Subject: [PATCH 04/19] Automated changelog update [skip ci] --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60cd338837d..fa253199be5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,13 @@ The following sections list the changes for unreleased. * Bugfix - Fix notifications service settings: [#4652](https://github.com/owncloud/ocis/pull/4652) * Bugfix - Fix the OIDC provider cache: [#4600](https://github.com/owncloud/ocis/pull/4600) * Bugfix - Render webdav permissions as string in search report: [#4575](https://github.com/owncloud/ocis/issues/4575) +* Bugfix - Fix unfindable entities from shares/publicshares: [#4651](https://github.com/owncloud/ocis/pull/4651) * Bugfix - Graph service now forwards trace context: [#4582](https://github.com/owncloud/ocis/pull/4582) * Bugfix - Fix wopi access to public shares: [#4631](https://github.com/owncloud/ocis/pull/4631) * Enhancement - Add Email templating: [#4564](https://github.com/owncloud/ocis/pull/4564) * Enhancement - Add webURL to space root: [#4588](https://github.com/owncloud/ocis/pull/4588) * Enhancement - Allow to configuring the reva cache store: [#4627](https://github.com/owncloud/ocis/pull/4627) +* Enhancement - Add support for REPORT requests to /dav/spaces URLs: [#4661](https://github.com/owncloud/ocis/pull/4661) * Enhancement - Allow to configure applications in Web: [#4578](https://github.com/owncloud/ocis/pull/4578) * Enhancement - Restrict admins from self-removal: [#3713](https://github.com/owncloud/ocis/issues/3713) * Enhancement - Add thumbnails support for tiff and bmp files: [#4634](https://github.com/owncloud/ocis/pull/4634) @@ -53,6 +55,14 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/issues/4575 https://github.com/owncloud/ocis/pull/4579 +* Bugfix - Fix unfindable entities from shares/publicshares: [#4651](https://github.com/owncloud/ocis/pull/4651) + + We fixed a problem where directories or empty files weren't findable because they were to the + search index improperly when created through a share or publicshare. + + https://github.com/owncloud/ocis/issues/4489 + https://github.com/owncloud/ocis/pull/4651 + * Bugfix - Graph service now forwards trace context: [#4582](https://github.com/owncloud/ocis/pull/4582) https://github.com/owncloud/ocis/pull/4582 @@ -87,6 +97,13 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4627 +* Enhancement - Add support for REPORT requests to /dav/spaces URLs: [#4661](https://github.com/owncloud/ocis/pull/4661) + + We added support for /dav/spaces REPORT requests which allow for searching specific spaces. + + https://github.com/owncloud/ocis/issues/4034 + https://github.com/owncloud/ocis/pull/4661 + * Enhancement - Allow to configure applications in Web: [#4578](https://github.com/owncloud/ocis/pull/4578) We've added the possibility to configure applications in the Web configuration. From d0b069dfb3ea8d0dbfb909296e772280df3810e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 06:12:52 +0000 Subject: [PATCH 05/19] Bump github.com/MicahParks/keyfunc from 1.2.2 to 1.3.0 Bumps [github.com/MicahParks/keyfunc](https://github.com/MicahParks/keyfunc) from 1.2.2 to 1.3.0. - [Release notes](https://github.com/MicahParks/keyfunc/releases) - [Commits](https://github.com/MicahParks/keyfunc/compare/v1.2.2...v1.3.0) --- updated-dependencies: - dependency-name: github.com/MicahParks/keyfunc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 297985e7710..f590322f0c5 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/CiscoM31/godata v1.0.5 github.com/Masterminds/semver v1.5.0 - github.com/MicahParks/keyfunc v1.2.2 + github.com/MicahParks/keyfunc v1.3.0 github.com/ReneKroon/ttlcache/v2 v2.11.0 github.com/armon/go-radix v1.0.0 github.com/blevesearch/bleve/v2 v2.3.4 diff --git a/go.sum b/go.sum index 57508f73a6a..710662618e2 100644 --- a/go.sum +++ b/go.sum @@ -102,8 +102,8 @@ github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3Q github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/MicahParks/keyfunc v1.2.2 h1:MtA/6bnmhcyDMarVF9QRQmfKg1ssKxH1C+k3Gw8DY1g= -github.com/MicahParks/keyfunc v1.2.2/go.mod h1:GWZYIBflWXRPShQPMFRrUg+8buvyD0IWeg3Fi2rcrME= +github.com/MicahParks/keyfunc v1.3.0 h1:+3nQWlJ3UYdAr1syqHjF3cRE+pWCOCFCqCo2allP8oM= +github.com/MicahParks/keyfunc v1.3.0/go.mod h1:GWZYIBflWXRPShQPMFRrUg+8buvyD0IWeg3Fi2rcrME= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= From 9062e891c6fec6cfb7bc01bd473ed70325b207eb Mon Sep 17 00:00:00 2001 From: Kiran Parajuli Date: Mon, 26 Sep 2022 11:25:19 +0545 Subject: [PATCH 06/19] Check for all web related existing cache before generating Signed-off-by: Kiran Parajuli --- .drone.star | 197 ++++++++++++++++---------- tests/config/drone/check_web_cache.sh | 13 +- 2 files changed, 132 insertions(+), 78 deletions(-) diff --git a/.drone.star b/.drone.star index 04b0fefcd0e..14703a2567c 100644 --- a/.drone.star +++ b/.drone.star @@ -276,15 +276,15 @@ def main(ctx): pipelineSanityChecks(ctx, pipelines) return pipelines -def buildWebCache(ctx): - return [{ +def cachePipeline(name, steps): + return { "kind": "pipeline", "type": "docker", - "name": "build-web-cache", + "name": "build-%s-cache" % name, "clone": { "disable": True, }, - "steps": generateWebCache(ctx), + "steps": steps, "trigger": { "ref": [ "refs/heads/master", @@ -292,7 +292,14 @@ def buildWebCache(ctx): "refs/pull/**", ], }, - }] + } + +def buildWebCache(ctx): + return [ + cachePipeline("web", generateWebCache(ctx)), + cachePipeline("web-acceptance", generateWebAcceptanceCache(ctx)), + cachePipeline("web-e2e", generateWebE2ECache(ctx)), + ] def testOcisModules(ctx): pipelines = [] @@ -2870,45 +2877,127 @@ def setupForLitmus(): ], }] -def generateWebCache(ctx): +def getDroneEnvAndCheckScript(ctx): ocis_git_base_url = "https://raw.githubusercontent.com/owncloud/ocis" path_to_drone_env = "%s/%s/.drone.env" % (ocis_git_base_url, ctx.build.commit) path_to_check_script = "%s/%s/tests/config/drone/check_web_cache.sh" % (ocis_git_base_url, ctx.build.commit) + return { + "name": "get-drone-env-and-check-script", + "image": OC_UBUNTU, + "commands": [ + "curl -s -o .drone.env %s" % path_to_drone_env, + "curl -s -o check_web_cache.sh %s" % path_to_check_script, + ], + } - return [ - { - "name": "get-drone-env-and-check-script", - "image": OC_UBUNTU, - "commands": [ - "curl -s -o .drone.env %s" % path_to_drone_env, - "curl -s -o check_web_cache.sh %s" % path_to_check_script, - ], - }, - { - "name": "check-for-web-cache", - "image": OC_UBUNTU, - "environment": { - "CACHE_ENDPOINT": { - "from_secret": "cache_public_s3_server", - }, - "CACHE_BUCKET": { - "from_secret": "cache_public_s3_bucket", - }, +def checkForWebCache(name): + return { + "name": "check-for-%s-cache" % name, + "image": OC_UBUNTU, + "environment": { + "CACHE_ENDPOINT": { + "from_secret": "cache_public_s3_server", + }, + "CACHE_BUCKET": { + "from_secret": "cache_public_s3_bucket", }, - "commands": [ - "bash check_web_cache.sh", - ], }, + "commands": [ + "bash -x check_web_cache.sh %s" % name, + ], + } + +def cloneWeb(): + return { + "name": "clone-web", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "commands": [ + ". ./.drone.env", + "rm -rf %s" % dirs["web"], + "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git %s" % dirs["web"], + "cd %s && git checkout $WEB_COMMITID" % dirs["web"], + ], + } + +def generateWebAcceptanceCache(ctx): + return [ + getDroneEnvAndCheckScript(ctx), + checkForWebCache("acceptance"), + cloneWeb(), { - "name": "clone-web", + "name": "install-yarn", "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, "commands": [ - ". ./.drone.env", - "rm -rf %s" % dirs["web"], - "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git %s" % dirs["web"], - "cd %s && git checkout $WEB_COMMITID" % dirs["web"], + "cd %s" % dirs["web"], + "cd tests/acceptance", + "retry -t 3 'yarn install --immutable --frozen-lockfile'", ], }, + { + "name": "zip-yarn", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "commands": [ + # zip the yarn deps before caching + "if [ ! -d '%s' ]; then mkdir -p %s; fi" % (dirs["zip"], dirs["zip"]), + "cd %s" % dirs["web"], + "cd tests/acceptance", + "tar -czvf %s .yarn" % dirs["acceptanceYarnZip"], + ], + }, + { + "name": "cache-yarn", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "source ./.drone.env", + # cache using the minio/mc client to the public bucket (long term bucket) + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc cp -r -a %s s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID" % dirs["acceptanceYarnZip"], + ], + }, + ] + +def generateWebE2ECache(ctx): + return [ + getDroneEnvAndCheckScript(ctx), + checkForWebCache("e2e"), + cloneWeb(), + { + "name": "install-yarn", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "commands": [ + "cd %s" % dirs["web"], + "retry -t 3 'yarn install --immutable --frozen-lockfile'", + ], + }, + { + "name": "zip-yarn", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "commands": [ + # zip the yarn deps before caching + "if [ ! -d '%s' ]; then mkdir -p %s; fi" % (dirs["zip"], dirs["zip"]), + "cd %s" % dirs["web"], + "tar -czvf %s .yarn" % dirs["e2eYarnZip"], + ], + }, + { + "name": "cache-yarn", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "source ./.drone.env", + # cache using the minio/mc client to the public bucket (long term bucket) + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc cp -r -a %s s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID" % dirs["e2eYarnZip"], + ], + }, + ] + +def generateWebCache(ctx): + return [ + getDroneEnvAndCheckScript(ctx), + checkForWebCache("web"), + cloneWeb(), { "name": "zip-web", "image": OC_UBUNTU, @@ -2928,48 +3017,6 @@ def generateWebCache(ctx): "mc cp -r -a %s s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID" % dirs["webZip"], ], }, - { - "name": "install-yarn", - "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, - "commands": [ - "cd %s" % dirs["web"], - "retry -t 3 'yarn install --immutable --frozen-lockfile'", - "cd tests/acceptance", - "retry -t 3 'yarn install --immutable --frozen-lockfile'", - ], - }, - { - "name": "zip-yarn", - "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, - "commands": [ - # zip the yarn deps before caching - "cd %s" % dirs["web"], - "tar -czvf %s .yarn" % dirs["e2eYarnZip"], - "cd tests/acceptance", - "tar -czvf %s .yarn" % dirs["acceptanceYarnZip"], - ], - }, - { - "name": "cache-yarn", - "image": MINIO_MC, - "environment": MINIO_MC_ENV, - "commands": [ - "source ./.drone.env", - # cache using the minio/mc client to the public bucket (long term bucket) - "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", - "mc cp -r -a %s s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID" % dirs["e2eYarnZip"], - "mc cp -r -a %s s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID" % dirs["acceptanceYarnZip"], - ], - }, - { - "name": "list-web-cache", - "image": MINIO_MC, - "environment": MINIO_MC_ENV, - "commands": [ - "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", - "mc ls --recursive s3/$CACHE_BUCKET/ocis/web-test-runner", - ], - }, ] def restoreWebCache(): diff --git a/tests/config/drone/check_web_cache.sh b/tests/config/drone/check_web_cache.sh index 0226db5001c..875be723d23 100644 --- a/tests/config/drone/check_web_cache.sh +++ b/tests/config/drone/check_web_cache.sh @@ -1,18 +1,25 @@ #!/bin/bash source .drone.env +# if no $1 is supplied end the script +# Can be web, acceptance or e2e +if [ -z "$1" ]; then + echo "No cache item is supplied." + exit 1 +fi + echo "Checking web version - $WEB_COMMITID in cache" -URL="$CACHE_ENDPOINT/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID/web.tar.gz" +URL="$CACHE_ENDPOINT/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID/$1.tar.gz" echo "Checking for the web cache at '$URL'." if curl --output /dev/null --silent --head --fail "$URL" then - echo "Web with commit id $WEB_COMMITID already available in cache" + echo "$1 cache with commit id $WEB_COMMITID already available." # https://discourse.drone.io/t/how-to-exit-a-pipeline-early-without-failing/3951 # exit a Pipeline early without failing exit 78 else - echo "Web with $WEB_COMMITID not available in cache" + echo "$1 cache with commit id $WEB_COMMITID was not available." fi From c119aacf2ccd028a905488326ff892be5d8f6de2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 08:46:31 +0000 Subject: [PATCH 07/19] Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc Bumps [go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.36.0 to 0.36.1. - [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.36.0...zpages/v0.36.1) --- updated-dependencies: - dependency-name: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f590322f0c5..577a48c8c1e 100644 --- a/go.mod +++ b/go.mod @@ -69,7 +69,7 @@ require ( go.etcd.io/bbolt v1.3.6 go.etcd.io/etcd/client/v3 v3.5.5 go.opencensus.io v0.23.0 - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.0 + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.1 go.opentelemetry.io/otel v1.10.0 go.opentelemetry.io/otel/exporters/jaeger v1.10.0 go.opentelemetry.io/otel/sdk v1.10.0 diff --git a/go.sum b/go.sum index 710662618e2..ed872a2afda 100644 --- a/go.sum +++ b/go.sum @@ -1282,8 +1282,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.0 h1:+jrwcA4gF8tIZmdKWgTUysKtYW2VIzywjkfgd/5OPEM= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.0/go.mod h1:h8TWwRAhQpOd0aM5nYsRD8+flnkj+526GEIVlarH7eY= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.1 h1:RQxI9u7XGv+E9x35YWa3jZhdpsphaV7VvBArNSiDtMw= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.1/go.mod h1:ylJH0hLC6Bp40dYp8rctk9HIuEM/xQRbV05d9HGTktQ= go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= From a67e354eb48b8bafccb07be9eb8b04be909d56c3 Mon Sep 17 00:00:00 2001 From: Amrita <54478846+amrita-shrestha@users.noreply.github.com> Date: Tue, 27 Sep 2022 16:45:43 +0545 Subject: [PATCH 08/19] [full-ci][tests-only]Run ocis tests without testing-app (#4560) * Run ocis tests without testing-app * add failing tests in expected to fail Co-authored-by: Swikriti Tripathi --- .drone.env | 2 +- .drone.star | 9 +---- .../expected-failures-API-on-OCIS-storage.md | 35 ++++++++++--------- 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/.drone.env b/.drone.env index 66e5b39367b..417e22c6bc9 100644 --- a/.drone.env +++ b/.drone.env @@ -1,5 +1,5 @@ # The test runner source for API tests -CORE_COMMITID=abf37068ff0fb824fec331dce0a25c1d7ac85177 +CORE_COMMITID=31529dcebe93e1d856d7034a8c0bbbde3b782390 CORE_BRANCH=master # The test runner source for UI tests diff --git a/.drone.star b/.drone.star index 04b0fefcd0e..2decf1c3e45 100644 --- a/.drone.star +++ b/.drone.star @@ -459,8 +459,7 @@ def cacheCoreReposForTesting(ctx): cloneCoreRepos() + # this does not support the absolute path to the target directory # so we need to use a relative path :( - rebuildBuildArtifactCache(ctx, "testrunner", dirs["core"]) + - rebuildBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]), + rebuildBuildArtifactCache(ctx, "testrunner", dirs["core"]), "trigger": { "ref": [ "refs/heads/master", @@ -671,7 +670,6 @@ def localApiTests(ctx, storage, suite, accounts_hash_difficulty = 4): restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + ocisServer(storage, accounts_hash_difficulty) + restoreBuildArtifactCache(ctx, "testrunner", dirs["core"]) + - restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + [ { "name": "localApiTests-%s-%s" % (suite, storage), @@ -682,7 +680,6 @@ def localApiTests(ctx, storage, suite, accounts_hash_difficulty = 4): "PATH_TO_CORE": "%s/%s" % (dirs["base"], dirs["core"]), "TEST_SERVER_URL": "https://ocis-server:9200", "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), - "SKELETON_DIR": "%s/%s/data/apiSkeleton" % (dirs["base"], dirs["testing_app"]), "OCIS_SKELETON_STRATEGY": "%s" % ("copy" if storage == "owncloud" else "upload"), "TEST_OCIS": "true", "SEND_SCENARIO_LINE_REFERENCES": "true", @@ -761,7 +758,6 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + ocisServer(storage, accounts_hash_difficulty) + restoreBuildArtifactCache(ctx, "testrunner", dirs["core"]) + - restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + [ { "name": "oC10ApiTests-%s-storage-%s" % (storage, part_number), @@ -772,7 +768,6 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac "PATH_TO_CORE": "%s/%s" % (dirs["base"], dirs["core"]), "TEST_SERVER_URL": "https://ocis-server:9200", "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), - "SKELETON_DIR": "%s/%s/data/apiSkeleton" % (dirs["base"], dirs["testing_app"]), "OCIS_SKELETON_STRATEGY": "%s" % ("copy" if storage == "owncloud" else "upload"), "TEST_OCIS": "true", "SEND_SCENARIO_LINE_REFERENCES": "true", @@ -879,7 +874,6 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, ocisServer(storage, accounts_hash_difficulty) + waitForSeleniumService() + waitForMiddlewareService() + - restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + [ { "name": "webUITests", @@ -889,7 +883,6 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, "BACKEND_HOST": "https://ocis-server:9200", "RUN_ON_OCIS": "true", "OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/owncloud/data", - "TESTING_DATA_DIR": "%s/%s" % (dirs["base"], dirs["testing_app"]), "WEB_UI_CONFIG": "%s/tests/config/drone/ocis-config.json" % dirs["base"], "TEST_TAGS": finalFilterTags, "LOCAL_UPLOAD_DIR": "/uploads", diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index 728ce935d9e..04054aa5f7c 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -176,9 +176,8 @@ File and sync features in a shared scenario - [apiShareManagementToShares/acceptShares.feature:366](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L366) - [apiShareManagementToShares/acceptShares.feature:402](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L402) - [apiShareManagementToShares/acceptShares.feature:304](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L304) -- [apiShareCreateSpecialToShares1/createShareUniqueReceivedNames.feature:15](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares1/createShareUniqueReceivedNames.feature#L15) -- [apiShareManagementToShares/acceptShares.feature:599](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L599) -- [apiShareManagementToShares/acceptShares.feature:664](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L664) +- [apiShareManagementToShares/acceptShares.feature:594](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L594) +- [apiShareManagementToShares/acceptShares.feature:659](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L659) - [apiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature:162](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature#L162) - [apiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature:163](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature#L163) - [apiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature:202](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature#L202) @@ -323,7 +322,7 @@ cannot share a folder with create permission #### [restoring an older version of a shared file deletes the share](https://github.com/owncloud/ocis/issues/765) -- [apiShareManagementToShares/acceptShares.feature:588](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L588) +- [apiShareManagementToShares/acceptShares.feature:583](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L583) #### [Expiration date for shares is not implemented](https://github.com/owncloud/ocis/issues/1250) @@ -494,9 +493,9 @@ User and group management features special character username not valid -- [apiTrashbin/trashbinFilesFolders.feature:336](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L336) - [apiTrashbin/trashbinFilesFolders.feature:337](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L337) - [apiTrashbin/trashbinFilesFolders.feature:338](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L338) +- [apiTrashbin/trashbinFilesFolders.feature:339](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L339) #### [incorrect ocs(v2) status value when getting info of share that does not exist should be 404, gives 998](https://github.com/owncloud/product/issues/250) @@ -897,8 +896,8 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiShareManagementToShares/acceptShares.feature:252](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L252) - [apiShareManagementToShares/acceptShares.feature:295](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L295) - [apiShareManagementToShares/acceptShares.feature:335](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L335) -- [apiShareManagementToShares/acceptShares.feature:577](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L577) -- [apiShareManagementToShares/acceptShares.feature:578](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L578) +- [apiShareManagementToShares/acceptShares.feature:572](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L572) +- [apiShareManagementToShares/acceptShares.feature:573](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L573) - [apiShareOperationsToShares2/shareAccessByID.feature:124](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/shareAccessByID.feature#L124) - [apiShareOperationsToShares2/shareAccessByID.feature:125](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/shareAccessByID.feature#L125) - [apiShareManagementBasicToShares/deleteShareFromShares.feature:185](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/deleteShareFromShares.feature#L185) @@ -980,10 +979,10 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers #### [HTTP status code differ while listing the contents of another user's trash bin](https://github.com/owncloud/ocis/issues/3561) - [apiTrashbin/trashbinFilesFolders.feature:199](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L199) - [apiTrashbin/trashbinFilesFolders.feature:223](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L223) -- [apiTrashbin/trashbinFilesFolders.feature:253](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L253) -- [apiTrashbin/trashbinFilesFolders.feature:269](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L269) -- [apiTrashbin/trashbinFilesFolders.feature:278](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L278) -- [apiTrashbin/trashbinFilesFolders.feature:283](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L283) +- [apiTrashbin/trashbinFilesFolders.feature:254](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L254) +- [apiTrashbin/trashbinFilesFolders.feature:270](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L270) +- [apiTrashbin/trashbinFilesFolders.feature:279](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L279) +- [apiTrashbin/trashbinFilesFolders.feature:284](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L284) #### [HTTP status code differ while deleting file of another user's trash bin](https://github.com/owncloud/ocis/issues/3544) @@ -1009,16 +1008,16 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiTrashbin/trashbinFilesFolders.feature:99](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L99) - [apiTrashbin/trashbinFilesFolders.feature:135](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L135) - [apiTrashbin/trashbinFilesFolders.feature:158](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L158) -- [apiTrashbin/trashbinFilesFolders.feature:343](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L343) - [apiTrashbin/trashbinFilesFolders.feature:344](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L344) - [apiTrashbin/trashbinFilesFolders.feature:345](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L345) - [apiTrashbin/trashbinFilesFolders.feature:346](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L346) - [apiTrashbin/trashbinFilesFolders.feature:347](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L347) - [apiTrashbin/trashbinFilesFolders.feature:348](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L348) -- [apiTrashbin/trashbinFilesFolders.feature:364](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L364) -- [apiTrashbin/trashbinFilesFolders.feature:384](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L384) -- [apiTrashbin/trashbinFilesFolders.feature:438](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L438) -- [apiTrashbin/trashbinFilesFolders.feature:475](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L475) +- [apiTrashbin/trashbinFilesFolders.feature:349](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L349) +- [apiTrashbin/trashbinFilesFolders.feature:365](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L365) +- [apiTrashbin/trashbinFilesFolders.feature:385](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L385) +- [apiTrashbin/trashbinFilesFolders.feature:439](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L439) +- [apiTrashbin/trashbinFilesFolders.feature:476](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L476) #### [valid WebDAV (DELETE, COPY or MOVE) requests with body must exit with 415](https://github.com/owncloud/ocis/issues/4332) @@ -1027,5 +1026,9 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiAuthWebDav/webDavCOPYAuth.feature:166](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiAuthWebDav/webDavCOPYAuth.feature#L166) - [apiAuthWebDav/webDavCOPYAuth.feature:178](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiAuthWebDav/webDavCOPYAuth.feature#L178) +#### [Identical shares have different naming convention in oc10 and ocis](https://github.com/owncloud/ocis/issues/4674) +#### [different url encoding pattern used in oc10 and ocis for identical share ](https://github.com/owncloud/ocis/issues/4676) +- [apiShareCreateSpecialToShares1/createShareUniqueReceivedNames.feature:15](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares1/createShareUniqueReceivedNames.feature#L15) + Note: always have an empty line at the end of this file. The bash script that processes this file requires that the last line has a newline on the end. From 77d14ff79c9cebddbfea2c804f758fe059fef558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 27 Sep 2022 15:10:13 +0000 Subject: [PATCH 09/19] update reva to 20220926161629 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 577a48c8c1e..70a0ff69f75 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.3 github.com/coreos/go-oidc/v3 v3.4.0 github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d - github.com/cs3org/reva/v2 v2.10.1-0.20220926153309-83c796b662f2 + github.com/cs3org/reva/v2 v2.10.1-0.20220926161629-64f579239df0 github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index ed872a2afda..f790403c1b5 100644 --- a/go.sum +++ b/go.sum @@ -297,8 +297,8 @@ github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4= github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A= github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d h1:toyZ7IsXlUdEPZ/IG8fg7hbM8HcLPY0bkX4FKBmgLVI= github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.10.1-0.20220926153309-83c796b662f2 h1:utMnpYVAar5r6nfslHVyw4ukzS9vp5v9OFpKVIXlwtE= -github.com/cs3org/reva/v2 v2.10.1-0.20220926153309-83c796b662f2/go.mod h1:NfAt4eTciYZ8EZy/3U2oJDhkYGPZOjovulh8DRHV5RI= +github.com/cs3org/reva/v2 v2.10.1-0.20220926161629-64f579239df0 h1:Q7I44TfE3OiIzxBulDRNAQyo+2y6NglkIy1jBBHGZ/k= +github.com/cs3org/reva/v2 v2.10.1-0.20220926161629-64f579239df0/go.mod h1:NfAt4eTciYZ8EZy/3U2oJDhkYGPZOjovulh8DRHV5RI= 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= From 6d8edc2986026c4347aa54baaaa50a200b25bcda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 27 Sep 2022 15:55:02 +0000 Subject: [PATCH 10/19] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa253199be5..3048642d6e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1828,7 +1828,7 @@ The following sections list the changes for 2.0.0-beta.8. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 ## Summary @@ -1996,11 +1996,28 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 ## Summary @@ -2169,23 +2186,6 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 0a46ef0b0b63a24ff74c94950f1bbb9a0709e589 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Tue, 27 Sep 2022 18:50:45 +0200 Subject: [PATCH 11/19] bring back the settings ui (#4691) --- changelog/unreleased/fix-bring-back-settings-ui.md | 5 +++++ services/web/pkg/config/defaults/defaultconfig.go | 4 ++++ services/web/pkg/service/v0/service.go | 9 --------- 3 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 changelog/unreleased/fix-bring-back-settings-ui.md diff --git a/changelog/unreleased/fix-bring-back-settings-ui.md b/changelog/unreleased/fix-bring-back-settings-ui.md new file mode 100644 index 00000000000..6d1dd1dac97 --- /dev/null +++ b/changelog/unreleased/fix-bring-back-settings-ui.md @@ -0,0 +1,5 @@ +Bugfix: Bring back the settings UI in Web + +We've fixed the oC Web configuration in oCIS so that the settings UI will be shown again in Web. + +https://github.com/owncloud/ocis/pull/4691 diff --git a/services/web/pkg/config/defaults/defaultconfig.go b/services/web/pkg/config/defaults/defaultconfig.go index cf08feeb1d5..2ed1d41bf42 100644 --- a/services/web/pkg/config/defaults/defaultconfig.go +++ b/services/web/pkg/config/defaults/defaultconfig.go @@ -49,6 +49,10 @@ func DefaultConfig() *config.Config { }, Apps: []string{"files", "search", "text-editor", "pdf-viewer", "external", "user-management"}, ExternalApps: []config.ExternalApp{ + { + ID: "settings", + Path: "/settings.js", + }, { ID: "preview", Path: "web-app-preview", diff --git a/services/web/pkg/service/v0/service.go b/services/web/pkg/service/v0/service.go index a99c4c2930b..d3aef6e4254 100644 --- a/services/web/pkg/service/v0/service.go +++ b/services/web/pkg/service/v0/service.go @@ -73,15 +73,6 @@ func (p Web) getPayload() (payload []byte, err error) { p.config.Web.Config.Theme = p.config.Web.ThemePath } - if p.config.Web.Config.ExternalApps == nil { - p.config.Web.Config.ExternalApps = []config.ExternalApp{ - { - ID: "settings", - Path: "/settings.js", - }, - } - } - // make apps render as empty array if it is empty // TODO remove once https://github.com/golang/go/issues/27589 is fixed if len(p.config.Web.Config.Apps) == 0 { From eb8748a3b12fca8ef1e144312efa9396c3b1bc6b Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Tue, 27 Sep 2022 16:52:54 +0000 Subject: [PATCH 12/19] Automated changelog update [skip ci] --- CHANGELOG.md | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3048642d6e9..082cae6da76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The following sections list the changes for unreleased. ## Summary +* Bugfix - Bring back the settings UI in Web: [#4691](https://github.com/owncloud/ocis/pull/4691) * Bugfix - Change the default value for PROXY_OIDC_INSECURE to false: [#4601](https://github.com/owncloud/ocis/pull/4601) * Bugfix - Fix notifications service settings: [#4652](https://github.com/owncloud/ocis/pull/4652) * Bugfix - Fix the OIDC provider cache: [#4600](https://github.com/owncloud/ocis/pull/4600) @@ -24,6 +25,12 @@ The following sections list the changes for unreleased. ## Details +* Bugfix - Bring back the settings UI in Web: [#4691](https://github.com/owncloud/ocis/pull/4691) + + We've fixed the oC Web configuration in oCIS so that the settings UI will be shown again in Web. + + https://github.com/owncloud/ocis/pull/4691 + * Bugfix - Change the default value for PROXY_OIDC_INSECURE to false: [#4601](https://github.com/owncloud/ocis/pull/4601) We've changed the default value for PROXY_OIDC_INSECURE to `false`. Previously the default @@ -1828,7 +1835,7 @@ The following sections list the changes for 2.0.0-beta.8. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 ## Summary @@ -1996,28 +2003,11 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 ## Summary @@ -2186,6 +2176,23 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 6bf7137c0cf4a695e27363e399b660415d6a6498 Mon Sep 17 00:00:00 2001 From: Pascal Wengerter Date: Tue, 27 Sep 2022 18:56:14 +0200 Subject: [PATCH 13/19] Bump nodejs in CI to v16 (#4062) --- .drone.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index c2e329153e0..d9d3742548a 100644 --- a/.drone.star +++ b/.drone.star @@ -38,7 +38,7 @@ SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:latest" THEGEEKLAB_DRONE_GITHUB_COMMENT = "thegeeklab/drone-github-comment:1" DEFAULT_PHP_VERSION = "7.4" -DEFAULT_NODEJS_VERSION = "14" +DEFAULT_NODEJS_VERSION = "16" dirs = { "base": "/drone/src", From 5eaf0dfe7b5ed43e71671f42504a1e4d61462095 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Tue, 27 Sep 2022 20:38:08 +0200 Subject: [PATCH 14/19] Bump reva (#4694) To get https://github.com/cs3org/reva/pull/3240 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 70a0ff69f75..4308b59f2d3 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.3 github.com/coreos/go-oidc/v3 v3.4.0 github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d - github.com/cs3org/reva/v2 v2.10.1-0.20220926161629-64f579239df0 + github.com/cs3org/reva/v2 v2.10.1-0.20220927154108-3fb6adde0e8f github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index f790403c1b5..1fcd0f307c5 100644 --- a/go.sum +++ b/go.sum @@ -297,8 +297,8 @@ github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4= github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A= github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d h1:toyZ7IsXlUdEPZ/IG8fg7hbM8HcLPY0bkX4FKBmgLVI= github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.10.1-0.20220926161629-64f579239df0 h1:Q7I44TfE3OiIzxBulDRNAQyo+2y6NglkIy1jBBHGZ/k= -github.com/cs3org/reva/v2 v2.10.1-0.20220926161629-64f579239df0/go.mod h1:NfAt4eTciYZ8EZy/3U2oJDhkYGPZOjovulh8DRHV5RI= +github.com/cs3org/reva/v2 v2.10.1-0.20220927154108-3fb6adde0e8f h1:nCfCu5BQspeZmUGOmdcfZszibiTl4Lmy+8dS6Fpxpco= +github.com/cs3org/reva/v2 v2.10.1-0.20220927154108-3fb6adde0e8f/go.mod h1:NfAt4eTciYZ8EZy/3U2oJDhkYGPZOjovulh8DRHV5RI= 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= From e4c28def8a493ada28dda5113ca921a9c8a72046 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Tue, 27 Sep 2022 21:51:18 +0200 Subject: [PATCH 15/19] Request revatoken via machine auth after autoprovsioning user (#4690) To successfully authenticate a user after it was autoprovisioned, we need to get a valid reva token. Fixes: #4616 --- changelog/unreleased/fix-autoprovison-token.md | 6 ++++++ services/proxy/pkg/middleware/account_resolver.go | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 changelog/unreleased/fix-autoprovison-token.md diff --git a/changelog/unreleased/fix-autoprovison-token.md b/changelog/unreleased/fix-autoprovison-token.md new file mode 100644 index 00000000000..c34c1221f34 --- /dev/null +++ b/changelog/unreleased/fix-autoprovison-token.md @@ -0,0 +1,6 @@ +Bugfix: Fix authentication for autoprovisioned users + +We've fixed an issue in the proxy, which made the first http request of an +autoprovisioned user fail. + +https://github.com/owncloud/ocis/issues/4616 diff --git a/services/proxy/pkg/middleware/account_resolver.go b/services/proxy/pkg/middleware/account_resolver.go index 2972264d5d8..6ccdf987d15 100644 --- a/services/proxy/pkg/middleware/account_resolver.go +++ b/services/proxy/pkg/middleware/account_resolver.go @@ -76,6 +76,10 @@ func (m accountResolver) ServeHTTP(w http.ResponseWriter, req *http.Request) { if err != nil { m.logger.Error().Err(err).Msg("Autoprovisioning user failed") } + user, token, err = m.userProvider.GetUserByClaims(req.Context(), "userid", user.Id.OpaqueId, true) + if err != nil { + m.logger.Error().Err(err).Str("userid", user.Id.OpaqueId).Msg("Error getting token for autoprovisioned user") + } } if errors.Is(err, backend.ErrAccountDisabled) { From 371295ca95f8475f2eb0b2cde1fdd6be2a5fe022 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Tue, 27 Sep 2022 19:54:32 +0000 Subject: [PATCH 16/19] Automated changelog update [skip ci] --- CHANGELOG.md | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 082cae6da76..210de9f69a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The following sections list the changes for unreleased. ## Summary +* Bugfix - Fix authentication for autoprovisioned users: [#4616](https://github.com/owncloud/ocis/issues/4616) * Bugfix - Bring back the settings UI in Web: [#4691](https://github.com/owncloud/ocis/pull/4691) * Bugfix - Change the default value for PROXY_OIDC_INSECURE to false: [#4601](https://github.com/owncloud/ocis/pull/4601) * Bugfix - Fix notifications service settings: [#4652](https://github.com/owncloud/ocis/pull/4652) @@ -25,6 +26,13 @@ The following sections list the changes for unreleased. ## Details +* Bugfix - Fix authentication for autoprovisioned users: [#4616](https://github.com/owncloud/ocis/issues/4616) + + We've fixed an issue in the proxy, which made the first http request of an autoprovisioned user + fail. + + https://github.com/owncloud/ocis/issues/4616 + * Bugfix - Bring back the settings UI in Web: [#4691](https://github.com/owncloud/ocis/pull/4691) We've fixed the oC Web configuration in oCIS so that the settings UI will be shown again in Web. @@ -1835,7 +1843,7 @@ The following sections list the changes for 2.0.0-beta.8. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 ## Summary @@ -2003,11 +2011,28 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 ## Summary @@ -2176,23 +2201,6 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 080feb672fb12bb5820b62a500a02975778d8b67 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 28 Sep 2022 01:02:17 +0000 Subject: [PATCH 17/19] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 210de9f69a2..2da04800a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1843,7 +1843,7 @@ The following sections list the changes for 2.0.0-beta.8. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 ## Summary @@ -2011,28 +2011,11 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 ## Summary @@ -2201,6 +2184,23 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 5850ba2d64006fd2878aa41e568e91b98d140d44 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 28 Sep 2022 11:47:33 +0200 Subject: [PATCH 18/19] use latest reva Signed-off-by: jkoberg --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 54ac24887c2..1751a29248c 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/blevesearch/bleve/v2 v2.3.4 github.com/coreos/go-oidc/v3 v3.4.0 github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d - github.com/cs3org/reva/v2 v2.10.1-0.20220926130532-e0a975fdee34 + github.com/cs3org/reva/v2 v2.10.1-0.20220928094556-1ed01295a37f github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index d01905ee55c..4ac05ff5611 100644 --- a/go.sum +++ b/go.sum @@ -301,6 +301,8 @@ github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d h1:toyZ7IsXlUdEP github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/cs3org/reva/v2 v2.10.1-0.20220926130532-e0a975fdee34 h1:9ZLnaPr0kyDmgKPrZ9ktQZ8fpFc7rikc6BZwgjCZ2uQ= github.com/cs3org/reva/v2 v2.10.1-0.20220926130532-e0a975fdee34/go.mod h1:zbtaXgYKJthcM2S0MZLA+ykVXIPRYE6OxMmIfbzlmaw= +github.com/cs3org/reva/v2 v2.10.1-0.20220928094556-1ed01295a37f h1:OxQs1Hx+34jeJ/5IO90jh7pQBYXtIwfHfo2eOE3YkHQ= +github.com/cs3org/reva/v2 v2.10.1-0.20220928094556-1ed01295a37f/go.mod h1:JOZwTIVUp3T/NyAWFtKI8njZIxWdTrjw7MAwSnGrLp8= 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= From 69f64da43a0c813f34e39f9dc4369d6357e10618 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 28 Sep 2022 12:12:48 +0200 Subject: [PATCH 19/19] convert SonarCloud to HappyCloud Signed-off-by: jkoberg --- services/graph/pkg/service/v0/drives.go | 8 +++++--- services/search/pkg/config/content.go | 2 ++ services/search/pkg/config/engine.go | 2 ++ services/search/pkg/content/basic.go | 3 ++- services/search/pkg/content/cs3.go | 6 +++--- services/search/pkg/content/extractor.go | 1 + services/search/pkg/content/retriever.go | 3 ++- services/search/pkg/content/tika.go | 11 ++++------- services/search/pkg/engine/bleve.go | 11 ++++++----- services/search/pkg/engine/engine.go | 3 ++- services/search/pkg/search/events.go | 2 +- services/search/pkg/search/provider.go | 16 ++++++++-------- services/search/pkg/service/grpc/v0/service.go | 2 ++ 13 files changed, 40 insertions(+), 30 deletions(-) diff --git a/services/graph/pkg/service/v0/drives.go b/services/graph/pkg/service/v0/drives.go index 2dcc07c2519..6264ab3804e 100644 --- a/services/graph/pkg/service/v0/drives.go +++ b/services/graph/pkg/service/v0/drives.go @@ -33,6 +33,8 @@ import ( merrors "go-micro.dev/v4/errors" ) +var _project = "project" + // GetDrives lists all drives the current user has access to func (g Graph) GetDrives(w http.ResponseWriter, r *http.Request) { g.getDrives(w, r, false) @@ -236,8 +238,8 @@ func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request) { driveType = *drive.DriveType } switch driveType { - case "", "project": - driveType = "project" + case "", _project: + driveType = _project maxQuota = g.maxQuotaProject default: errorcode.GeneralException.Render(w, r, http.StatusBadRequest, fmt.Sprintf("drives of type %s cannot be created via this api", driveType)) @@ -405,7 +407,7 @@ func (g Graph) UpdateDrive(w http.ResponseWriter, r *http.Request) { switch sres.StorageSpaces[0].SpaceType { case "personal": maxQuota = g.maxQuotaPersonal - case "project": + case _project: maxQuota = g.maxQuotaProject default: errorcode.GeneralException.Render(w, r, http.StatusBadRequest, fmt.Sprintf("can't patch drive of type %s", sres.StorageSpaces[0].SpaceType)) diff --git a/services/search/pkg/config/content.go b/services/search/pkg/config/content.go index 8464391744b..dae39636482 100644 --- a/services/search/pkg/config/content.go +++ b/services/search/pkg/config/content.go @@ -1,11 +1,13 @@ package config +// Extractor defines which extractor to use type Extractor struct { Type string `yaml:"type" env:"SEARCH_EXTRACTOR_TYPE" desc:"Defines the content extraction engine."` CS3AllowInsecure bool `yaml:"cs3_allow_insecure" env:"OCIS_INSECURE;SEARCH_EXTRACTOR_CS3SOURCE_INSECURE" desc:"Ignore untrusted SSL certificates when connecting to the CS3 source."` Tika ExtractorTika `yaml:"tika"` } +// ExtractorTika configures the Tika extractor type ExtractorTika struct { TikaURL string `yaml:"tika_url" env:"SEARCH_EXTRACTOR_TIKA_TIKA_URL" desc:"URL of the tika server."` } diff --git a/services/search/pkg/config/engine.go b/services/search/pkg/config/engine.go index 96d776ee9b9..39aa98fbbef 100644 --- a/services/search/pkg/config/engine.go +++ b/services/search/pkg/config/engine.go @@ -1,10 +1,12 @@ package config +// Engine defines which search engine to use type Engine struct { Type string `yaml:"type" env:"SEARCH_ENGINE_TYPE" desc:"Defines which search engine to use."` Bleve EngineBleve `yaml:"bleve"` } +// EngineBleve configures the bleve engine type EngineBleve struct { Datapath string `yaml:"data_path" env:"SEARCH_ENGINE_BLEVE_DATA_PATH" desc:"Path for the search persistence directory."` } diff --git a/services/search/pkg/content/basic.go b/services/search/pkg/content/basic.go index d507255baca..0503af293f8 100644 --- a/services/search/pkg/content/basic.go +++ b/services/search/pkg/content/basic.go @@ -2,10 +2,11 @@ package content import ( "context" + "time" + storageProvider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" "github.com/cs3org/reva/v2/pkg/tags" "github.com/owncloud/ocis/v2/ocis-pkg/log" - "time" ) // Basic is the simplest Extractor implementation. diff --git a/services/search/pkg/content/cs3.go b/services/search/pkg/content/cs3.go index 07daa3fa853..9bcdbe5f624 100644 --- a/services/search/pkg/content/cs3.go +++ b/services/search/pkg/content/cs3.go @@ -4,20 +4,20 @@ import ( "context" "crypto/tls" "fmt" + "io" + "net/http" + gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" revactx "github.com/cs3org/reva/v2/pkg/ctx" "github.com/owncloud/ocis/v2/ocis-pkg/log" - "io" - "net/http" ) type cs3 struct { client gateway.GatewayAPIClient logger log.Logger insecure bool - secret string } func newCS3Retriever(client gateway.GatewayAPIClient, logger log.Logger, insecure bool) cs3 { diff --git a/services/search/pkg/content/extractor.go b/services/search/pkg/content/extractor.go index 29eff3ddd0b..75f69af16e1 100644 --- a/services/search/pkg/content/extractor.go +++ b/services/search/pkg/content/extractor.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" ) diff --git a/services/search/pkg/content/retriever.go b/services/search/pkg/content/retriever.go index ced511480ea..bbd625732e3 100644 --- a/services/search/pkg/content/retriever.go +++ b/services/search/pkg/content/retriever.go @@ -2,9 +2,10 @@ package content import ( "context" + "io" + provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" "google.golang.org/grpc/metadata" - "io" ) // Retriever is the interface that wraps the basic Retrieve method. 🐕 diff --git a/services/search/pkg/content/tika.go b/services/search/pkg/content/tika.go index 53edf9a1495..2e8119ef15e 100644 --- a/services/search/pkg/content/tika.go +++ b/services/search/pkg/content/tika.go @@ -4,14 +4,15 @@ import ( "bytes" "context" "fmt" + "io" + "strings" + "github.com/bbalet/stopwords" gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" "github.com/google/go-tika/tika" "github.com/owncloud/ocis/v2/ocis-pkg/log" "github.com/owncloud/ocis/v2/services/search/pkg/config" - "io" - "strings" ) // Tika is used to extract content from a resource, @@ -64,11 +65,7 @@ func (t Tika) Extract(ctx context.Context, ri *provider.ResourceInfo) (Document, return doc, err } - lang, err := t.tika.Language(ctx, bytes.NewReader(d1.Bytes())) - if err != nil { - return doc, nil - } - + lang, _ := t.tika.Language(ctx, bytes.NewReader(d1.Bytes())) metas, err := t.tika.MetaRecursive(ctx, bytes.NewReader(d2.Bytes())) if err != nil { return doc, err diff --git a/services/search/pkg/engine/bleve.go b/services/search/pkg/engine/bleve.go index d976008a181..bf06adc2ed8 100644 --- a/services/search/pkg/engine/bleve.go +++ b/services/search/pkg/engine/bleve.go @@ -4,6 +4,12 @@ import ( "context" "errors" "fmt" + "math" + "path" + "path/filepath" + "strings" + "time" + "github.com/blevesearch/bleve/v2" "github.com/blevesearch/bleve/v2/analysis/analyzer/custom" "github.com/blevesearch/bleve/v2/analysis/analyzer/keyword" @@ -21,11 +27,6 @@ import ( "golang.org/x/text/cases" "golang.org/x/text/language" "google.golang.org/protobuf/types/known/timestamppb" - "math" - "path" - "path/filepath" - "strings" - "time" ) // Bleve represents a search engine which utilizes bleve to search and store resources. diff --git a/services/search/pkg/engine/engine.go b/services/search/pkg/engine/engine.go index d4b59f348f9..09f2fe1c09b 100644 --- a/services/search/pkg/engine/engine.go +++ b/services/search/pkg/engine/engine.go @@ -2,11 +2,12 @@ package engine import ( "context" + "regexp" + storageProvider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" searchMessage "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/search/v0" searchSearvice "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/search/v0" "github.com/owncloud/ocis/v2/services/search/pkg/content" - "regexp" ) //go:generate mockery --name=Engine diff --git a/services/search/pkg/search/events.go b/services/search/pkg/search/events.go index dc2291f911e..784b382f588 100644 --- a/services/search/pkg/search/events.go +++ b/services/search/pkg/search/events.go @@ -25,7 +25,7 @@ type eventHandler struct { // HandleEvents listens to the needed events, // it handles the whole resource indexing livecycle. -func HandleEvents(eng engine.Engine, extractor content.Extractor, gw gateway.GatewayAPIClient, bus events.Stream, logger log.Logger, cfg *config.Config) error { +func HandleEvents(eng engine.Engine, extractor content.Extractor, gw gateway.GatewayAPIClient, bus events.Consumer, logger log.Logger, cfg *config.Config) error { evts := []events.Unmarshaller{ events.ItemTrashed{}, events.ItemRestored{}, diff --git a/services/search/pkg/search/provider.go b/services/search/pkg/search/provider.go index f6619b79d8a..c2dd3d5b5b2 100644 --- a/services/search/pkg/search/provider.go +++ b/services/search/pkg/search/provider.go @@ -105,27 +105,27 @@ func (p *Provider) Search(ctx context.Context, req *searchsvc.SearchRequest) (*s continue } opaqueMap := sdk.DecodeOpaqueMap(space.Opaque) - grantSpaceId := storagespace.FormatResourceID(provider.ResourceId{ + grantSpaceID := storagespace.FormatResourceID(provider.ResourceId{ StorageId: opaqueMap["grantStorageID"], SpaceId: opaqueMap["grantSpaceID"], OpaqueId: opaqueMap["grantOpaqueID"], }) - mountpointMap[grantSpaceId] = space.Id.OpaqueId + mountpointMap[grantSpaceID] = space.Id.OpaqueId } matches := matchArray{} total := int32(0) for _, space := range listSpacesRes.StorageSpaces { - searchRootId := &searchmsg.ResourceID{ + searchRootID := &searchmsg.ResourceID{ StorageId: space.Root.StorageId, SpaceId: space.Root.SpaceId, OpaqueId: space.Root.OpaqueId, } if req.Ref != nil && - (req.Ref.ResourceId.StorageId != searchRootId.StorageId || - req.Ref.ResourceId.SpaceId != searchRootId.SpaceId || - req.Ref.ResourceId.OpaqueId != searchRootId.OpaqueId) { + (req.Ref.ResourceId.StorageId != searchRootID.StorageId || + req.Ref.ResourceId.SpaceId != searchRootID.SpaceId || + req.Ref.ResourceId.OpaqueId != searchRootID.OpaqueId) { continue } @@ -140,7 +140,7 @@ func (p *Provider) Search(ctx context.Context, req *searchsvc.SearchRequest) (*s continue // mountpoint spaces are only "links" to the shared spaces. we have to search the shared "grant" space instead case "grant": // In case of grant spaces we search the root of the outer space and translate the paths to the according mountpoint - searchRootId.OpaqueId = space.Root.SpaceId + searchRootID.OpaqueId = space.Root.SpaceId mountpointID, ok := mountpointMap[space.Id.OpaqueId] if !ok { p.logger.Warn().Interface("space", space).Msg("could not find mountpoint space for grant space") @@ -178,7 +178,7 @@ func (p *Provider) Search(ctx context.Context, req *searchsvc.SearchRequest) (*s res, err := p.engine.Search(ctx, &searchsvc.SearchIndexRequest{ Query: req.Query, Ref: &searchmsg.Reference{ - ResourceId: searchRootId, + ResourceId: searchRootID, Path: mountpointPrefix, }, PageSize: req.PageSize, diff --git a/services/search/pkg/service/grpc/v0/service.go b/services/search/pkg/service/grpc/v0/service.go index 947b4b3b5a0..7218d9312b3 100644 --- a/services/search/pkg/service/grpc/v0/service.go +++ b/services/search/pkg/service/grpc/v0/service.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + revactx "github.com/cs3org/reva/v2/pkg/ctx" "github.com/cs3org/reva/v2/pkg/errtypes" "github.com/cs3org/reva/v2/pkg/events/server" @@ -94,6 +95,7 @@ type Service struct { provider *search.Provider } +// Search handles the search func (s Service) Search(ctx context.Context, in *searchsvc.SearchRequest, out *searchsvc.SearchResponse) error { // Get token from the context (go-micro) and make it known to the reva client too (grpc) t, ok := metadata.Get(ctx, revactx.TokenHeader)