flow.record 3.21.dev7__tar.gz → 3.21.dev9__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.21.dev7 → flow_record-3.21.dev9}/PKG-INFO +1 -1
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/jsonpacker.py +2 -1
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/tools/rdump.py +1 -0
- flow_record-3.21.dev9/flow/record/version.py +34 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow.record.egg-info/PKG-INFO +1 -1
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/adapter/test_sqlite_duckdb.py +2 -1
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/packer/test_json_packer.py +26 -0
- flow_record-3.21.dev7/flow/record/version.py +0 -21
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/.git-blame-ignore-revs +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/.gitattributes +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/COPYRIGHT +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/LICENSE +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/MANIFEST.in +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/README.md +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/examples/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/examples/filesystem.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/examples/passivedns.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/examples/records.json +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/examples/selectors.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/examples/tcpconn.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/archive.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/avro.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/broker.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/csvfile.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/duckdb.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/elastic.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/jsonfile.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/line.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/mongo.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/split.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/splunk.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/sqlite.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/stream.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/text.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/adapter/xlsx.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/base.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/exceptions.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/fieldtypes/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/fieldtypes/credential.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/fieldtypes/net/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/fieldtypes/net/ip.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/fieldtypes/net/ipv4.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/fieldtypes/net/tcp.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/fieldtypes/net/udp.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/packer.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/selector.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/stream.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/tools/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/tools/geoip.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/utils.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow/record/whitelist.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow.record.egg-info/SOURCES.txt +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow.record.egg-info/dependency_links.txt +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow.record.egg-info/entry_points.txt +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow.record.egg-info/requires.txt +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/flow.record.egg-info/top_level.txt +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/pyproject.toml +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/setup.cfg +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/_data/.gitkeep +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/_docs/Makefile +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/_docs/conf.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/_docs/index.rst +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/_utils.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/adapter/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/adapter/test_avro.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/adapter/test_csv.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/adapter/test_elastic.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/adapter/test_json.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/adapter/test_line.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/adapter/test_splunk.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/adapter/test_text.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/adapter/test_xlsx.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/fieldtypes/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/fieldtypes/test_fieldtypes.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/fieldtypes/test_ip.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/packer/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/packer/test_packer.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/record/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/record/test_adapter.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/record/test_descriptor.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/record/test_multi_timestamp.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/record/test_record.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/selector/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/selector/test_compiled.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/selector/test_selectors.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/test_deprecations.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/test_regressions.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/test_utils.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/tools/__init__.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tests/tools/test_rdump.py +0 -0
- {flow_record-3.21.dev7 → flow_record-3.21.dev9}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flow.record
|
|
3
|
-
Version: 3.21.
|
|
3
|
+
Version: 3.21.dev9
|
|
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
|
|
@@ -97,7 +97,8 @@ class JsonRecordPacker:
|
|
|
97
97
|
del obj["_type"]
|
|
98
98
|
for field_type, field_name in record_descriptor.get_field_tuples():
|
|
99
99
|
if field_type == "bytes":
|
|
100
|
-
|
|
100
|
+
value = obj[field_name]
|
|
101
|
+
obj[field_name] = base64.b64decode(value) if value is not None else None
|
|
101
102
|
return record_descriptor.recordType(**obj)
|
|
102
103
|
if _type == "recorddescriptor":
|
|
103
104
|
data = obj["_data"]
|
|
@@ -330,6 +330,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
330
330
|
record_writer.__exit__()
|
|
331
331
|
except Exception as e:
|
|
332
332
|
print_error(e)
|
|
333
|
+
ret = 1
|
|
333
334
|
|
|
334
335
|
if (args.list or args.stats) and not args.progress:
|
|
335
336
|
print(f"Processed {count} records", file=sys.stdout if args.list else sys.stderr)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
TYPE_CHECKING = False
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from typing import Tuple
|
|
16
|
+
from typing import Union
|
|
17
|
+
|
|
18
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
20
|
+
else:
|
|
21
|
+
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
23
|
+
|
|
24
|
+
version: str
|
|
25
|
+
__version__: str
|
|
26
|
+
__version_tuple__: VERSION_TUPLE
|
|
27
|
+
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
30
|
+
|
|
31
|
+
__version__ = version = '3.21.dev9'
|
|
32
|
+
__version_tuple__ = version_tuple = (3, 21, 'dev9')
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = 'ge2333a654'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flow.record
|
|
3
|
-
Version: 3.21.
|
|
3
|
+
Version: 3.21.dev9
|
|
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
|
|
@@ -169,11 +169,12 @@ def test_read_from_sqlite(tmp_path: Path, db: Database) -> None:
|
|
|
169
169
|
"""
|
|
170
170
|
)
|
|
171
171
|
for i in range(1, 30):
|
|
172
|
+
dt_isoformat = datetime(2023, 10, i, 13, 37, tzinfo=timezone.utc).isoformat()
|
|
172
173
|
con.execute(
|
|
173
174
|
"""
|
|
174
175
|
INSERT INTO 'test/record' VALUES (?, ?, ?, ?)
|
|
175
176
|
""",
|
|
176
|
-
(f"record{i}", f"foobar{i}".encode(),
|
|
177
|
+
(f"record{i}", f"foobar{i}".encode(), dt_isoformat, 3.14 + i),
|
|
177
178
|
)
|
|
178
179
|
|
|
179
180
|
# Read the SQLite database using flow.record
|
|
@@ -112,3 +112,29 @@ def test_record_pack_surrogateescape() -> None:
|
|
|
112
112
|
|
|
113
113
|
# pack the json string back to a record and make sure it is the same as before
|
|
114
114
|
assert packer.unpack(data) == record
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def test_json_packer_bytes_type() -> None:
|
|
118
|
+
TestRecord = RecordDescriptor(
|
|
119
|
+
"test/bytes",
|
|
120
|
+
[
|
|
121
|
+
("bytes", "data"),
|
|
122
|
+
],
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
packer = JsonRecordPacker()
|
|
126
|
+
|
|
127
|
+
record = TestRecord(b"hello world")
|
|
128
|
+
data = packer.pack(record)
|
|
129
|
+
assert data.startswith('{"data": "aGVsbG8gd29ybGQ="')
|
|
130
|
+
assert packer.unpack(data) == record
|
|
131
|
+
|
|
132
|
+
record = TestRecord(data=None)
|
|
133
|
+
data = packer.pack(record)
|
|
134
|
+
assert data.startswith('{"data": null')
|
|
135
|
+
assert packer.unpack(data) == record
|
|
136
|
+
|
|
137
|
+
record = TestRecord(data=b"")
|
|
138
|
+
data = packer.pack(record)
|
|
139
|
+
assert data.startswith('{"data": ""')
|
|
140
|
+
assert packer.unpack(data) == record
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# file generated by setuptools-scm
|
|
2
|
-
# don't change, don't track in version control
|
|
3
|
-
|
|
4
|
-
__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
|
|
5
|
-
|
|
6
|
-
TYPE_CHECKING = False
|
|
7
|
-
if TYPE_CHECKING:
|
|
8
|
-
from typing import Tuple
|
|
9
|
-
from typing import Union
|
|
10
|
-
|
|
11
|
-
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
12
|
-
else:
|
|
13
|
-
VERSION_TUPLE = object
|
|
14
|
-
|
|
15
|
-
version: str
|
|
16
|
-
__version__: str
|
|
17
|
-
__version_tuple__: VERSION_TUPLE
|
|
18
|
-
version_tuple: VERSION_TUPLE
|
|
19
|
-
|
|
20
|
-
__version__ = version = '3.21.dev7'
|
|
21
|
-
__version_tuple__ = version_tuple = (3, 21, 'dev7')
|
|
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
|
|
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
|