Debian Codegraph @

proselint/checks/security/password.py

raw
1 """Password in plain text.
2
3 ---
4 layout: post
5 source: ???
6 source_url: ???
7 title: password in plain text
8 date: 2014-06-10 12:31:19
9 categories: writing
10 ---
11
12 Don't put pass
13 """
14 from proselint.tools import existence_check, memoize
15
16
17 @memoize
18 def check(text):
19 """Check the text."""
20 err = "security.password"
21 msg = "Don't put passwords in plain text."
22
23 pwd_regex = r"[:]? [\S]{6,30}"
24
25 password = [
26 f"the password is{pwd_regex}",
27 f"my password is{pwd_regex}",
28 f"the password's{pwd_regex}",
29 f"my password's{pwd_regex}",
30 f"^[pP]assword{pwd_regex}",
31 ]
32
33 return existence_check(text, password, err, msg)