flow.record 3.14.dev3__tar.gz → 3.14.dev5__tar.gz
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.
- {flow.record-3.14.dev3/flow.record.egg-info → flow.record-3.14.dev5}/PKG-INFO +1 -1
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/fieldtypes/__init__.py +25 -17
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/stream.py +5 -1
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/version.py +2 -2
- {flow.record-3.14.dev3 → flow.record-3.14.dev5/flow.record.egg-info}/PKG-INFO +1 -1
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_fieldtypes.py +26 -6
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/COPYRIGHT +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/LICENSE +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/MANIFEST.in +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/README.md +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/examples/filesystem.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/examples/passivedns.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/examples/records.json +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/examples/tcpconn.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/__init__.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/__init__.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/archive.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/avro.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/broker.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/csvfile.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/elastic.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/jsonfile.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/line.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/mongo.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/split.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/splunk.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/sqlite.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/stream.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/text.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/adapter/xlsx.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/base.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/exceptions.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/fieldtypes/credential.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/fieldtypes/net/__init__.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/fieldtypes/net/ip.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/fieldtypes/net/ipv4.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/fieldtypes/net/tcp.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/fieldtypes/net/udp.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/jsonpacker.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/packer.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/selector.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/tools/__init__.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/tools/geoip.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/tools/rdump.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/utils.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow/record/whitelist.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow.record.egg-info/SOURCES.txt +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow.record.egg-info/dependency_links.txt +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow.record.egg-info/entry_points.txt +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow.record.egg-info/requires.txt +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/flow.record.egg-info/top_level.txt +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/pyproject.toml +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/setup.cfg +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/__init__.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/_utils.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/docs/Makefile +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/docs/conf.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/docs/index.rst +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/selector_explain_example.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/standalone_test.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_avro.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_avro_adapter.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_compiled_selector.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_csv_adapter.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_deprecations.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_fieldtype_ip.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_json_packer.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_json_record_adapter.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_multi_timestamp.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_packer.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_rdump.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_record.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_record_adapter.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_record_descriptor.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_regression.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_selector.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_splunk_adapter.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/test_sqlite_adapter.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tests/utils_inspect.py +0 -0
- {flow.record-3.14.dev3 → flow.record-3.14.dev5}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flow.record
|
|
3
|
-
Version: 3.14.
|
|
3
|
+
Version: 3.14.dev5
|
|
4
4
|
Summary: A library for defining and creating structured data (called records) that can be streamed to disk or piped to other tools that use flow.record
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License: Affero General Public License v3
|
|
@@ -32,6 +32,7 @@ NATIVE_UNICODE = isinstance("", str)
|
|
|
32
32
|
UTC = timezone.utc
|
|
33
33
|
|
|
34
34
|
PY_311 = sys.version_info >= (3, 11, 0)
|
|
35
|
+
PY_312 = sys.version_info >= (3, 12, 0)
|
|
35
36
|
|
|
36
37
|
PATH_POSIX = 0
|
|
37
38
|
PATH_WINDOWS = 1
|
|
@@ -645,28 +646,31 @@ class path(pathlib.PurePath, FieldType):
|
|
|
645
646
|
for path_part in args:
|
|
646
647
|
if isinstance(path_part, pathlib.PureWindowsPath):
|
|
647
648
|
cls = windows_path
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
649
|
+
if not PY_312:
|
|
650
|
+
# For Python < 3.12, the (string) representation of a
|
|
651
|
+
# pathlib.PureWindowsPath is not round trip equivalent if a path
|
|
652
|
+
# starts with a \ or / followed by a drive letter, e.g.: \C:\...
|
|
653
|
+
# Meaning:
|
|
654
|
+
#
|
|
655
|
+
# str(PureWindowsPath(r"\C:\WINDOWS/Temp")) !=
|
|
656
|
+
# str(PureWindowsPath(PureWindowsPath(r"\C:\WINDOWS/Temp"))),
|
|
657
|
+
#
|
|
658
|
+
# repr(PureWindowsPath(r"\C:\WINDOWS/Temp")) !=
|
|
659
|
+
# repr(PureWindowsPath(PureWindowsPath(r"\C:\WINDOWS/Temp"))),
|
|
660
|
+
#
|
|
661
|
+
# This would be the case though when using PurePosixPath instead.
|
|
662
|
+
#
|
|
663
|
+
# This construction works around that by converting all path parts
|
|
664
|
+
# to strings first.
|
|
665
|
+
args = (str(arg) for arg in args)
|
|
663
666
|
elif isinstance(path_part, pathlib.PurePosixPath):
|
|
664
667
|
cls = posix_path
|
|
665
668
|
elif _is_windowslike_path(path_part):
|
|
666
669
|
# This handles any custom PurePath based implementations that have a windows
|
|
667
670
|
# like path separator (\).
|
|
668
671
|
cls = windows_path
|
|
669
|
-
|
|
672
|
+
if not PY_312:
|
|
673
|
+
args = (str(arg) for arg in args)
|
|
670
674
|
elif _is_posixlike_path(path_part):
|
|
671
675
|
# This handles any custom PurePath based implementations that don't have a
|
|
672
676
|
# windows like path separator (\).
|
|
@@ -675,7 +679,11 @@ class path(pathlib.PurePath, FieldType):
|
|
|
675
679
|
continue
|
|
676
680
|
break
|
|
677
681
|
|
|
678
|
-
|
|
682
|
+
if PY_312:
|
|
683
|
+
obj = super().__new__(cls)
|
|
684
|
+
else:
|
|
685
|
+
obj = cls._from_parts(args)
|
|
686
|
+
return obj
|
|
679
687
|
|
|
680
688
|
def __eq__(self, other: Any) -> bool:
|
|
681
689
|
if isinstance(other, str):
|
|
@@ -3,6 +3,7 @@ from __future__ import print_function
|
|
|
3
3
|
import datetime
|
|
4
4
|
import logging
|
|
5
5
|
import os
|
|
6
|
+
import reprlib
|
|
6
7
|
import struct
|
|
7
8
|
import sys
|
|
8
9
|
from collections import ChainMap
|
|
@@ -17,6 +18,9 @@ from .packer import RecordPacker
|
|
|
17
18
|
|
|
18
19
|
log = logging.getLogger(__package__)
|
|
19
20
|
|
|
21
|
+
aRepr = reprlib.Repr()
|
|
22
|
+
aRepr.maxother = 255
|
|
23
|
+
|
|
20
24
|
|
|
21
25
|
def RecordOutput(fp):
|
|
22
26
|
"""Return a RecordPrinter if `fp` is a tty otherwise a RecordStreamWriter."""
|
|
@@ -156,7 +160,7 @@ def record_stream(sources, selector=None):
|
|
|
156
160
|
except KeyboardInterrupt:
|
|
157
161
|
raise
|
|
158
162
|
except Exception as e: # noqa: B902
|
|
159
|
-
log.warning("Exception in
|
|
163
|
+
log.warning("Exception in %r for %r: %s -- skipping to next reader", reader, src, aRepr.repr(e))
|
|
160
164
|
continue
|
|
161
165
|
|
|
162
166
|
|
|
@@ -12,5 +12,5 @@ __version__: str
|
|
|
12
12
|
__version_tuple__: VERSION_TUPLE
|
|
13
13
|
version_tuple: VERSION_TUPLE
|
|
14
14
|
|
|
15
|
-
__version__ = version = '3.14.
|
|
16
|
-
__version_tuple__ = version_tuple = (3, 14, '
|
|
15
|
+
__version__ = version = '3.14.dev5'
|
|
16
|
+
__version_tuple__ = version_tuple = (3, 14, 'dev5')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flow.record
|
|
3
|
-
Version: 3.14.
|
|
3
|
+
Version: 3.14.dev5
|
|
4
4
|
Summary: A library for defining and creating structured data (called records) that can be streamed to disk or piped to other tools that use flow.record
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License: Affero General Public License v3
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import hashlib
|
|
4
4
|
import os
|
|
5
5
|
import pathlib
|
|
6
|
+
import posixpath
|
|
7
|
+
import types
|
|
6
8
|
from datetime import datetime, timedelta, timezone
|
|
7
9
|
|
|
8
10
|
import pytest
|
|
@@ -12,6 +14,7 @@ from flow.record import RecordDescriptor, RecordReader, RecordWriter
|
|
|
12
14
|
from flow.record.fieldtypes import (
|
|
13
15
|
PATH_POSIX,
|
|
14
16
|
PATH_WINDOWS,
|
|
17
|
+
PY_312,
|
|
15
18
|
_is_posixlike_path,
|
|
16
19
|
_is_windowslike_path,
|
|
17
20
|
)
|
|
@@ -527,12 +530,29 @@ def test_digest():
|
|
|
527
530
|
|
|
528
531
|
|
|
529
532
|
def custom_pure_path(sep, altsep):
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
533
|
+
# Starting from Python 3.12, pathlib._Flavours are removed as you can
|
|
534
|
+
# now properly subclass pathlib.Path
|
|
535
|
+
# The flavour property of Path's is replaced by a link to e.g.
|
|
536
|
+
# posixpath or ntpath.
|
|
537
|
+
# See also: https://github.com/python/cpython/issues/88302
|
|
538
|
+
if PY_312:
|
|
539
|
+
|
|
540
|
+
class CustomFlavour:
|
|
541
|
+
def __new__(cls, *args, **kwargs):
|
|
542
|
+
flavour = types.ModuleType("mockpath")
|
|
543
|
+
flavour.__dict__.update(posixpath.__dict__)
|
|
544
|
+
flavour.sep = sep
|
|
545
|
+
flavour.altsep = altsep
|
|
546
|
+
return flavour
|
|
547
|
+
|
|
548
|
+
else:
|
|
549
|
+
|
|
550
|
+
class CustomFlavour(pathlib._PosixFlavour):
|
|
551
|
+
def __new__(cls):
|
|
552
|
+
instance = super().__new__(cls)
|
|
553
|
+
instance.sep = sep
|
|
554
|
+
instance.altsep = altsep
|
|
555
|
+
return instance
|
|
536
556
|
|
|
537
557
|
class PureCustomPath(pathlib.PurePath):
|
|
538
558
|
_flavour = CustomFlavour()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|