plakar
plakar copied to clipboard
Include errors in API endpoints listing files
To list files and errors, we currently have two API endpoints.
/api/snapshot/vfs/errors/:
Example response (truncated):
{
"total": 10,
"items": [
{
"version": 65536,
"name": "/private/etc/aliases.db",
"error": "xattr.list /private/etc/aliases.db: permission denied"
},
{
"version": 65536,
"name": "/private/etc/cups/certs",
"error": "xattr.list /private/etc/cups/certs: permission denied"
},
}
/api/snapshot/vfs/children/:
Example response (truncated):
{
"total": 72,
"items": [
{
"version": 65536,
"parent_path": "/private/etc",
"file_info": {
"name": "..",
"size": 192,
"mode": 2147484141,
"mod_time": "2025-05-15T16:29:20.761451458+02:00",
"dev": 16777233,
"ino": 160943205,
"uid": 0,
"gid": 0,
"nlink": 6,
"username": "",
"groupname": "",
"flags": 0
},
"summary": {
"directory": {
"directories": 1,
"files": 0,
"symlinks": 0,
"devices": 0,
"pipes": 0,
"sockets": 0,
"children": 1,
"setuid": 0,
"setgid": 0,
"sticky": 0,
"objects": 0,
"chunks": 0,
"min_size": 0,
"max_size": 0,
"avg_size": 0,
"size": 0,
"min_mod_time": 0,
"max_mod_time": 0,
"min_entropy": 0,
"max_entropy": 0,
"sum_entropy": 0,
"avg_entropy": 0,
"hi_entropy": 0,
"lo_entropy": 0,
"MIME_audio": 0,
"MIME_video": 0,
"MIME_image": 0,
"MIME_text": 0,
"MIME_application": 0,
"MIME_other": 0,
"errors": 0
},
"below": {
"directories": 30,
"files": 215,
"symlinks": 3,
"devices": 0,
"pipes": 0,
"sockets": 0,
"children": 248,
"setuid": 0,
"setgid": 0,
"sticky": 0,
"objects": 215,
"chunks": 232,
"min_size": 255,
"max_size": 678260,
"size": 3088736,
"min_mod_time": 1639477935,
"max_mod_time": 1749661883,
"min_entropy": 4.716025318033474,
"max_entropy": 5.883134022174937,
"hi_entropy": 0,
"lo_entropy": 8,
"MIME_audio": 0,
"MIME_video": 0,
"MIME_image": 0,
"MIME_text": 215,
"MIME_application": 0,
"MIME_other": 0,
"errors": 10
}
},
"alternate_data_streams": [],
"security_descriptor": "",
"file_attributes": 0,
"extended_attributes": [],
"classifications": [],
"custom_metadata": [],
"tags": [],
"mac": "c187af8ba97350b864ef21f1a95435ee452df8640a5ddc3f3eb9477581b159d6"
},
{
"version": 65536,
"parent_path": "/private/etc",
"file_info": {
"name": "afpovertcp.cfg",
"size": 515,
"mode": 420,
"mod_time": "2025-05-04T07:39:22+02:00",
"dev": 16777233,
"ino": 160943618,
"uid": 0,
"gid": 0,
"nlink": 1,
"username": "root",
"groupname": "",
"flags": 0
},
"object": {
"version": 65536,
"contentMAC": "403175a3bd1c80ce2126327c974e4b71d7f7dd8cbacca35697611f7367b59ea1",
"content_type": "text/plain; charset=utf-8",
"entropy": 4.791316206735133,
"flags": 0
},
"alternate_data_streams": [],
"security_descriptor": "",
"file_attributes": 0,
"extended_attributes": [],
"classifications": [],
"custom_metadata": [],
"tags": [],
"mac": "9358bbaa611ca6b7821e10ee122746472b73ffc1378a0e403a32c4cf3f1f5393"
},
We would like to remove the endpoint /errors, and update the endpoint /children to include the errors. It should be possible to add a filter to get only the errors, or only the items without the errors.
Pagination should still work.
Similarly, the endpoint /api/snapshot/vfs/search/ should also be updated to return the errors.
Ref #1255 Ref #1268