osbot-utils 2.54.0__py3-none-any.whl → 2.55.0__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.
- osbot_utils/helpers/safe_str/Safe_Str__HTML.py +17 -0
- osbot_utils/helpers/safe_str/Safe_Str__Text__Dangerous.py +1 -4
- osbot_utils/version +1 -1
- {osbot_utils-2.54.0.dist-info → osbot_utils-2.55.0.dist-info}/METADATA +2 -2
- {osbot_utils-2.54.0.dist-info → osbot_utils-2.55.0.dist-info}/RECORD +7 -6
- {osbot_utils-2.54.0.dist-info → osbot_utils-2.55.0.dist-info}/LICENSE +0 -0
- {osbot_utils-2.54.0.dist-info → osbot_utils-2.55.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
import re
|
2
|
+
from osbot_utils.helpers.safe_str.Safe_Str import Safe_Str
|
3
|
+
|
4
|
+
# Define the size constant
|
5
|
+
TYPE_SAFE_STR__HTML__MAX_LENGTH = 1048576 # 1 megabyte in bytes
|
6
|
+
|
7
|
+
# A minimal regex that only filters out:
|
8
|
+
# - NULL byte (U+0000)
|
9
|
+
# - Control characters (U+0001 to U+0008, U+000B to U+000C, U+000E to U+001F)
|
10
|
+
# We explicitly allow:
|
11
|
+
# - Tab (U+0009), Line Feed (U+000A), and Carriage Return (U+000D)
|
12
|
+
# - All other Unicode characters
|
13
|
+
TYPE_SAFE_STR__HTML__REGEX = re.compile(r'[\x00\x01-\x08\x0B\x0C\x0E-\x1F]')
|
14
|
+
|
15
|
+
class Safe_Str__HTML(Safe_Str):
|
16
|
+
max_length = TYPE_SAFE_STR__HTML__MAX_LENGTH
|
17
|
+
regex = TYPE_SAFE_STR__HTML__REGEX
|
@@ -6,7 +6,4 @@ TYPE_SAFE_STR__TEXT__DANGEROUS__REGEX = r'[^a-zA-Z0-9_\s!@#$%^&*()\[\]{}\-+
|
|
6
6
|
|
7
7
|
class Safe_Str__Text__Dangerous(Safe_Str):
|
8
8
|
regex = re.compile(TYPE_SAFE_STR__TEXT__DANGEROUS__REGEX)
|
9
|
-
max_length = TYPE_SAFE_STR__TEXT__DANGEROUS__MAX_LENGTH
|
10
|
-
|
11
|
-
|
12
|
-
Safe_Str__HTML = Safe_Str__Text__Dangerous # we can reuse this class for Safe_Str__HTML since the regex and size are the same
|
9
|
+
max_length = TYPE_SAFE_STR__TEXT__DANGEROUS__MAX_LENGTH
|
osbot_utils/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
v2.
|
1
|
+
v2.55.0
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: osbot_utils
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.55.0
|
4
4
|
Summary: OWASP Security Bot - Utils
|
5
5
|
License: MIT
|
6
6
|
Author: Dinis Cruz
|
@@ -23,7 +23,7 @@ Description-Content-Type: text/markdown
|
|
23
23
|
|
24
24
|
Powerful Python util methods and classes that simplify common apis and tasks.
|
25
25
|
|
26
|
-

|
27
27
|
[](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
|
28
28
|
|
29
29
|
|
@@ -236,9 +236,10 @@ osbot_utils/helpers/python_compatibility/python_3_8.py,sha256=kh846vs3ir8xD0RSAR
|
|
236
236
|
osbot_utils/helpers/safe_str/Safe_Str.py,sha256=BKyS0hTRvP-f0uLFtT8KCE9rVQBzhWKNoSxlttEjrEE,3261
|
237
237
|
osbot_utils/helpers/safe_str/Safe_Str__File__Name.py,sha256=ncjkQ2hAhw0a3UulrCuQsA9ytrFwg5CT1XRJIGChMpY,289
|
238
238
|
osbot_utils/helpers/safe_str/Safe_Str__File__Path.py,sha256=K0yBcvH_Ncqiw7tMqjGqaNyWQh1Zs9qxZ-TR8nEIAow,550
|
239
|
+
osbot_utils/helpers/safe_str/Safe_Str__HTML.py,sha256=d4weowVjsD_stnw-rH96aRQOoSGJ6DK8vrhsJVBKTws,662
|
239
240
|
osbot_utils/helpers/safe_str/Safe_Str__Hash.py,sha256=Tb2QeVpVDNWpCJGHNFjZPCQ_ZTaI7Z5BDzi19LiO_cI,952
|
240
241
|
osbot_utils/helpers/safe_str/Safe_Str__Text.py,sha256=QxuWqF8hNYdOPDn3Yac86h_1ZaX-THbTBDakberiJcs,313
|
241
|
-
osbot_utils/helpers/safe_str/Safe_Str__Text__Dangerous.py,sha256=
|
242
|
+
osbot_utils/helpers/safe_str/Safe_Str__Text__Dangerous.py,sha256=6-fkXBuWgjz70eQicD07f38eEuKqNzJzaFFY6hozhNQ,388
|
242
243
|
osbot_utils/helpers/safe_str/Safe_Str__Url.py,sha256=4l46AAe5Dy_P_W6d-_3pwtXuehG_Wczq1dC5sOOzg_g,549
|
243
244
|
osbot_utils/helpers/safe_str/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
244
245
|
osbot_utils/helpers/sqlite/Capture_Sqlite_Error.py,sha256=GSuRYgs1yKQjxMszPoaI7fsfMfuUqhb64AaIysRE6Cs,1747
|
@@ -399,8 +400,8 @@ osbot_utils/utils/Toml.py,sha256=Rxl8gx7mni5CvBAK-Ai02EKw-GwtJdd3yeHT2kMloik,166
|
|
399
400
|
osbot_utils/utils/Version.py,sha256=Ww6ChwTxqp1QAcxOnztkTicShlcx6fbNsWX5xausHrg,422
|
400
401
|
osbot_utils/utils/Zip.py,sha256=pR6sKliUY0KZXmqNzKY2frfW-YVQEVbLKiyqQX_lc-8,14052
|
401
402
|
osbot_utils/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
402
|
-
osbot_utils/version,sha256=
|
403
|
-
osbot_utils-2.
|
404
|
-
osbot_utils-2.
|
405
|
-
osbot_utils-2.
|
406
|
-
osbot_utils-2.
|
403
|
+
osbot_utils/version,sha256=3SvciDB5paRmxMPRynM-Um_9fOU4mieRynNr87hvd9s,8
|
404
|
+
osbot_utils-2.55.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
405
|
+
osbot_utils-2.55.0.dist-info/METADATA,sha256=FJK0sAEUydzQO5aIrtHeU1nfUm0O1v6Rx6ZUWsrbtUo,1329
|
406
|
+
osbot_utils-2.55.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
407
|
+
osbot_utils-2.55.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|