Skip to content

Commit

Permalink
[Test] Add test case for issue #857
Browse files Browse the repository at this point in the history
  • Loading branch information
tsigouris007 committed Nov 7, 2024
1 parent ec75572 commit c4210a1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/filters/heuristic_filter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ def test_is_prefixed_with_dollar_sign(secret, result):
('secret = get_secret_key()', True),
('secret = request.headers["apikey"]', True),
('secret = hunter2', False),
("<%= ENV['CLIENT_ACCESS_KEY_ID'].presence || 'AKIA123456789ABCDEF1' %>", True), # Erb template with intermediate method
("<%= ENV['CLIENT_ACCESS_KEY_ID'] || 'AKIA123456789ABCDEF1' %>", True), # Erb template without intermediate method
("ENV['CLIENT_ACCESS_KEY_ID'].presence || 'AKIA123456789ABCDEF1'", True), # Ruby with intermediate method
("ENV['CLIENT_ACCESS_KEY_ID'] || 'AKIA123456789ABCDEF1'", True), # Ruby without intermediate method
('not_a_secret ||= something_else', False), # Ruby assignment
('not_a_secret || something_else', False), # Ruby truthy validation
('api_key = ENV["API_KEY"].get() || "default_key"', True), # Ruby with intermediate method with assignment
('token = ENV["TOKEN"] || default_token', True), # Ruby without intermediate method with assignment
('api_key ||= fetch_api_key()', True), # Ruby without intermediate method with assignment
),
)
def test_is_indirect_reference(line, result):
Expand Down

0 comments on commit c4210a1

Please sign in to comment.