Repository: owncloud/ocis
Pull request #8418 (2024-02-09 08:38:49)

Bump mockery to 2.40.2
to address issues when building with go1.22 https://github.com/vektra/mockery/pull/753


Patch:
diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk
index 6096ca9e33e..43c81141502 100644
--- a/.bingo/Variables.mk
+++ b/.bingo/Variables.mk
@@ -65,11 +65,11 @@ $(HUGO): $(BINGO_DIR)/hugo.mod
 	@echo "(re)installing $(GOBIN)/hugo-v0.115.2"
 	@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=hugo.mod -o=$(GOBIN)/hugo-v0.115.2 "github.com/gohugoio/hugo"
 
-MOCKERY := $(GOBIN)/mockery-v2.40.1
+MOCKERY := $(GOBIN)/mockery-v2.40.2
 $(MOCKERY): $(BINGO_DIR)/mockery.mod
 	@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
-	@echo "(re)installing $(GOBIN)/mockery-v2.40.1"
-	@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=mockery.mod -o=$(GOBIN)/mockery-v2.40.1 "github.com/vektra/mockery/v2"
+	@echo "(re)installing $(GOBIN)/mockery-v2.40.2"
+	@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=mockery.mod -o=$(GOBIN)/mockery-v2.40.2 "github.com/vektra/mockery/v2"
 
 MUTAGEN := $(GOBIN)/mutagen-v0.13.1
 $(MUTAGEN): $(BINGO_DIR)/mutagen.mod
diff --git a/.bingo/mockery.mod b/.bingo/mockery.mod
index 9c2314f8e4e..6dd4aa4be73 100644
--- a/.bingo/mockery.mod
+++ b/.bingo/mockery.mod
@@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
 
 go 1.21.6
 
-require github.com/vektra/mockery/v2 v2.40.1
+require github.com/vektra/mockery/v2 v2.40.2
diff --git a/.bingo/mockery.sum b/.bingo/mockery.sum
index e06a7204a66..f9acfc35683 100644
--- a/.bingo/mockery.sum
+++ b/.bingo/mockery.sum
@@ -190,6 +190,8 @@ github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8
 github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
 github.com/vektra/mockery/v2 v2.40.1 h1:8D01rBqloDLDHKZGXkyUD9Yj5Z+oDXBqDZ+tRXYM/oA=
 github.com/vektra/mockery/v2 v2.40.1/go.mod h1:dPzGtjT0/Uu4hqpF6QNHwz+GLago7lq1bxdj9wHbGKo=
+github.com/vektra/mockery/v2 v2.40.2 h1:JKuQ74IXibMCGKG6F0yvH/s2sNs1CHy/nGBP0We5DJ8=
+github.com/vektra/mockery/v2 v2.40.2/go.mod h1:KYBZF/7sqOa86BaOZPYsoCZWEWLS90a5oBLg2pVudxY=
 github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -242,6 +244,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
 golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
+golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -395,6 +399,8 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f
 golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
 golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
 golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
+golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
+golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
diff --git a/.bingo/variables.env b/.bingo/variables.env
index a4673819ca4..7f7a6eedef4 100644
--- a/.bingo/variables.env
+++ b/.bingo/variables.env
@@ -24,7 +24,7 @@ GOVULNCHECK="${GOBIN}/govulncheck-v1.0.1"
 
 HUGO="${GOBIN}/hugo-v0.115.2"
 
-MOCKERY="${GOBIN}/mockery-v2.40.1"
+MOCKERY="${GOBIN}/mockery-v2.40.2"
 
 MUTAGEN="${GOBIN}/mutagen-v0.13.1"
 
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b4e81947be6..d5f22dc935c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -40,6 +40,7 @@ The following sections list the changes for unreleased.
 
 ## Summary
 
+* Bugfix - Fix search response: [#7815](https://github.com/owncloud/ocis/pull/7815)
 * Bugfix - The race conditions in tests: [#7847](https://github.com/owncloud/ocis/pull/7847)
 * Bugfix - Fix jwt config of policies service: [#7893](https://github.com/owncloud/ocis/pull/7893)
 * Bugfix - Fix Service Account Roles on external IDP: [#8074](https://github.com/owncloud/ocis/pull/8074)
@@ -65,6 +66,7 @@ The following sections list the changes for unreleased.
 * Bugfix - Signed url verification: [#8385](https://github.com/owncloud/ocis/pull/8385)
 * Bugfix - Fix an error when move: [#8396](https://github.com/owncloud/ocis/pull/8396)
 * Bugfix - Fix extended env parser: [#8409](https://github.com/owncloud/ocis/pull/8409)
+* Bugfix - Graph/drives/permission Expiration date update: [#8413](https://github.com/owncloud/ocis/pull/8413)
 * Enhancement - Support login page background configuration: [#7674](https://github.com/owncloud/ocis/issues/7674)
 * Enhancement - Disable the password policy: [#7985](https://github.com/owncloud/ocis/pull/7985)
 * Enhancement - Update antivirus service: [#8062](https://github.com/owncloud/ocis/pull/8062)
@@ -79,6 +81,13 @@ The following sections list the changes for unreleased.
 
 ## Details
 
+* Bugfix - Fix search response: [#7815](https://github.com/owncloud/ocis/pull/7815)
+
+   We fixed the search response code from 500 to 400 when the request is invalid
+
+   https://github.com/owncloud/ocis/issues/7812
+   https://github.com/owncloud/ocis/pull/7815
+
 * Bugfix - The race conditions in tests: [#7847](https://github.com/owncloud/ocis/pull/7847)
 
    We fixed the race conditions in tests.
@@ -270,6 +279,14 @@ The following sections list the changes for unreleased.
 
    https://github.com/owncloud/ocis/pull/8409
 
+* Bugfix - Graph/drives/permission Expiration date update: [#8413](https://github.com/owncloud/ocis/pull/8413)
+
+   We fixed a bug in the Update sharing permission the expiration dates can't be
+   removed from link permissions.
+
+   https://github.com/owncloud/ocis/issues/8405
+   https://github.com/owncloud/ocis/pull/8413
+
 * Enhancement - Support login page background configuration: [#7674](https://github.com/owncloud/ocis/issues/7674)
 
    Introduce a new environment variable `IDP_LOGIN_BACKGROUND_URL` that overrides
diff --git a/changelog/unreleased/fix-search-responce.md b/changelog/unreleased/fix-search-responce.md
new file mode 100644
index 00000000000..e7f308a153c
--- /dev/null
+++ b/changelog/unreleased/fix-search-responce.md
@@ -0,0 +1,6 @@
+Bugfix: Fix search response
+
+We fixed the search response code from 500 to 400 when the request is invalid
+
+https://github.com/owncloud/ocis/pull/7815
+https://github.com/owncloud/ocis/issues/7812
diff --git a/changelog/unreleased/sharing-ng-expirationdate.md b/changelog/unreleased/sharing-ng-expirationdate.md
new file mode 100644
index 00000000000..f917b3111cc
--- /dev/null
+++ b/changelog/unreleased/sharing-ng-expirationdate.md
@@ -0,0 +1,6 @@
+Bugfix: graph/drives/permission Expiration date update
+
+We fixed a bug in the Update sharing permission the expiration dates can't be removed from link permissions.
+
+https://github.com/owncloud/ocis/pull/8413
+https://github.com/owncloud/ocis/issues/8405
diff --git a/docs/helpers/extended_vars.yaml b/docs/helpers/extended_vars.yaml
index 544206b9a7e..28091b1a8fa 100644
--- a/docs/helpers/extended_vars.yaml
+++ b/docs/helpers/extended_vars.yaml
@@ -32,39 +32,47 @@ variables:
   default_value: ""
   description: ""
   do_ignore: true
-- rawname: registryEnv
-  path: ocis-pkg/registry/registry.go:118
-  foundincode: false
+- rawname: _registryEnv
+  path: ocis-pkg/registry/registry.go:114
+  foundincode: true
   name: MICRO_REGISTRY
   type: string
-  default_value: ""
+  default_value: nats-js-kv
   description: 'The Go micro registry type to use. Supported types are: ''memory'',
     ''nats-js-kv'' (default) and ''kubernetes''. Note that ''nats'', ''etcd'', ''consul''
     and ''mdns'' are deprecated and will be removed in a later version. Only change
     on supervision of ownCloud Support.'
   do_ignore: false
-- rawname: registryAddressEnv
-  path: ocis-pkg/registry/registry.go:122
-  foundincode: false
+- rawname: _registryAddressEnv
+  path: ocis-pkg/natsjsregistry/registry.go:145
+  foundincode: true
   name: MICRO_REGISTRY_ADDRESS
   type: string
   default_value: 127.0.0.1:9233
   description: The bind address of the internal go micro framework. Only change on
     supervision of ownCloud Support.
   do_ignore: false
-- rawname: registryPasswordEnv
-  path: ocis-pkg/registry/registry.go:115
-  foundincode: false
-  name: MICRO_REGISTRY_AUTH_PASSWORD
+- rawname: _registryAddressEnv
+  path: ocis-pkg/registry/registry.go:118
+  foundincode: true
+  name: MICRO_REGISTRY_ADDRESS
   type: ""
   default_value: ""
+  description: ""
+  do_ignore: true
+- rawname: _registryPasswordEnv
+  path: ocis-pkg/natsjsregistry/registry.go:163
+  foundincode: true
+  name: MICRO_REGISTRY_AUTH_PASSWORD
+  type: string
+  default_value: ""
   description: Optional when using nats to authenticate with the nats cluster.
   do_ignore: false
-- rawname: registryUsernameEnv
-  path: ocis-pkg/registry/registry.go:114
-  foundincode: false
+- rawname: _registryUsernameEnv
+  path: ocis-pkg/natsjsregistry/registry.go:163
+  foundincode: true
   name: MICRO_REGISTRY_AUTH_USERNAME
-  type: ""
+  type: string
   default_value: ""
   description: Optional when using nats to authenticate with the nats cluster.
   do_ignore: false
@@ -73,61 +81,20 @@ variables:
   foundincode: true
   name: OCIS_BASE_DATA_PATH
   type: string
-  default_value: '''/var/lib/ocis'' or ''$HOME/.ocis/'''
+  default_value: ""
   description: The base directory location used by several services and for user data.
-    Predefined to '/var/lib/ocis' for container images (inside the container) or '$HOME/.ocis/'
-    for binary releases. Services can have, if available, an individual setting with
-    an own environment variable.
+    See the General Info section in the documentation for more details on defaults.
+    Services can have, if available, an individual setting with an own environment
+    variable.
   do_ignore: false
 - rawname: OCIS_CONFIG_DIR
   path: ocis-pkg/config/defaults/paths.go:56
   foundincode: true
   name: OCIS_CONFIG_DIR
   type: string
-  default_value: '''/etc/ocis'' or ''$HOME/.ocis/config'''
-  description: The default directory location for config files. Predefined to '/etc/ocis'
-    for container images (inside the container) or '$HOME/.ocis/config' for binary
-    releases.
-  do_ignore: false
-- rawname: _registryAddressEnv
-  path: ocis-pkg/natsjsregistry/registry.go:145
-  foundincode: true
-  name: _registryAddressEnv
-  type: ""
-  default_value: ""
-  description: ""
-  do_ignore: false
-- rawname: _registryAddressEnv
-  path: ocis-pkg/registry/registry.go:118
-  foundincode: true
-  name: _registryAddressEnv
-  type: ""
-  default_value: ""
-  description: ""
-  do_ignore: false
-- rawname: _registryEnv
-  path: ocis-pkg/registry/registry.go:114
-  foundincode: true
-  name: _registryEnv
-  type: ""
   default_value: ""
-  description: ""
-  do_ignore: false
-- rawname: _registryPasswordEnv
-  path: ocis-pkg/natsjsregistry/registry.go:163
-  foundincode: true
-  name: _registryPasswordEnv
-  type: ""
-  default_value: ""
-  description: ""
-  do_ignore: false
-- rawname: _registryUsernameEnv
-  path: ocis-pkg/natsjsregistry/registry.go:163
-  foundincode: true
-  name: _registryUsernameEnv
-  type: ""
-  default_value: ""
-  description: ""
+  description: The default directory location for config files. See the General Info
+    section in the documentation for more details on defaults.
   do_ignore: false
 - rawname: parts[0]
   path: ocis-pkg/config/envdecode/envdecode.go:382
diff --git a/docs/services/general-info/env-var-deltas/4.0.0-5.0.0-added.adoc b/docs/services/general-info/env-var-deltas/4.0.0-5.0.0-added.adoc
index 6edb3679c80..061e54b1c53 100644
--- a/docs/services/general-info/env-var-deltas/4.0.0-5.0.0-added.adoc
+++ b/docs/services/general-info/env-var-deltas/4.0.0-5.0.0-added.adoc
@@ -8,9 +8,18 @@
 |===
 | Service| Variable| Description| Default
 
-| Available in multiple services
+| xref:deployment/services/env-vars-special-scope.adoc[Special Scope Envvars]
 | `OCIS_CACHE_DISABLE_PERSISTENCE`
 | Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured.| `false`
+|
+| `MICRO_REGISTRY` (important change)
+| The Go micro registry type to use. Supported types are: 'memory', 'nats-js-kv' (default) and 'kubernetes'. Note that 'nats', 'etcd', 'consul' and 'mdns' are deprecated and will be removed in a later version. Only change on supervision of ownCloud Support.| nats-js-kv
+|
+| `MICRO_REGISTRY_AUTH_PASSWORD`
+| Optional when using nats to authenticate with the nats cluster.|
+|
+| `MICRO_REGISTRY_AUTH_USERNAME`
+| Optional when using nats to authenticate with the nats cluster.|
 
 | xref:{s-path}/antivirus.adoc[antivirus]
 | `OCIS_EVENTS_AUTH_USERNAME`
diff --git a/docs/services/general-info/env-var-deltas/4.0.0-5.0.0-added.md b/docs/services/general-info/env-var-deltas/4.0.0-5.0.0-added.md
index 004a659e158..a58a4ef27a4 100644
--- a/docs/services/general-info/env-var-deltas/4.0.0-5.0.0-added.md
+++ b/docs/services/general-info/env-var-deltas/4.0.0-5.0.0-added.md
@@ -3,9 +3,12 @@
 | File                                          | Variable                                                                                                                                                                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Default                               |
 |-----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------|
 | ocis-pkg/shared/shared_types.go               | `OCIS_CACHE_DISABLE_PERSISTENCE`                                                                                                                                                                   | Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured.                                                                                                                                                                                                                                                                                                                                                                                 | `false`                               |
+| ocis-pkg/registry/registry.go                 | `MICRO_REGISTRY` (important change)                                                                                                                                                                | The Go micro registry type to use. Supported types are: 'memory', 'nats-js-kv' (default) and 'kubernetes'. Note that 'nats', 'etcd', 'consul' and 'mdns' are deprecated and will be removed in a later version. Only change on supervision of ownCloud Support.                                                                                                                                                                                                                                                                                                                                                                                    | `nats-js-kv`                          |
+| ocis-pkg/natsjsregistry/registry.go           | `MICRO_REGISTRY_AUTH_USERNAME`                                                                                                                                                                     | Optional when using nats to authenticate with the nats cluster.                                                                                                                                                                                                                                                                                                                         |                                       |
+|                                               | `MICRO_REGISTRY_AUTH_PASSWORD`                                                                                                                                                                     | Optional when using nats to authenticate with the nats cluster.                                                                                                                                                                                                                                                                                                                         |                                       |
 | services/antivirus/pkg/config/config.go       | `OCIS_EVENTS_AUTH_USERNAME`                                                                                                                                                                        | The username to authenticate with the events broker. The events broker is the ocis service which receives and delivers events between the services.                                                                                                                                                                                                                                                                                                                         |                                       |
 |                                               | `OCIS_EVENTS_AUTH_PASSWORD`                                                                                                                                                                        | The password to authenticate with the events broker. The events broker is the ocis service which receives and delivers events between the services.                                                                                                                                                                                                                                                                                                                         |                                       |
-|                                               | `ANTIVIRUS_ICAP_TIMEOUT`                                                                                                                                                                        | Scan timeout for the ICAP client. Defaults to '5m' (5 minutes). See the Environment Variable Types description for more details.                                                                                                                                                                                                                                                                                                                         |                                       |
+|                                               | `ANTIVIRUS_ICAP_TIMEOUT`                                                                                                                                                                           | Scan timeout for the ICAP client. Defaults to '5m' (5 minutes). See the Environment Variable Types description for more details.                                                                                                                                                                                                                                                                                                                         |                                       |
 | services/audit/pkg/config/config.go           | `OCIS_EVENTS_AUTH_USERNAME`                                                                                                                                                                        | The username to authenticate with the events broker. The events broker is the ocis service which receives and delivers events between the services.                                                                                                                                                                                                                                                                                                                         |                                       |
 |                                               | `OCIS_EVENTS_AUTH_PASSWORD`                                                                                                                                                                        | The password to authenticate with the events broker. The events broker is the ocis service which receives and delivers events between the services.                                                                                                                                                                                                                                                                                                                         |                                       |
 | services/auth-service/pkg/config/config.go    | `OCIS_TRACING_ENABLED;AUTH_SERVICE_TRACING_ENABLED`                                                                                                                                                | Activates tracing.                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                       |
diff --git a/ocis-pkg/oidc/mocks/oidc_client.go b/ocis-pkg/oidc/mocks/oidc_client.go
index 5a822397341..0aa0dfdfee0 100644
--- a/ocis-pkg/oidc/mocks/oidc_client.go
+++ b/ocis-pkg/oidc/mocks/oidc_client.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/graph/mocks/http_client.go b/services/graph/mocks/http_client.go
index 6baaf331917..b31a16b269a 100644
--- a/services/graph/mocks/http_client.go
+++ b/services/graph/mocks/http_client.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/graph/mocks/permissions.go b/services/graph/mocks/permissions.go
index 73bf9421d57..a0645ce951a 100644
--- a/services/graph/mocks/permissions.go
+++ b/services/graph/mocks/permissions.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/graph/mocks/publisher.go b/services/graph/mocks/publisher.go
index 189ebe218ec..7449caf0f6d 100644
--- a/services/graph/mocks/publisher.go
+++ b/services/graph/mocks/publisher.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/graph/mocks/role_service.go b/services/graph/mocks/role_service.go
index 70fadd24ed7..4538a943030 100644
--- a/services/graph/mocks/role_service.go
+++ b/services/graph/mocks/role_service.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/graph/pkg/identity/mocks/backend.go b/services/graph/pkg/identity/mocks/backend.go
index 885ee880abd..4a6153290f4 100644
--- a/services/graph/pkg/identity/mocks/backend.go
+++ b/services/graph/pkg/identity/mocks/backend.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/graph/pkg/identity/mocks/education_backend.go b/services/graph/pkg/identity/mocks/education_backend.go
index 44e831c58eb..8799d04adfe 100644
--- a/services/graph/pkg/identity/mocks/education_backend.go
+++ b/services/graph/pkg/identity/mocks/education_backend.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/graph/pkg/identity/mocks/ldapclient.go b/services/graph/pkg/identity/mocks/ldapclient.go
index f9f1e15b6f6..c4dba72e1ed 100644
--- a/services/graph/pkg/identity/mocks/ldapclient.go
+++ b/services/graph/pkg/identity/mocks/ldapclient.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/graph/pkg/service/v0/links.go b/services/graph/pkg/service/v0/links.go
index f9303fa5c77..684dd8e67be 100644
--- a/services/graph/pkg/service/v0/links.go
+++ b/services/graph/pkg/service/v0/links.go
@@ -202,7 +202,7 @@ func (g Graph) libreGraphPermissionFromCS3PublicShare(createdLink *link.PublicSh
 }
 
 func parseAndFillUpTime(t *time.Time) *types.Timestamp {
-	if t == nil {
+	if t == nil || t.IsZero() {
 		return nil
 	}
 
diff --git a/services/invitations/pkg/backends/keycloak/mocks/client.go b/services/invitations/pkg/backends/keycloak/mocks/client.go
index be451669b32..c6bdfbc7ccd 100644
--- a/services/invitations/pkg/backends/keycloak/mocks/client.go
+++ b/services/invitations/pkg/backends/keycloak/mocks/client.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/proxy/pkg/user/backend/mocks/user_backend.go b/services/proxy/pkg/user/backend/mocks/user_backend.go
index c625438af96..2d57b340168 100644
--- a/services/proxy/pkg/user/backend/mocks/user_backend.go
+++ b/services/proxy/pkg/user/backend/mocks/user_backend.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/proxy/pkg/userroles/mocks/user_role_assigner.go b/services/proxy/pkg/userroles/mocks/user_role_assigner.go
index 3a601b6aa34..babeb5491e3 100644
--- a/services/proxy/pkg/userroles/mocks/user_role_assigner.go
+++ b/services/proxy/pkg/userroles/mocks/user_role_assigner.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/search/pkg/content/mocks/extractor.go b/services/search/pkg/content/mocks/extractor.go
index 80a795af36d..273d96b0140 100644
--- a/services/search/pkg/content/mocks/extractor.go
+++ b/services/search/pkg/content/mocks/extractor.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/search/pkg/content/mocks/retriever.go b/services/search/pkg/content/mocks/retriever.go
index 76271c2205c..c755da70e14 100644
--- a/services/search/pkg/content/mocks/retriever.go
+++ b/services/search/pkg/content/mocks/retriever.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/search/pkg/engine/bleve.go b/services/search/pkg/engine/bleve.go
index a0b3f26f30c..54375d99250 100644
--- a/services/search/pkg/engine/bleve.go
+++ b/services/search/pkg/engine/bleve.go
@@ -22,6 +22,7 @@ import (
 	storageProvider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
 	"google.golang.org/protobuf/types/known/timestamppb"
 
+	"github.com/cs3org/reva/v2/pkg/errtypes"
 	"github.com/cs3org/reva/v2/pkg/storagespace"
 	"github.com/cs3org/reva/v2/pkg/utils"
 
@@ -123,6 +124,9 @@ func BuildBleveMapping() (mapping.IndexMapping, error) {
 func (b *Bleve) Search(ctx context.Context, sir *searchService.SearchIndexRequest) (*searchService.SearchIndexResponse, error) {
 	createdQuery, err := b.queryCreator.Create(sir.Query)
 	if err != nil {
+		if searchQuery.IsValidationError(err) {
+			return nil, errtypes.BadRequest(err.Error())
+		}
 		return nil, err
 	}
 
diff --git a/services/search/pkg/engine/mocks/engine.go b/services/search/pkg/engine/mocks/engine.go
index aca2f730f50..d1c356d0c7a 100644
--- a/services/search/pkg/engine/mocks/engine.go
+++ b/services/search/pkg/engine/mocks/engine.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/search/pkg/query/kql/error.go b/services/search/pkg/query/error.go
similarity index 82%
rename from services/search/pkg/query/kql/error.go
rename to services/search/pkg/query/error.go
index 5f171d77fdb..89f504c8a45 100644
--- a/services/search/pkg/query/kql/error.go
+++ b/services/search/pkg/query/error.go
@@ -1,4 +1,4 @@
-package kql
+package query
 
 import (
 	"fmt"
@@ -37,3 +37,11 @@ type UnsupportedTimeRangeError struct {
 func (e UnsupportedTimeRangeError) Error() string {
 	return fmt.Sprintf("unable to convert '%v' to a time range", e.Value)
 }
+
+func IsValidationError(err error) bool {
+	switch err.(type) {
+	case *StartsWithBinaryOperatorError, *NamedGroupInvalidNodesError, *UnsupportedTimeRangeError:
+		return true
+	}
+	return false
+}
diff --git a/services/search/pkg/query/kql/cast.go b/services/search/pkg/query/kql/cast.go
index 06fb800ce5a..c6ca30541ac 100644
--- a/services/search/pkg/query/kql/cast.go
+++ b/services/search/pkg/query/kql/cast.go
@@ -5,6 +5,7 @@ import (
 	"time"
 
 	"github.com/jinzhu/now"
+	"github.com/owncloud/ocis/v2/services/search/pkg/query"
 
 	"github.com/owncloud/ocis/v2/services/search/pkg/query/ast"
 )
@@ -84,7 +85,7 @@ func toTimeRange(in interface{}) (*time.Time, *time.Time, error) {
 
 	value, err := toString(in)
 	if err != nil {
-		return &from, &to, UnsupportedTimeRangeError{}
+		return &from, &to, &query.UnsupportedTimeRangeError{}
 	}
 
 	c := &now.Config{
@@ -131,7 +132,7 @@ func toTimeRange(in interface{}) (*time.Time, *time.Time, error) {
 	}
 
 	if from.IsZero() || to.IsZero() {
-		return nil, nil, UnsupportedTimeRangeError{}
+		return nil, nil, &query.UnsupportedTimeRangeError{}
 	}
 
 	return &from, &to, nil
diff --git a/services/search/pkg/query/kql/validate.go b/services/search/pkg/query/kql/validate.go
index 9e9a2428b99..96c6761ab17 100644
--- a/services/search/pkg/query/kql/validate.go
+++ b/services/search/pkg/query/kql/validate.go
@@ -1,6 +1,7 @@
 package kql
 
 import (
+	"github.com/owncloud/ocis/v2/services/search/pkg/query"
 	"github.com/owncloud/ocis/v2/services/search/pkg/query/ast"
 )
 
@@ -9,10 +10,9 @@ func validateAst(a *ast.Ast) error {
 	case *ast.OperatorNode:
 		switch node.Value {
 		case BoolAND, BoolOR:
-			return StartsWithBinaryOperatorError{Node: node}
+			return &query.StartsWithBinaryOperatorError{Node: node}
 		}
 	}
-
 	return nil
 }
 
@@ -21,14 +21,14 @@ func validateGroupNode(n *ast.GroupNode) error {
 	case *ast.OperatorNode:
 		switch node.Value {
 		case BoolAND, BoolOR:
-			return StartsWithBinaryOperatorError{Node: node}
+			return &query.StartsWithBinaryOperatorError{Node: node}
 		}
 	}
 
 	if n.Key != "" {
 		for _, node := range n.Nodes {
 			if ast.NodeKey(node) != "" {
-				return NamedGroupInvalidNodesError{Node: node}
+				return &query.NamedGroupInvalidNodesError{Node: node}
 			}
 		}
 	}
diff --git a/services/search/pkg/search/mocks/searcher.go b/services/search/pkg/search/mocks/searcher.go
index 8900f1dc244..cb0b0b529f5 100644
--- a/services/search/pkg/search/mocks/searcher.go
+++ b/services/search/pkg/search/mocks/searcher.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 
diff --git a/services/settings/pkg/settings/mocks/manager.go b/services/settings/pkg/settings/mocks/manager.go
index 687d1688850..b4d6b43c638 100644
--- a/services/settings/pkg/settings/mocks/manager.go
+++ b/services/settings/pkg/settings/mocks/manager.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.1. DO NOT EDIT.
+// Code generated by mockery v2.40.2. DO NOT EDIT.
 
 package mocks
 


Test patch:
diff --git a/services/search/pkg/query/kql/dictionary_test.go b/services/search/pkg/query/kql/dictionary_test.go
index ba2780db895..adf4bd2d45e 100644
--- a/services/search/pkg/query/kql/dictionary_test.go
+++ b/services/search/pkg/query/kql/dictionary_test.go
@@ -6,6 +6,7 @@ import (
 	"time"
 
 	"github.com/jinzhu/now"
+	"github.com/owncloud/ocis/v2/services/search/pkg/query"
 	tAssert "github.com/stretchr/testify/assert"
 
 	"github.com/owncloud/ocis/v2/services/search/pkg/query/ast"
@@ -34,13 +35,13 @@ func TestParse_Spec(t *testing.T) {
 		},
 		{
 			name: `AND`,
-			error: kql.StartsWithBinaryOperatorError{
+			error: query.StartsWithBinaryOperatorError{
 				Node: &ast.OperatorNode{Value: kql.BoolAND},
 			},
 		},
 		{
 			name: `AND cat AND dog`,
-			error: kql.StartsWithBinaryOperatorError{
+			error: query.StartsWithBinaryOperatorError{
 				Node: &ast.OperatorNode{Value: kql.BoolAND},
 			},
 		},
@@ -80,13 +81,13 @@ func TestParse_Spec(t *testing.T) {
 		},
 		{
 			name: `OR`,
-			error: kql.StartsWithBinaryOperatorError{
+			error: query.StartsWithBinaryOperatorError{
 				Node: &ast.OperatorNode{Value: kql.BoolOR},
 			},
 		},
 		{
 			name: `OR cat AND dog`,
-			error: kql.StartsWithBinaryOperatorError{
+			error: query.StartsWithBinaryOperatorError{
 				Node: &ast.OperatorNode{Value: kql.BoolOR},
 			},
 		},
@@ -862,37 +863,37 @@ func TestParse_Errors(t *testing.T) {
 	tests := []testCase{
 		{
 			query: "animal:(mammal:cat mammal:dog reptile:turtle)",
-			error: kql.NamedGroupInvalidNodesError{
+			error: query.NamedGroupInvalidNodesError{
 				Node: &ast.StringNode{Key: "mammal", Value: "cat"},
 			},
 		},
 		{
 			query: "animal:(cat mammal:dog turtle)",
-			error: kql.NamedGroupInvalidNodesError{
+			error: query.NamedGroupInvalidNodesError{
 				Node: &ast.StringNode{Key: "mammal", Value: "dog"},
 			},
 		},
 		{
 			query: "animal:(AND cat)",
-			error: kql.StartsWithBinaryOperatorError{
+			error: query.StartsWithBinaryOperatorError{
 				Node: &ast.OperatorNode{Value: kql.BoolAND},
 			},
 		},
 		{
 			query: "animal:(OR cat)",
-			error: kql.StartsWithBinaryOperatorError{
+			error: query.StartsWithBinaryOperatorError{
 				Node: &ast.OperatorNode{Value: kql.BoolOR},
 			},
 		},
 		{
 			query: "(AND cat)",
-			error: kql.StartsWithBinaryOperatorError{
+			error: query.StartsWithBinaryOperatorError{
 				Node: &ast.OperatorNode{Value: kql.BoolAND},
 			},
 		},
 		{
 			query: "(OR cat)",
-			error: kql.StartsWithBinaryOperatorError{
+			error: query.StartsWithBinaryOperatorError{
 				Node: &ast.OperatorNode{Value: kql.BoolOR},
 			},
 		},
diff --git a/services/search/pkg/query/kql/kql_test.go b/services/search/pkg/query/kql/kql_test.go
index de050a47413..c130f755820 100644
--- a/services/search/pkg/query/kql/kql_test.go
+++ b/services/search/pkg/query/kql/kql_test.go
@@ -3,6 +3,7 @@ package kql_test
 import (
 	"testing"
 
+	"github.com/owncloud/ocis/v2/services/search/pkg/query"
 	tAssert "github.com/stretchr/testify/assert"
 
 	"github.com/owncloud/ocis/v2/services/search/pkg/query/ast"
@@ -22,7 +23,7 @@ func TestNewAST(t *testing.T) {
 		{
 			name:       "error",
 			givenQuery: kql.BoolAND,
-			expectedError: kql.StartsWithBinaryOperatorError{
+			expectedError: query.StartsWithBinaryOperatorError{
 				Node: &ast.OperatorNode{Value: kql.BoolAND},
 			},
 		},