specs icon indicating copy to clipboard operation
specs copied to clipboard

Add hash of segment for validatity purposes

Open jflevesque-genetec opened this issue 2 years ago • 5 comments

This will be used to validate the integrity of the file in case there was corruption during transit or after storage. This can also help when replicating the data into different storages to ensure the integrity of the copied data, for example when using content addressable storage use cases where the hash of the file can also be its identifier.

The intent is not to validate the authenticity of the file, as anyone that can modify the file can also update the hash in the metadata. For this use case, media signing is probably a better solution.

jflevesque-genetec avatar Jan 11 '24 19:01 jflevesque-genetec

I think there need to be another value to this than just validating the data, if you have permissions to upload or change the data then you most probably have permissions to change the hash too.

ubkr avatar Feb 05 '24 16:02 ubkr

I am not unopposed to this but at what point is the Hash written? after upload of a written file or after a file that has been streaming has finished a particular segment?

Further information needed in this PR please.

kieran242 avatar Feb 06 '24 11:02 kieran242

Updated the PR's description for the use case this addresses

jflevesque-genetec avatar Feb 20 '24 18:02 jflevesque-genetec

After some more consideration I don't have an issue with adding something like a GUID to a segment. However we should avoid using a hash as this will require complete creation before upload and make uploading on the fly impossible for all time.

HansBusch avatar Feb 23 '24 15:02 HansBusch

As far as we understood the spec today, the duration field is also something that is troublesome to compute early, as you need to have the exact CMAF duration which you will get once the entire file is generated.

Also, the uploading on the fly already seems to be impossible simply due to the requirement of knowing the Content-Length before the upload. The only way to circumvent that would be multipart uploads, which then add a significant cost burden on the VMS, to the point where it will quickly make it simply non-viable to support the camera in this fashion.

jmelancondev avatar Mar 05 '24 19:03 jmelancondev