Option C Tools
Loading...
Searching...
No Matches
tests_linter.test_secret_match_word Namespace Reference

Functions

 test_substring_mode_flags_tokenizer_as_false_positive ()
 test_word_mode_does_not_flag_tokenizer ()
 test_word_mode_flags_snake_case_secret_segment ()
 test_word_mode_flags_camel_case_secret_segment ()
 test_word_mode_does_not_flag_pwdistance ()
 test_check_threads_mode_and_ignores_tokenizer_in_word_mode ()
 test_check_still_flags_real_secret_in_word_mode ()

Detailed Description

Purpose
-------
OI-529 regression coverage — :func:`_name_matches_secret` and the
``--secret-match {substring,word}`` CLI flag.

The legacy ``substring`` matcher flagged any name that happened to
contain a secret-shaped substring, so ordinary identifiers like
``tokenizer`` (contains ``token``) or ``pwdistance`` (contains ``pwd``)
tripped the scanner. The ``word`` mode splits on ``_``/``-``/camelCase
boundaries and only flags whole-segment hits, so ``user_password``
still flags but ``tokenizer`` does not.

Responsibilities
----------------
- ``substring`` mode flags ``compass``.
- ``word`` mode does not flag ``compass``.
- ``word`` mode still flags ``compass_password`` and ``apiKey``.
- ``check_no_hardcoded_secrets`` threads the mode through unchanged.

Diagnostics
-----------
Domain: LINT-TESTS
Levels:
    L2 — test lifecycle
    L3 — assertion details
    L4 — deep tracing

Contracts
---------
- Tests operate on in-memory strings and AST snippets; no files are
  written.

Function Documentation

◆ test_check_still_flags_real_secret_in_word_mode()

tests_linter.test_secret_match_word.test_check_still_flags_real_secret_in_word_mode ( )

Definition at line 94 of file test_secret_match_word.py.

◆ test_check_threads_mode_and_ignores_tokenizer_in_word_mode()

tests_linter.test_secret_match_word.test_check_threads_mode_and_ignores_tokenizer_in_word_mode ( )

Definition at line 84 of file test_secret_match_word.py.

◆ test_substring_mode_flags_tokenizer_as_false_positive()

tests_linter.test_secret_match_word.test_substring_mode_flags_tokenizer_as_false_positive ( )

Definition at line 52 of file test_secret_match_word.py.

◆ test_word_mode_does_not_flag_pwdistance()

tests_linter.test_secret_match_word.test_word_mode_does_not_flag_pwdistance ( )

Definition at line 73 of file test_secret_match_word.py.

◆ test_word_mode_does_not_flag_tokenizer()

tests_linter.test_secret_match_word.test_word_mode_does_not_flag_tokenizer ( )

Definition at line 57 of file test_secret_match_word.py.

◆ test_word_mode_flags_camel_case_secret_segment()

tests_linter.test_secret_match_word.test_word_mode_flags_camel_case_secret_segment ( )

Definition at line 68 of file test_secret_match_word.py.

◆ test_word_mode_flags_snake_case_secret_segment()

tests_linter.test_secret_match_word.test_word_mode_flags_snake_case_secret_segment ( )

Definition at line 63 of file test_secret_match_word.py.