troubadix 24.10.1__py3-none-any.whl → 24.10.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
troubadix/__version__.py CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  # THIS IS AN AUTOGENERATED FILE. DO NOT TOUCH!
4
4
 
5
- __version__ = "24.10.1"
5
+ __version__ = "24.10.2"
@@ -41,6 +41,10 @@ ALLOWED_URLS = [
41
41
  "http://mail-archives.apache.org/mod_mbox/perl-advocacy/2"
42
42
  "00904.mbox/<ad28918e0904011458h273a71d4x408f1ed286c9dfbc@mail.gmail.com>",
43
43
  "http://yehg.net/lab/pr0js/advisories/[mybb1.6]_cross_site_scripting",
44
+ "http://www.live555.com/liveMedia/public/changelog.txt#[2021.08.04]",
45
+ "http://www.live555.com/liveMedia/public/changelog.txt#[2021.08.06]",
46
+ "http://www.live555.com/liveMedia/public/changelog.txt#[2021.08.09]",
47
+ "http://www.live555.com/liveMedia/public/changelog.txt#[2021.08.13]",
44
48
  ]
45
49
 
46
50
 
@@ -63,11 +67,67 @@ class CheckScriptXrefUrl(FileContentPlugin):
63
67
  )
64
68
  for match in matches:
65
69
  if match:
66
- if match.group("value") not in ALLOWED_URLS and not url(
67
- match.group("value"), strict_query=False
68
- ):
70
+ url_value = match.group("value")
71
+ if url_value in ALLOWED_URLS:
72
+ continue
73
+
74
+ full_xref = match.group(0)
75
+
76
+ # First a few possible malformed URLs introduced by e.g. some automatic
77
+ # extraction or by copy'n'paste
78
+ if url_value.endswith(">") and "<" not in url_value:
79
+ yield LinterError(
80
+ f"{full_xref}: Invalid URL value (trailing '>')",
81
+ file=nasl_file,
82
+ plugin=self.name,
83
+ )
84
+ continue
85
+
86
+ if url_value.endswith(","):
87
+ yield LinterError(
88
+ f"{full_xref}: Invalid URL value (trailing ',')",
89
+ file=nasl_file,
90
+ plugin=self.name,
91
+ )
92
+ continue
93
+
94
+ if url_value.endswith(":"):
95
+ yield LinterError(
96
+ f"{full_xref}: Invalid URL value (trailing ':')",
97
+ file=nasl_file,
98
+ plugin=self.name,
99
+ )
100
+ continue
101
+
102
+ if url_value.endswith("]") and "[" not in url_value:
103
+ yield LinterError(
104
+ f"{full_xref}: Invalid URL value (trailing ']')",
105
+ file=nasl_file,
106
+ plugin=self.name,
107
+ )
108
+ continue
109
+
110
+ if url_value.endswith(")") and "(" not in url_value:
111
+ yield LinterError(
112
+ f"{full_xref}: Invalid URL value (trailing ')')",
113
+ file=nasl_file,
114
+ plugin=self.name,
115
+ )
116
+ continue
117
+
118
+ if url_value.endswith(".htmll"):
119
+ yield LinterError(
120
+ f"{full_xref}: Invalid URL value (wrong file extension)",
121
+ file=nasl_file,
122
+ plugin=self.name,
123
+ )
124
+ continue
125
+
126
+ # Additional standard check via the validators package
127
+ if not url(url_value, strict_query=False):
69
128
  yield LinterError(
70
- f"{match.group(0)}: Invalid URL value",
129
+ f"{full_xref}: Invalid URL value",
71
130
  file=nasl_file,
72
131
  plugin=self.name,
73
132
  )
133
+ continue
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: troubadix
3
- Version: 24.10.1
3
+ Version: 24.10.2
4
4
  Summary: A linting and QA check tool for NASL files
5
5
  Home-page: https://github.com/greenbone/troubadix
6
6
  License: GPL-3.0-or-later
@@ -1,5 +1,5 @@
1
1
  troubadix/__init__.py,sha256=K7sIXXDrC7YRb7BvIpdQ6ZfG_QkT0qUH_wAlHROVRfM,716
2
- troubadix/__version__.py,sha256=QzxNhvE2FNP2xdsM9j8IJSuyjqWoBaVmQ_l5mtbnUWw,104
2
+ troubadix/__version__.py,sha256=58oJtkrBoJ8AceR1_OSAT2aE8w7HbsSoDvB5DNU7d64,104
3
3
  troubadix/argparser.py,sha256=YAo8cGJt0k2GMICXrDj3Z124GrM8oRwgNm2Bn3J_gYI,7001
4
4
  troubadix/codespell/codespell.additions,sha256=OaHe66OE0Yx4VTkhIeITZqB7_ERiv0fsDnpikGUgZ-Q,488
5
5
  troubadix/codespell/codespell.exclude,sha256=6HEOtHrMBBdm4E4794W4g1H9nmGLlYbgZpQiJzKio-A,139033
@@ -52,7 +52,7 @@ troubadix/plugins/script_tag_whitespaces.py,sha256=2ZqiNufPIyr5Wmcuap3Wy8RXO_CHG
52
52
  troubadix/plugins/script_tags_mandatory.py,sha256=t9GiueHwCjWq-2jQszYNufWpfIKTLdUbbvXPyiw3HeY,2630
53
53
  troubadix/plugins/script_version_and_last_modification_tags.py,sha256=Yz9dQwrsRfIqXwPd8Re8aDu--SBjgufWOA6U7tW4JW4,7638
54
54
  troubadix/plugins/script_xref_form.py,sha256=5L1KPUHiKbe-71o-X0cUBT844XvIOsAJbB14gnYTod0,1848
55
- troubadix/plugins/script_xref_url.py,sha256=qKeRgcZEka4Xm0EYYSq9_J_y8jVn6lrLPYan2FljN4E,2895
55
+ troubadix/plugins/script_xref_url.py,sha256=dUTq0ghreVBHFJnwSInmMoQAQwU0oh959mMz4l6rWA0,5331
56
56
  troubadix/plugins/security_messages.py,sha256=EPu3-YB0iP5_hfbQjrfvvTrQRiPgDjC85GTz3V-by0Q,4629
57
57
  troubadix/plugins/set_get_kb_calls.py,sha256=WGu1CKLjn3VhbDo33IJ4TtWQ-kz9gInkJskTqOSMM6k,3415
58
58
  troubadix/plugins/solution_text.py,sha256=4Gs84Qsyg-1iTDP7Y7o8Bo5AH4hKlwGPW0NfwMpx2fU,5852
@@ -93,8 +93,8 @@ troubadix/standalone_plugins/last_modification.py,sha256=oYzQq7xV3YzSvi6ZtuHuupX
93
93
  troubadix/standalone_plugins/no_solution.py,sha256=81r20kP8otRob2NTaCea-sgVRIM6ARvhddFdibsG6Ao,8877
94
94
  troubadix/standalone_plugins/version_updated.py,sha256=RlzVuXgFOvcjrRTOhiTYlmzV4vvcn7ntCz0lDTjePMU,4316
95
95
  troubadix/troubadix.py,sha256=foA7Loi67cCKieN3ea4s3QOfOWOkgwQVR1H-pNXtXn0,6041
96
- troubadix-24.10.1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
97
- troubadix-24.10.1.dist-info/METADATA,sha256=c7uJGlMtz-hbHkJJDpRsU-1kPAr8_QOjJvtyajMKK84,4417
98
- troubadix-24.10.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
99
- troubadix-24.10.1.dist-info/entry_points.txt,sha256=LplOk4nzKrS4B8Jz0SPkQLPlIDesdraCO8Vp_eoycpc,737
100
- troubadix-24.10.1.dist-info/RECORD,,
96
+ troubadix-24.10.2.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
97
+ troubadix-24.10.2.dist-info/METADATA,sha256=JBx0oG22hQqU9IWcXGRPHDMkF5oFRPKh90J_pmUy4u0,4417
98
+ troubadix-24.10.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
99
+ troubadix-24.10.2.dist-info/entry_points.txt,sha256=LplOk4nzKrS4B8Jz0SPkQLPlIDesdraCO8Vp_eoycpc,737
100
+ troubadix-24.10.2.dist-info/RECORD,,