Remove workaround for extracting namespace name from Name property of 4 request types
@@ -38,13 +38,6 @@ var (
errUnauthorized = serviceerror.NewPermissionDenied("Request unauthorized.")
)
-var namespaceAPIs = map[string]struct{}{
- "RegisterNamespace": {},
- "DescribeNamespace": {},
- "UpdateNamespace": {},
- "DeprecateNamespace": {},
-}
-
func (a *interceptor) Interceptor(
ctx context.Context,
req interface{},
@@ -64,13 +57,6 @@ func (a *interceptor) Interceptor(
apiName = apiName[index+1:]
}
- if namespace == "" && isNamespaceOp(apiName) {
- namespaceOp, ok := req.(requestWithName)
- if ok {
- namespace = namespaceOp.GetName()
- }
- }
-
scope := a.getMetricsScope(metrics.NumAuthorizationScopes, namespace)
sw := scope.StartTimer(metrics.ServiceAuthorizationLatency)
defer sw.Stop()
@@ -87,12 +73,6 @@ func (a *interceptor) Interceptor(
return handler(ctx, req)
}
-// checks if this is one of the four namespace operations
-func isNamespaceOp(api string) bool {
- _, ok := namespaceAPIs[api]
- return ok
-}
-
type interceptor struct {
authorizer Authorizer
metricsClient metrics.Client
