Skip to content

Commit b71f161

Browse files
committed
t-strings
1 parent cad8b30 commit b71f161

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

credsweeper/common/keyword_pattern.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class KeywordPattern:
2929
r"(?(get)('[^']{1,31}'|\"[^\"]{1,31}\")\s*,\s*|)" \
3030
r"([0-9a-z_]{1,32}\s*[:=]\s*)?" \
3131
r"){1,8})?"
32-
string_prefix = r"(((b|r|br|rb|u|f|rf|fr|l|t|@)(?=(\\*[\"'`])))?"
32+
string_prefix = r"(((b|r|br|rb|u|t|f|rf|fr|l|@)(?=(\\*[\"'`])))?"
3333
left_quote = r"(?P<value_leftquote>((?P<esq>\\{1,8})?([\"'`]|&(quot|apos|#3[49]);)){1,4}))?"
3434
# Authentication scheme ( oauth | basic | bearer | apikey ) precedes to credential
3535
auth_keywords = r"(\s?(oauth|bot|basic|bearer|apikey|accesskey|ssws|ntlm)\s)?"

tests/common/test_keyword_pattern.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def test_separator_p(self, config: Config, file_path: pytest.fixture, line: str)
162162
["""'password': b'secret'""", """secret"""], #
163163
["""'password': r'secret'""", """secret"""], #
164164
["""'password': fr'secret'""", """secret"""], #
165+
["""'password': t'{secret}'""", """{secret}"""], #
165166
["""\\'password\\': \\'secret\\'""", """secret"""], #
166167
['''db.setCred("{ \"password\" : \"" + SECRET + "\" }");''', ''' + SECRET + '''],
167168
['''\\"password\\": \\"{\\\\"secret\\\\": \\\\"test\\\\"}\\"''', '{\\\\"secret\\\\": \\\\"test\\\\"}'], #

0 commit comments

Comments
 (0)