Notifications¶
The messages sent by the OpenSSH hooks capture when a file is (re)uploaded, renamed or removed.
The body of the messages is JSON formatted as:
For a file upload:
{
'user': <str>,
'filepath': <str>,
'operation': "upload",
'filesize': <num>,
'file_last_modified': <num>, // a UNIX timestamp
'encrypted_checksums': [{ 'type': <str>, 'value': <checksum as HEX> },
{ 'type': <str>, 'value': <checksum as HEX> },
...
]
}
The checksum algorithm type is ‘md5’, or ‘sha256’. ‘sha256’ is preferred.
For a file removal:
{
'user': <str>,
'filepath': <str>,
'operation': "remove",
}
For a file renaming:
{
'user': <str>,
'filepath': <str>,
'oldpath': <str>,
'operation': "rename",
}
The message headers include:
- a content type:
application/json
- delivery mode: 2 (for persistence)
- and a correlation id.
The correlation id is a uuid of 37 characters, generated by uuid_generate.