Changing requirements + formating

This commit is contained in:
k1nd0ne
2023-11-30 11:50:04 +01:00
parent fd5c828939
commit ed98d453f6
2 changed files with 29 additions and 31 deletions
+2 -2
View File
@@ -18,5 +18,5 @@ pycryptodome
leechcorepyc>=2.4.0
# This is required for memory analysis on a Amazon/MinIO S3 and Google Cloud object storage
gcsfs>=2023.6.0
s3fs>=2023.6.0
gcsfs>=2023.1.0
s3fs>=2023.1.0
+27 -29
View File
@@ -23,35 +23,33 @@ from volatility3.framework.layers import resources
vollog = logging.getLogger(__file__)
class S3FileSystemHandler(resources.VolatilityHandler):
if HAS_S3FS:
@classmethod
def non_cached_schemes(cls) -> List[str]:
return ["s3"]
if HAS_S3FS:
@staticmethod
def default_open(req: urllib.request.Request) -> Optional[Any]:
"""Handles the request if it's the s3 scheme."""
if req.type == "s3":
object_uri = "://".join(req.full_url.split("://")[1:])
return s3fs.S3FileSystem().open(object_uri)
return None
else:
raise exceptions.LayerException("s3 requirement is missing.")
class S3FileSystemHandler(resources.VolatilityHandler):
@classmethod
def non_cached_schemes(cls) -> List[str]:
return ["s3"]
@staticmethod
def default_open(req: urllib.request.Request) -> Optional[Any]:
"""Handles the request if it's the s3 scheme."""
if req.type == "s3":
object_uri = "://".join(req.full_url.split("://")[1:])
return s3fs.S3FileSystem().open(object_uri)
return None
class GSFileSystemHandler(resources.VolatilityHandler):
if HAS_GCSFS:
@classmethod
def non_cached_schemes(cls) -> List[str]:
return ["gs"]
@staticmethod
def default_open(req: urllib.request.Request) -> Optional[Any]:
"""Handles the request if it's the gs scheme."""
if req.type == "gs":
object_uri = "://".join(req.full_url.split("://")[1:])
return gcsfs.GCSFileSystem().open(object_uri)
return None
else:
raise exceptions.LayerException("gcsfs requirement is missing.")
if HAS_GCSFS:
class GSFileSystemHandler(resources.VolatilityHandler):
@classmethod
def non_cached_schemes(cls) -> List[str]:
return ["gs"]
@staticmethod
def default_open(req: urllib.request.Request) -> Optional[Any]:
"""Handles the request if it's the gs scheme."""
if req.type == "gs":
object_uri = "://".join(req.full_url.split("://")[1:])
return gcsfs.GCSFileSystem().open(object_uri)
return None