Conversation
Introduce Runtime.AnalyzeResolver and require every resolver to register an analyzer alongside its initializer via RegisterResolver. Analysis takes user attributes for templating but no security claims, so it cannot re-enter security resolution. Resolvers that cannot infer security rules register AnalysisUnsupported.
…ecursion Report, alert and canvas reconcilers initialized the resolver with the caller's claims to read its refs and required security rules. Resolvers that resolve security at init (metrics, metrics_sql, api) re-expanded the same transitive access rule, recursing until the process died. Use Runtime.AnalyzeResolver instead, and drop InferRequiredSecurityRules from the Resolver interface.
k-anshul
commented
Sep 23, 2026
| Runtime: r.C.Runtime, | ||
| InstanceID: r.C.InstanceID, | ||
| Properties: resolverProperties(spec), | ||
| Claims: claims, |
Member
Author
There was a problem hiding this comment.
A smaller solution is to just pass claims with SkipSecurity set to true but that is a duct tape solution and prone to bugs in new reconcilers.
k-anshul
marked this pull request as ready for review
September 24, 2026 11:21
begelundmuller
approved these changes
Sep 28, 2026
| func RegisterResolverInitializer(name string, initializer ResolverInitializer) { | ||
| // RegisterResolver registers a resolver by name. | ||
| // Every resolver must provide an analyzer; use AnalysisUnsupported if it cannot infer security rules. | ||
| func RegisterResolver(name string, initializer ResolverInitializer, analyzer ResolverAnalyzer) { |
Contributor
There was a problem hiding this comment.
It's alright, but feels like the separate "analyzer" concept makes things quite a bit more confusing. Did you consider any solutions that work just with the normal Resolver interface? After all, initializing a resolver is already meant to be lightweight and to facilitate e.g. validation with Validate.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up for bug discovered in #9908
Checklist: