Skip to content

fix(rules): stop flagging Token::default() and show only reportable findings in review_prepare - #703

Merged
ajianaz merged 1 commit into
developfrom
fix/697-secret-type-name-and-prepare-ignore
Oct 27, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/697-secret-type-name-and-prepare-ignore

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

What

  • crypto/hardcoded-secret: the value after a single : can no longer start with another :, so CancelToken::default(), Token::from_parts(..) and ApiKey::generate_random() (paths) are not read as token: <value>. Real cases (password = "...", token: "...", JSON api_key) are still flagged.
  • cora.review_prepare runs the same post-processing as review_finalize on deterministic_findings (ignore.rules, inline cora-ignore markers, context filter), without the findings cap (the note still explains it), so the agent no longer sees and fixes a finding that finalize would drop.

Why

A project had to silence the rule by title, which hid real secrets too, and an agent changed code to avoid a finding the repository already ignored (#697).

Testing

  • Regression test for type paths versus real secrets in the scanner.
  • Test that an ignored finding is not listed by prepare.
  • fmt, clippy -D warnings and the full suite pass.

Closes #697.

…indings in review_prepare (#697)

Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
@ajianaz
ajianaz force-pushed the fix/697-secret-type-name-and-prepare-ignore branch from cc46f2f to 9008faa Compare October 27, 2026 07:23
@ajianaz
ajianaz merged commit 8a8066b into develop Oct 27, 2026
13 checks passed
ajianaz added a commit that referenced this pull request Oct 27, 2026
…indings in review_prepare (#703)

## What

- `crypto/hardcoded-secret`: the value after a single `:` can no longer
start with another `:`, so `CancelToken::default()`,
`Token::from_parts(..)` and `ApiKey::generate_random()` (paths) are not
read as `token: <value>`. Real cases (`password = "..."`, `token:
"..."`, JSON `api_key`) are still flagged.
- `cora.review_prepare` runs the same post-processing as
`review_finalize` on `deterministic_findings` (`ignore.rules`, inline
`cora-ignore` markers, context filter), without the findings cap (the
note still explains it), so the agent no longer sees and fixes a finding
that finalize would drop.

## Why

A project had to silence the rule by title, which hid real secrets too,
and an agent changed code to avoid a finding the repository already
ignored (#697).

## Testing

- Regression test for type paths versus real secrets in the scanner.
- Test that an ignored finding is not listed by prepare.
- fmt, clippy -D warnings and the full suite pass.

Closes #697.

Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
Co-authored-by: ajianaz <ajianaz@users.noreply.github.com>
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.

crypto/hardcoded-secret flags CancelToken::default(), and review_prepare lists findings that review_finalize will ignore

1 participant