fluidattacks-core 4.3.2__py3-none-any.whl → 5.0.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.
@@ -263,7 +263,7 @@ def get_head_commit(path_to_repo: Path, branch: str) -> str | None:
263
263
  return (
264
264
  Repo(path_to_repo.resolve(), search_parent_directories=True).heads[branch].object.hexsha
265
265
  )
266
- except GitError:
266
+ except (GitError, AttributeError, IndexError):
267
267
  return None
268
268
 
269
269
 
@@ -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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fluidattacks-core
3
- Version: 4.3.2
3
+ Version: 5.0.0
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,13 +8,11 @@ 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
16
14
  fluidattacks_core/filesystem/defaults.py,sha256=tGGl_lXIOcU7N5GkiYyVaC23xRzEtzMR1E9hhEiXEn0,10596
17
- fluidattacks_core/git/__init__.py,sha256=aLiDZd-Jl7axe4zVvIiDQP2RPBiRvAf1jqEAc334iV8,8435
15
+ fluidattacks_core/git/__init__.py,sha256=GkFW3YIY-SOIUKW3cJE8r-m8qMat1kZIzDy_jGggyV4,8465
18
16
  fluidattacks_core/git/classes.py,sha256=vgCVOUF6tqeW0lKtD9giCNFQtzRit44bnu5qOAx7qCI,579
19
17
  fluidattacks_core/git/clone.py,sha256=alvidqUITrtTkvv4Ur9djI4Ch37QdhVWtHupMmV1eMc,7571
20
18
  fluidattacks_core/git/codecommit_utils.py,sha256=Ec1Ymk9F1DTTyRTdqrni77UUktGQgQB_jSq5n3wWy7Q,3422
@@ -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
@@ -46,7 +44,7 @@ fluidattacks_core/semver/match_versions.py,sha256=3L3C0TIVH0AtDpISvk5HHBXFSbJh5V
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.2.dist-info/METADATA,sha256=6YrIiARBEUdJao_8kBkWXMgRexIRiBqwLKrtkEq6j5Q,3319
50
- fluidattacks_core-4.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
51
- fluidattacks_core-4.3.2.dist-info/top_level.txt,sha256=m49ZyZ2zPQmDBxkSpjb20wr-ZbGVXdOMFBZrDiP5Lb8,18
52
- fluidattacks_core-4.3.2.dist-info/RECORD,,
47
+ fluidattacks_core-5.0.0.dist-info/METADATA,sha256=jVOvmOk1Br7K1xH9ND3-u0ld9H-nV-1qJeLqpd-BH3g,3453
48
+ fluidattacks_core-5.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
49
+ fluidattacks_core-5.0.0.dist-info/top_level.txt,sha256=m49ZyZ2zPQmDBxkSpjb20wr-ZbGVXdOMFBZrDiP5Lb8,18
50
+ fluidattacks_core-5.0.0.dist-info/RECORD,,
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]