Skip to content

feat(analyzers): add E128228 token validation flag rule - #180

Merged
e128 merged 1 commit into
mainfrom
feat/analyzer-e128228-token-validation-flag
Nov 17, 2026
Merged

e128 merged 1 commit into
mainfrom
feat/analyzer-e128228-token-validation-flag

Conversation

@e128

@e128 e128 commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Executive Summary

Add E128228 to flag a TokenValidationParameters validation flag set to a literal false. Five flags default to true, so a literal false silently disables the check. ValidateIssuerSigningKey defaults to false, 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 through MetadataTypes.RegisterForType, reports only a literal false, 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.
  • README row and section, release promotion under 3.2.0, and the lode register and rule-detail updates.
  • Version bump 3.1.5 to 3.2.0.

Tests and Tooling

  • scripts/check.sh --all: shell lint, release validation, format, build, and the full test suite pass.
  • New test class: 15 passed, 0 failed.
  • 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 DiagnosticResult with a keyed location.

Rollback

Revert the commit. The rule is additive and carries no code fix.

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.
@e128
e128 merged commit 0051f01 into main Nov 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant