Skip to content

Commit 882338f

Browse files
committed
chg: [deps] Remove pyfaup
1 parent 0e04091 commit 882338f

File tree

7 files changed

+7
-67
lines changed

7 files changed

+7
-67
lines changed

misp_modules/__init__.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -49,47 +49,6 @@
4949
warnings.filterwarnings("ignore", category=SyntaxWarning)
5050

5151

52-
LIBFAUP_PATHS = [
53-
"/usr/local/lib/",
54-
"/usr/lib/",
55-
"/opt/local/lib/",
56-
]
57-
58-
ARCH_TO_EXTENSION = {
59-
"linux": "so",
60-
"darwin": "dylib",
61-
}
62-
63-
64-
def _get_libfaup_path(lib_path: str) -> str:
65-
extension = ARCH_TO_EXTENSION.get(platform.system().lower(), "lib")
66-
return f"{lib_path.rstrip('/')}/libfaupl.{extension}"
67-
68-
69-
def _replace_libfaup_path(module_path: str, libfaup_path: str) -> None:
70-
with open(module_path, "r") as f:
71-
file_data = f.read()
72-
file_data = re.sub(r"cdll.LoadLibrary\(.*\)", f"cdll.LoadLibrary(\"{libfaup_path}\")", file_data)
73-
with open(module_path, "w") as f:
74-
f.write(file_data)
75-
76-
77-
def _try_pyfaup_import(lib_path: typing.Optional[str]) -> None:
78-
package = pkgutil.get_loader("pyfaup")
79-
if not package:
80-
return
81-
if lib_path:
82-
_replace_libfaup_path(package.path, _get_libfaup_path(lib_path))
83-
importlib.import_module("pyfaup")
84-
85-
86-
for lib_path in [None, *LIBFAUP_PATHS]:
87-
try:
88-
_try_pyfaup_import(lib_path)
89-
break
90-
except OSError:
91-
continue
92-
9352
try:
9453
from .modules import * # noqa
9554
HAS_PACKAGE_MODULES = True

misp_modules/modules/action_mod/mattermost.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import json
2-
from pyfaup.faup import Faup
2+
from pymisp.tools._psl_faup import PSLFaup as Faup
33
from mattermostdriver import Driver
44
from ._utils import utils
55

misp_modules/modules/expansion/extract_url_components.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
from pymisp import MISPEvent, MISPObject
33
from . import check_input_attribute, standard_error_message
4-
from pyfaup.faup import Faup
4+
from pymisp.tools._psl_faup import PSLFaup as Faup
55

66
misperrors = {'error': 'Error'}
77
mispattributes = {'input': ['url'], 'format': 'misp_standard'}

misp_modules/modules/import_mod/email_import.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
import zipfile
55
import re
66
from html.parser import HTMLParser
7-
from pymisp.tools import EMailObject, make_binary_objects
8-
try:
9-
from pymisp.tools import URLObject
10-
except ImportError:
11-
raise ImportError('Unable to import URLObject, pyfaup missing')
7+
from pymisp.tools import EMailObject, make_binary_objects, URLObject
128
from io import BytesIO
139
from pathlib import Path
1410

misp_modules/modules/import_mod/url_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
import base64
33
from pymisp import MISPEvent, MISPObject, MISPAttribute
4-
from pyfaup.faup import Faup
4+
from pymisp.tools._psl_faup import PSLFaup as Faup
55

66
misperrors = {'error': 'Error'}
77
userConfig = {

poetry.lock

Lines changed: 1 addition & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "misp-modules"
3-
version = "2.4.200"
3+
version = "2.4.201"
44
description = "MISP modules are autonomous modules that can be used for expansion and other services in MISP"
55
authors = [
66
{name = "Alexandre Dulaunoy", email = "[email protected]"}
@@ -59,11 +59,10 @@ dependencies = [
5959
"pycountry",
6060
"pyeti-python3",
6161
"pyeupi",
62-
"pyfaup",
6362
"pygeoip",
6463
"pyintel471",
6564
"pyipasnhistory",
66-
"pymisp[fileobjects, openioc, pdfexport, email, url]",
65+
"pymisp[fileobjects, openioc, pdfexport, email]",
6766
"pypdns",
6867
"pypssl",
6968
"pysafebrowsing",

0 commit comments

Comments
 (0)