-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathignore-passwords-tokens.ini
More file actions
39 lines (33 loc) · 1.25 KB
/
Copy pathignore-passwords-tokens.ini
File metadata and controls
39 lines (33 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
[Command]
Automatic=true
Command="
copyq:
const notificationTimeout = config('item_popup_interval') * 1000;
const passwordLengthRange = [16, 128];
const passwordMustNotContainSpaces = true;
const passwordMustContainNumber = true;
const passwordMustContainLowercaseLetter = true;
const passwordMustContainUppercaseLetter = true;
const allowList = [/^https?:\\/\\//]
// Assume that HTML text does not contain secrets
if (data(mimeHtml).length !== 0) abort();
const textData = data(mimeText);
if (textData.length < passwordLengthRange[0]) abort();
if (textData.length > passwordLengthRange[1]) abort();
const text = str(textData);
if (passwordMustNotContainSpaces && /\\s/.test(text)) abort();
if (passwordMustContainNumber && !/\\d/.test(text)) abort();
if (passwordMustContainLowercaseLetter && !/[a-z]/.test(text)) abort();
if (passwordMustContainUppercaseLetter && !/[A-Z]/.test(text)) abort();
for (const re of allowList) {
if (re.test(text)) abort();
}
notification(
'.title', 'Ignoring secret in the clipboard',
'.id', 'secrets',
'.icon', '\xf084',
'.time', notificationTimeout,
);
ignore();"
Icon=\xf084
Name=Ignore Passwords/Tokens