Conversation
896a864 to
6afb703
Compare
…rule The [Log] source generator had two resolution holes that silently let parameter values through even when the user asked for them to be redacted: 1. LogClassDataProvider.ExtractClassData only returned defaults if the class had a method-level [Log] attribute, so global settings like ILogConfigurator.Defaults(d => d.LogParameters = false) were dropped whenever [Log] was applied via b.Apply<LogAttribute>(...) or a class-level [Log]. The emitter then fell back to the hardcoded `true`. 2. ParseInterfaceProxy built the method model from openMethod.Parameters, so [NoLog] / [Sensitive] / [return: NoLog] declared on the concrete impl were invisible to the synthesized interface proxy. Calls made through the interface reference logged data the impl had redacted. Fixes: - LogClassDataProvider now also detects class-level [Log] and any method matched by an Apply<LogAttribute> rule in IAopConfigurator. - BuildMethodModel, CollectAspects and CollectVirtualAspect accept an optional attributeOverlay method; ParseInterfaceProxy passes the resolved impl so its parameter and return-type attributes are unioned with the interface's own. - Documented resolution order (method > class > Apply-config > global Defaults > hardcoded) in a CollectAspects doc comment. Tests cover Apply(selector, configure) with LogParameters=false, and [NoLog] on both the interface and impl parameter when dispatched through the interface. Co-Authored-By: Claude <noreply@anthropic.com>
6afb703 to
ca3e202
Compare
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.
The [Log] source generator had two resolution holes that silently let
parameter values through even when the user asked for them to be redacted:
LogClassDataProvider.ExtractClassData only returned defaults if the
class had a method-level [Log] attribute, so global settings like
ILogConfigurator.Defaults(d => d.LogParameters = false) were dropped
whenever [Log] was applied via b.Apply(...) or a
class-level [Log]. The emitter then fell back to the hardcoded
true.ParseInterfaceProxy built the method model from openMethod.Parameters,
so [NoLog] / [Sensitive] / [return: NoLog] declared on the concrete
impl were invisible to the synthesized interface proxy. Calls made
through the interface reference logged data the impl had redacted.
Fixes:
matched by an Apply rule in IAopConfigurator.
optional attributeOverlay method; ParseInterfaceProxy passes the
resolved impl so its parameter and return-type attributes are unioned
with the interface's own.
Defaults > hardcoded) in a CollectAspects doc comment.
Tests cover Apply(selector, configure) with LogParameters=false, and
[NoLog] on both the interface and impl parameter when dispatched through
the interface.
https://claude.ai/code/session_01AgEzrm85raXE4PpBueGsbM