Repository navigation
feat(analyzers): add E128228 token validation flag rule - #180
Merged
Merged
Conversation
Flag a TokenValidationParameters validation flag set to a literal false. Report the five true-default flags and give ValidateIssuerSigningKey its own message because it defaults to false. Add tests, README coverage, and the 3.2.0 release entry.
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.
Executive Summary
Add E128228 to flag a
TokenValidationParametersvalidation flag set to a literalfalse. Five flags default totrue, so a literalfalsesilently disables the check.ValidateIssuerSigningKeydefaults tofalse, so the rule reports it with a distinct message instead of claiming a disable that was already off.The corpus holds zero consumer sites. The rule ships as prevention by maintainer decision, recorded in the candidate register.
Code Changes
src/E128.Analyzers/Security/TokenValidationFlagFalseAnalyzer.cs: new E128228 analyzer. Resolves the property symbol and the containing type throughMetadataTypes.RegisterForType, reports only a literalfalse, and covers object initializers and post-construction assignment.tests/E128.Analyzers.Tests/TokenValidationFlagFalseAnalyzerTests.cs: 15 tests for the six flags, both assignment forms, the derived type, and the silent cases.Tests and Tooling
scripts/check.sh --all: shell lint, release validation, format, build, and the full test suite pass.scripts/readme-table-diff.sh --analyzer: no drift.scripts/internal/analyzer-release-check.sh: clean.scripts/internal/precommit.sh: clean.Review Guide
Start with the analyzer, then the six-flag theory and the signing-key message test. The two descriptors share E128228, so the tests use an explicit
DiagnosticResultwith a keyed location.Rollback
Revert the commit. The rule is additive and carries no code fix.