perf(dashboard): memoize Galaxy summary by cache sequence; document scope-provider identity invariant
This commit is contained in:
@@ -11,6 +11,13 @@ public sealed class GatewayBrowseScopeProvider(IGatewayRequestIdentityAccessor i
|
||||
/// <inheritdoc />
|
||||
public IReadOnlyList<string>? ResolveBrowseSubtrees(ServerCallContext context)
|
||||
{
|
||||
// Invariant: the caller identity is the ambient one pushed by
|
||||
// GatewayGrpcAuthorizationInterceptor earlier in this same call. That interceptor is
|
||||
// registered globally and therefore runs before the library's galaxy service, so
|
||||
// Current is populated for any authenticated galaxy RPC. If it is somehow absent we
|
||||
// return empty BrowseSubtrees, which the library treats as "no scoping" (full
|
||||
// hierarchy) — safe only because the global interceptor has already authenticated and
|
||||
// authorized the request first. Do not reorder the interceptor without revisiting this.
|
||||
ApiKeyConstraints constraints = identityAccessor.Current?.EffectiveConstraints ?? ApiKeyConstraints.Empty;
|
||||
return constraints.BrowseSubtrees;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user