@@ -28,10 +28,12 @@ import (
28
28
"context"
29
29
30
30
enumspb "go.temporal.io/api/enums/v1"
31
+ "go.temporal.io/api/operatorservice/v1"
31
32
"go.temporal.io/api/serviceerror"
32
33
"go.temporal.io/api/workflowservice/v1"
33
34
"google.golang.org/grpc"
34
35
36
+ "go.temporal.io/server/api/adminservice/v1"
35
37
"go.temporal.io/server/common"
36
38
"go.temporal.io/server/common/dynamicconfig"
37
39
"go.temporal.io/server/common/namespace"
@@ -178,6 +180,18 @@ func (ni *NamespaceValidatorInterceptor) extractNamespaceFromRequest(req interfa
178
180
return nil , errNamespaceNotSet
179
181
}
180
182
return nil , nil
183
+ case * adminservice.AddSearchAttributesRequest ,
184
+ * adminservice.RemoveSearchAttributesRequest ,
185
+ * adminservice.GetSearchAttributesRequest ,
186
+ * operatorservice.AddSearchAttributesRequest ,
187
+ * operatorservice.RemoveSearchAttributesRequest ,
188
+ * operatorservice.ListSearchAttributesRequest :
189
+ // Namespace is optional for search attributes operations.
190
+ // It's required when using SQL DB for visibility, but not when using Elasticsearch.
191
+ if ! namespaceName .IsEmpty () {
192
+ return ni .namespaceRegistry .GetNamespace (namespaceName )
193
+ }
194
+ return nil , nil
181
195
default :
182
196
// All other APIs.
183
197
if namespaceName .IsEmpty () {
0 commit comments