fluidattacks-core 4.3.3__py3-none-any.whl → 5.0.1__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.
@@ -8,7 +8,7 @@ import aiohttp
8
8
  LOGGER = logging.getLogger(__name__)
9
9
 
10
10
  CONFIG_DELAY: int = 5 # For WARP to apply network configurations, in seconds
11
- DOMAIN_TO_TEST_DNS: str = "notify.bugsnag.com" # Using a domain that used to fail
11
+ DOMAIN_TO_TEST_DNS: str = "api.ipify.org" # Using a domain that used to fail
12
12
 
13
13
 
14
14
  class WarpError(Exception):
@@ -1,5 +1,6 @@
1
1
  import logging
2
2
  import re
3
+ from functools import lru_cache
3
4
  from itertools import (
4
5
  zip_longest,
5
6
  )
@@ -283,6 +284,7 @@ def match_version_ranges(dep_version: str, vulnerable_version: str) -> bool:
283
284
  return False
284
285
 
285
286
 
287
+ @lru_cache(maxsize=100000)
286
288
  def match_vulnerable_versions(dep_version: str, advisory_range: str | None) -> bool:
287
289
  if advisory_range is None:
288
290
  return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fluidattacks-core
3
- Version: 4.3.3
3
+ Version: 5.0.1
4
4
  Summary: Fluid Attacks Core Library
5
5
  Author-email: Development <development@fluidattacks.com>
6
6
  License: MPL-2.0
@@ -12,23 +12,24 @@ Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Topic :: Software Development :: Libraries
13
13
  Requires-Python: >=3.11
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: aiohttp>=3.10.0
16
- Requires-Dist: certifi>=2024.8.30
17
- Requires-Dist: python-json-logger>=3.3.0
18
- Requires-Dist: simplejson>=3.20.1
19
- Requires-Dist: urllib3>=2.6.1
20
15
  Provides-Extra: aio
21
16
  Requires-Dist: uvloop>=0.21.0; extra == "aio"
22
17
  Provides-Extra: authz
23
- Provides-Extra: bugsnag
24
- Requires-Dist: bugsnag>=4.7.1; extra == "bugsnag"
25
18
  Provides-Extra: git
19
+ Requires-Dist: aiohttp>=3.10.0; extra == "git"
26
20
  Requires-Dist: aiofiles>=23.2.1; extra == "git"
27
21
  Requires-Dist: boto3>=1.34; extra == "git"
28
22
  Requires-Dist: botocore>=1.40.18; extra == "git"
29
23
  Requires-Dist: GitPython>=3.1.41; extra == "git"
30
24
  Requires-Dist: pathspec>=0.12.1; extra == "git"
25
+ Requires-Dist: urllib3>=2.6.1; extra == "git"
31
26
  Provides-Extra: http
27
+ Requires-Dist: aiohttp>=3.10.0; extra == "http"
28
+ Requires-Dist: certifi>=2024.8.30; extra == "http"
29
+ Requires-Dist: urllib3>=2.6.1; extra == "http"
30
+ Provides-Extra: logging
31
+ Requires-Dist: simplejson>=3.20.1; extra == "logging"
32
+ Requires-Dist: python-json-logger>=3.3.0; extra == "logging"
32
33
  Provides-Extra: serializers
33
34
  Requires-Dist: more-itertools>=10.0.0; extra == "serializers"
34
35
  Requires-Dist: tree-sitter-c-sharp>=0.23.1; extra == "serializers"
@@ -55,11 +56,11 @@ Provides-Extra: semver
55
56
  Provides-Extra: all
56
57
  Requires-Dist: fluidattacks-core[aio]; extra == "all"
57
58
  Requires-Dist: fluidattacks-core[authz]; extra == "all"
58
- Requires-Dist: fluidattacks-core[bugsnag]; extra == "all"
59
59
  Requires-Dist: fluidattacks-core[cpg]; extra == "all"
60
60
  Requires-Dist: fluidattacks-core[filesystem]; extra == "all"
61
61
  Requires-Dist: fluidattacks-core[git]; extra == "all"
62
62
  Requires-Dist: fluidattacks-core[http]; extra == "all"
63
+ Requires-Dist: fluidattacks-core[logging]; extra == "all"
63
64
  Requires-Dist: fluidattacks-core[sarif]; extra == "all"
64
65
  Requires-Dist: fluidattacks-core[semver]; extra == "all"
65
66
  Requires-Dist: fluidattacks-core[serializers]; extra == "all"
@@ -8,8 +8,6 @@ fluidattacks_core/aio/threads.py,sha256=JrnAv7_jAlDDj2AI5MviWvxU8EHQVpW-c7uCtst-
8
8
  fluidattacks_core/authz/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  fluidattacks_core/authz/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  fluidattacks_core/authz/types.py,sha256=tngC-eq23EJlp6q5eW-uE3Xst5dBhsNcu3wfc5gsfF8,1558
11
- fluidattacks_core/bugsnag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- fluidattacks_core/bugsnag/client.py,sha256=t7UiMPa5K3euQoyxp1b0bzRNgj1kSt4TFe0jjOBeGGE,1351
13
11
  fluidattacks_core/cpg/__init__.py,sha256=W75X2p3ANMYYQC2l8qpb845kOdBhWrZLHEGgxj2xnLk,4961
14
12
  fluidattacks_core/cpg/joern.py,sha256=mjFrtWkIwE2-_uDWisWXwOEwXUaB0t24eKkMmbN45wE,2703
15
13
  fluidattacks_core/filesystem/__init__.py,sha256=PkM5NvhfCrNk5cvum26-26CKUTz1yBqy7ZBz2Ljmw8w,8346
@@ -27,7 +25,7 @@ fluidattacks_core/git/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
27
25
  fluidattacks_core/git/remote.py,sha256=cPuyBMHeGrzRkEjroB6zlRLMA-QH2gIyIkGJNyf8wZc,1255
28
26
  fluidattacks_core/git/ssh_utils.py,sha256=IpYb4atKpgJNMEsNhdhKnZYP8dQ0VqttDSUS1oCnUB4,4552
29
27
  fluidattacks_core/git/utils.py,sha256=nmMoYHudza7wRW9XTxXFIPw_F6MHHI2NkavR7tm6VRk,2244
30
- fluidattacks_core/git/warp.py,sha256=yLotfzBFWSWzM_DzI-hbp4t3hWggKNNGqBr-0mYQhLU,5656
28
+ fluidattacks_core/git/warp.py,sha256=SzDtyYG3TM--Nrv2nl1DM23NmSQ1o-Pc26LOvwGIb4k,5651
31
29
  fluidattacks_core/http/__init__.py,sha256=3Zz90L6e3_z-M-8Bvk_53rv-CFhPThkRGXnxCiQrmaU,60
32
30
  fluidattacks_core/http/client.py,sha256=jIhtGU2cKi5GZbxHq8WJOPgnk0beScRtxlz9tBSaKuw,2454
33
31
  fluidattacks_core/http/validations.py,sha256=h10Hr906KJqda1rJJb8eOqk1Xyyz81lAJ1glXeae4kM,3766
@@ -42,11 +40,11 @@ fluidattacks_core/logging/sources/types.py,sha256=ial-ASN6e0EV7XeetDknjcMx_HjqL6
42
40
  fluidattacks_core/logging/sources/utils.py,sha256=tMoEVqrkVtqMuYtjgG6ih0HOjHyN3tn9G7nZhNoo6IU,1102
43
41
  fluidattacks_core/sarif/__init__.py,sha256=vZkbzafVeqRPEc_dzq6oevZuNp50NNyNGa_eS0oNXnc,101519
44
42
  fluidattacks_core/semver/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
- fluidattacks_core/semver/match_versions.py,sha256=3L3C0TIVH0AtDpISvk5HHBXFSbJh5V7AINgfKEXYnYI,10157
43
+ fluidattacks_core/semver/match_versions.py,sha256=10Vc3aS5Q2WVeM6UYUNiAo8C4E7zFT4H64-ZPN-2-zY,10216
46
44
  fluidattacks_core/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
45
  fluidattacks_core/serializers/snippet.py,sha256=e520pZHC-fsNuYVNY30A7TcSugvUlFL6xdr74j5aCDM,12780
48
46
  fluidattacks_core/serializers/syntax.py,sha256=eSpoAmWLaVbd8tQ8ghHIvjJlCtieEf_IimonqLpIe3Y,16020
49
- fluidattacks_core-4.3.3.dist-info/METADATA,sha256=xyDRj5MhRaodo9KFQh9x1E2hx60DHNU9Lg9-vHRlGrw,3319
50
- fluidattacks_core-4.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
51
- fluidattacks_core-4.3.3.dist-info/top_level.txt,sha256=m49ZyZ2zPQmDBxkSpjb20wr-ZbGVXdOMFBZrDiP5Lb8,18
52
- fluidattacks_core-4.3.3.dist-info/RECORD,,
47
+ fluidattacks_core-5.0.1.dist-info/METADATA,sha256=E52TwLj71JPrMUmgZ24JrHHaDPhOH_uTbWAd9dyTPfw,3453
48
+ fluidattacks_core-5.0.1.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
49
+ fluidattacks_core-5.0.1.dist-info/top_level.txt,sha256=m49ZyZ2zPQmDBxkSpjb20wr-ZbGVXdOMFBZrDiP5Lb8,18
50
+ fluidattacks_core-5.0.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
File without changes
@@ -1,43 +0,0 @@
1
- import os
2
- import re
3
-
4
- from bugsnag.notification import (
5
- Notification,
6
- )
7
-
8
-
9
- def _remove_nix_hash(path: str) -> str:
10
- pattern = r"(\/nix\/store\/[a-z0-9]{32}-)"
11
- result = re.search(pattern, path)
12
- if not result:
13
- return path
14
- return path[result.end(0) :]
15
-
16
-
17
- def remove_nix_hash(notification: Notification) -> None:
18
- try:
19
- notification.exceptions = [ # type: ignore[attr-defined]
20
- {
21
- **exception,
22
- "stacktrace": [
23
- {**trace, "file": _remove_nix_hash(trace["file"])}
24
- for trace in exception["stacktrace"]
25
- ],
26
- }
27
- for exception in notification.exceptions # type: ignore[attr-defined]
28
- ]
29
- except AttributeError:
30
- notification.stacktrace = [
31
- {**trace, "file": _remove_nix_hash(trace["file"])} for trace in notification.stacktrace
32
- ]
33
-
34
-
35
- def add_batch_metadata(notification: Notification) -> None:
36
- batch_job_info = {}
37
- if batch_job_id := os.environ.get("AWS_BATCH_JOB_ID"):
38
- batch_job_info["batch_job_id"] = batch_job_id
39
- if job_queue_name := os.environ.get("AWS_BATCH_JQ_NAME"):
40
- batch_job_info["batch_job_queue"] = job_queue_name
41
-
42
- if batch_job_info:
43
- notification.add_tab("batch_job_info", batch_job_info) # type: ignore[no-untyped-call]