Add ntds cli tools and add all tools as pyproject entry points#34
Add ntds cli tools and add all tools as pyproject entry points#34Schamper merged 16 commits intofox-it:mainfrom
Conversation
|
Doesn't it make more sense to put the tool in |
|
It's another option, we will see what is preferred by the maintainers. |
|
I was thinking about the location too. Maybe And you can add a |
|
I have added console script + edited readme for all script. |
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
…se, help="output in JSON format") to all ese tools
|
I have also modified the ual/sru to support the '-j, --json output in JSON format' E.g |
dissect/database/ese/tools/sru.py
Outdated
| generator = parser.entries() | ||
| for e in generator: | ||
| if args.json: | ||
| record_as_dict = e.record.as_dict() |
There was a problem hiding this comment.
Wouldn't you now miss the serialization that happens in Entry.__repr__? Maybe add an as_dict to the Entry class.
There was a problem hiding this comment.
I have added the as_dict method. No sure to understant what you mean by 'Wouldn't you now miss the serialization that happens'.
If by miss you speak of the AppId/UserId resolution / ts conversion, this is not done in repr either, but I can add it (but maybe in another PR).
There was a problem hiding this comment.
Ah apologies, I thought serialise_record_column_values was from this file and did some value conversion (the AppId, UserId, ts stuff), but that's not the case.
this is not done in repr either, but I can add it (but maybe in another PR).
Yes I only just now noticed this. That would be appreciated and can be a separate PR. Thanks!
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 150 151 +1
Lines 4125 4155 +30
=====================================
- Misses 4125 4155 +30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add a cli tool to dump all object with a specific object class of an NTDS. This could mainly be used for testing.
E.g
Just a small point, it is a bit weird that NTDS tools is in
dissect.database.ese.ntds, and others are indissect.database.ese.tools. Maybe the ntds.py file should be moved indissect.database.ese.tools(but that would require refactoring in some other project, and this is definitely not an important problem).