Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Reduce sequential string false positives#64

Merged
KevinHock merged 2 commits into
masterfrom
62_reduce_sequential_false_positives
Jul 31, 2018
Merged

Reduce sequential string false positives#64
KevinHock merged 2 commits into
masterfrom
62_reduce_sequential_false_positives

Conversation

@KevinHock
Copy link
Copy Markdown
Collaborator

No description provided.

@KevinHock KevinHock requested a review from domanchi July 31, 2018 00:44
Copy link
Copy Markdown
Contributor

@domanchi domanchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix'n'ship!

from detect_secrets.plugins.core.yaml_file_parser import YamlFileParser


IGNORED_SEQUENTIAL_STRINGS = (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the string library for this.

e.g.

import string

IGNORED_SEQUENTIAL_STRINGS = (
    string.ascii_uppercase + string.digits + string.ascii_uppercase,
    string.hexdigits + string.hexdigits,
)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++
Changed it to

 IGNORED_SEQUENTIAL_STRINGS = (
-    'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/',  # upper/lower, numbers +/
-    '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ+/',  # numbers, upper/lower +/
-    'ABCDEFABCDEF0123456789ABCDEFABCDEF',  # Hex
-    'ABCDEFGHIJKLMNOPQRSTUVWXYZ=/',
+    (
+        string.ascii_uppercase +
+        string.ascii_uppercase +
+        string.digits +
+        string.ascii_uppercase +
+        string.ascii_uppercase +
+        '+/'
+    ),
+    string.hexdigits.upper() + string.hexdigits.upper(),
+    string.ascii_uppercase + '=/',
 )

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to use rebasing to make my commit history super clean, like someone I know. (@bcaller)

@KevinHock KevinHock force-pushed the 62_reduce_sequential_false_positives branch from 15f3523 to b5135fc Compare July 31, 2018 01:19
@KevinHock KevinHock merged commit 8c2d022 into master Jul 31, 2018
@KevinHock KevinHock deleted the 62_reduce_sequential_false_positives branch July 31, 2018 21:44
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.

2 participants