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..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", @@ -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 = [] @@ -459,8 +466,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 +677,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 +687,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 +765,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 +775,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 +881,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 +890,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", @@ -2870,45 +2870,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 +3010,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/CHANGELOG.md b/CHANGELOG.md index 60cd338837d..2da04800a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,15 +6,19 @@ 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) * 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) @@ -22,6 +26,19 @@ 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. + + 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 @@ -53,6 +70,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 +112,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. 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/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/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/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/go.mod b/go.mod index 013e00ef41a..1751a29248c 100644 --- a/go.mod +++ b/go.mod @@ -5,14 +5,14 @@ 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/bbalet/stopwords v1.0.0 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.20220928081219-44d46076348c + 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 @@ -70,7 +70,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 2ff07232a75..3632167f783 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= @@ -299,8 +299,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.20220928081219-44d46076348c h1:r5n03AB/yRCqO+/FfnoUrtDOdVe4ACU8nU+pBaLg3Wg= -github.com/cs3org/reva/v2 v2.10.1-0.20220928081219-44d46076348c/go.mod h1:JOZwTIVUp3T/NyAWFtKI8njZIxWdTrjw7MAwSnGrLp8= +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= @@ -1287,8 +1287,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= 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 3dccb2a0211..cbcce079c56 100644 --- a/protogen/gen/ocis/services/search/v0/search.swagger.json +++ b/protogen/gen/ocis/services/search/v0/search.swagger.json @@ -310,6 +310,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/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/proxy/pkg/config/defaults/defaultconfig.go b/services/proxy/pkg/config/defaults/defaultconfig.go index e3c3c7a5c85..4162de08d66 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", @@ -208,6 +213,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 { @@ -253,8 +259,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/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) { 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/defaults/defaultconfig.go b/services/search/pkg/config/defaults/defaultconfig.go index 7bf814699aa..c7b4a1a14a1 100644 --- a/services/search/pkg/config/defaults/defaultconfig.go +++ b/services/search/pkg/config/defaults/defaultconfig.go @@ -53,6 +53,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 { @@ -90,6 +91,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/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 69246a89734..784b382f588 100644 --- a/services/search/pkg/search/events.go +++ b/services/search/pkg/search/events.go @@ -2,6 +2,7 @@ package search import ( "context" + gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" @@ -24,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{}, @@ -97,7 +98,7 @@ func (eh *eventHandler) trashItem(rid *provider.ResourceId) { func (eh *eventHandler) upsertItem(ref *provider.Reference, uid *user.UserId) { ctx, stat, path := eh.resInfo(uid, ref) - if ctx == nil || stat == nil || path == nil { + if ctx == nil || stat == nil || path == "" { return } @@ -114,7 +115,7 @@ func (eh *eventHandler) upsertItem(ref *provider.Reference, uid *user.UserId) { OpaqueId: stat.Info.Id.SpaceId, SpaceId: stat.Info.Id.SpaceId, }), - Path: utils.MakeRelativePath(path.Path), + Path: utils.MakeRelativePath(path), Type: uint64(stat.Info.Type), Document: doc, } @@ -128,7 +129,7 @@ func (eh *eventHandler) upsertItem(ref *provider.Reference, uid *user.UserId) { func (eh *eventHandler) restoreItem(ref *provider.Reference, uid *user.UserId) { ctx, stat, path := eh.resInfo(uid, ref) - if ctx == nil || stat == nil || path == nil { + if ctx == nil || stat == nil || path == "" { return } @@ -139,30 +140,30 @@ func (eh *eventHandler) restoreItem(ref *provider.Reference, uid *user.UserId) { func (eh *eventHandler) moveItem(ref *provider.Reference, uid *user.UserId) { ctx, stat, path := eh.resInfo(uid, ref) - if ctx == nil || stat == nil || path == nil { + if ctx == nil || stat == nil || path == "" { return } - if err := eh.engine.Move(storagespace.FormatResourceID(*stat.Info.Id), path.Path); err != nil { + if err := eh.engine.Move(storagespace.FormatResourceID(*stat.Info.Id), path); err != nil { eh.logger.Error().Err(err).Msg("failed to move the changed resource in the index") } } -func (eh *eventHandler) resInfo(uid *user.UserId, ref *provider.Reference) (context.Context, *provider.StatResponse, *provider.GetPathResponse) { +func (eh *eventHandler) resInfo(uid *user.UserId, ref *provider.Reference) (context.Context, *provider.StatResponse, string) { ownerCtx, err := getAuthContext(&user.User{Id: uid}, eh.gateway, eh.secret, eh.logger) if err != nil { - return nil, nil, nil + return nil, nil, "" } statRes, err := statResource(ownerCtx, ref, eh.gateway, eh.logger) if err != nil { - return nil, nil, nil + return nil, nil, "" } - pathRes, err := getPath(ownerCtx, statRes.Info.Id, eh.gateway, eh.logger) + r, err := ResolveReference(ownerCtx, ref, statRes.GetInfo(), eh.gateway) if err != nil { - return nil, nil, nil + return nil, nil, "" } - return ownerCtx, statRes, pathRes + return ownerCtx, statRes, r.GetPath() } diff --git a/services/search/pkg/search/provider.go b/services/search/pkg/search/provider.go index 889388d5fed..c2dd3d5b5b2 100644 --- a/services/search/pkg/search/provider.go +++ b/services/search/pkg/search/provider.go @@ -105,22 +105,30 @@ 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) { + continue + } + var ( mountpointRootID *searchmsg.ResourceID rootName string @@ -132,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") @@ -170,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, @@ -245,18 +253,22 @@ func (p *Provider) IndexSpace(ctx context.Context, req *searchsvc.IndexSpaceRequ // Walk the space and index all files w := walker.NewWalker(p.gateway) - rootId, err := storagespace.ParseID(req.SpaceId) + rootID, err := storagespace.ParseID(req.SpaceId) if err != nil { p.logger.Error().Err(err).Msg(err.Error()) return nil, err } - err = w.Walk(ownerCtx, &rootId, func(wd string, info *provider.ResourceInfo, err error) error { + err = w.Walk(ownerCtx, &rootID, func(wd string, info *provider.ResourceInfo, err error) error { if err != nil { p.logger.Error().Err(err).Msg("error walking the tree") } - ref := &provider.Reference{ + ref, err := ResolveReference(ownerCtx, &provider.Reference{ Path: utils.MakeRelativePath(filepath.Join(wd, info.Path)), - ResourceId: &rootId, + ResourceId: &rootID, + }, info, p.gateway) + if err != nil { + p.logger.Error().Err(err).Msg("error resolving reference") + return nil } doc, err := p.extractor.Extract(ctx, info) @@ -284,7 +296,6 @@ func (p *Provider) IndexSpace(ctx context.Context, req *searchsvc.IndexSpaceRequ return nil, err } - logDocCount(p.engine, p.logger) return &searchsvc.IndexSpaceResponse{}, nil } diff --git a/services/search/pkg/search/provider_test.go b/services/search/pkg/search/provider_test.go index fde7b12b3b3..68d235d9fe5 100644 --- a/services/search/pkg/search/provider_test.go +++ b/services/search/pkg/search/provider_test.go @@ -2,6 +2,7 @@ package search_test import ( "context" + gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" sprovider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" @@ -48,7 +49,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", } @@ -78,6 +79,12 @@ var _ = Describe("Searchprovider", func() { Status: status.NewOK(context.Background()), Info: ri, }, nil) + gw.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) }) @@ -98,7 +105,7 @@ var _ = Describe("Searchprovider", func() { indexClient.On("Upsert", mock.Anything, mock.Anything).Return(nil) res, err := p.IndexSpace(ctx, &searchsvc.IndexSpaceRequest{ - SpaceId: "storageid", + SpaceId: "storageid$spaceid!spaceid", UserId: "user", }) Expect(err).ToNot(HaveOccurred()) @@ -325,6 +332,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/search/search.go b/services/search/pkg/search/search.go index 40b8474cd9f..662a14ae7ce 100644 --- a/services/search/pkg/search/search.go +++ b/services/search/pkg/search/search.go @@ -3,18 +3,42 @@ package search import ( "context" "errors" + gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" ctxpkg "github.com/cs3org/reva/v2/pkg/ctx" "github.com/cs3org/reva/v2/pkg/errtypes" + "github.com/cs3org/reva/v2/pkg/utils" "github.com/owncloud/ocis/v2/ocis-pkg/log" searchmsg "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/search/v0" "github.com/owncloud/ocis/v2/services/search/pkg/engine" "google.golang.org/grpc/metadata" ) +// ResolveReference makes sure the path is relative to the space root +func ResolveReference(ctx context.Context, ref *provider.Reference, ri *provider.ResourceInfo, gw gateway.GatewayAPIClient) (*provider.Reference, error) { + if ref.GetResourceId().GetOpaqueId() == ref.GetResourceId().GetSpaceId() { + return ref, nil + } + + gpRes, err := gw.GetPath(ctx, &provider.GetPathRequest{ + ResourceId: ri.Id, + }) + if err != nil || gpRes.Status.Code != rpc.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 +} + type matchArray []*searchmsg.Match func (ma matchArray) Len() int { @@ -69,20 +93,3 @@ func statResource(ctx context.Context, ref *provider.Reference, gw gateway.Gatew return res, nil } - -func getPath(ctx context.Context, id *provider.ResourceId, gw gateway.GatewayAPIClient, logger log.Logger) (*provider.GetPathResponse, error) { - res, err := gw.GetPath(ctx, &provider.GetPathRequest{ResourceId: id}) - - if err != nil { - logger.Error().Err(err).Interface("id", id).Msg("failed to get path for moved resource") - return nil, err - } - if res.Status.Code != rpc.Code_CODE_OK { - err := errors.New("failed to get path for moved resource") - - logger.Error().Interface("status", res.Status).Interface("id", id).Msg(err.Error()) - return nil, err - } - - return res, nil -} diff --git a/services/search/pkg/service/grpc/v0/service.go b/services/search/pkg/service/grpc/v0/service.go index 0e7da6d4451..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) @@ -106,6 +108,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/web/pkg/config/defaults/defaultconfig.go b/services/web/pkg/config/defaults/defaultconfig.go index 491a5c7e4e4..7ae3a8c8568 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", "preview", "text-editor", "pdf-viewer", "external", "user-management", "activities"}, 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 { 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..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) @@ -590,18 +589,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) @@ -905,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) @@ -988,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) @@ -1017,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) @@ -1035,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. 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