2.3.2.1. ShareFile
Implement this function:
- User.share_file(filename: str, recipient: str)
Shares the file named
filenamewithrecipientsuch thatrecipientwill have access tofilenameafterrecipientcallsreceive_file. However, raises autil.DropboxErrorin the following circumstances:If no file named
filenameexists.Sharing operations cannot complete due to malicious action, such as an integrity violation.
After the execution of
share_filefinishes, the user namedrecipientmust then be able to gain access to the shared file by calling thereceive_fileoperation with the givenfilename, and username of the user who shared the file.The list of users shared on a file does not have to be confidential to the adversary.
- Parameters:
filename (str) – The name of the file
recipient (str) – The user to share the file with
- Returns:
nothing
- Raises:
DropboxError – if an error case occurred
Note
As a reminder, users cannot communicate directly with each other, so your implementation must not rely on any such external communication methods.