2.3.2.1. ShareFile
Implement this function:
- User.share_file(filename: str, recipient: str)
Shares the file named
filename
withrecipient
such thatrecipient
will have access tofilename
afterrecipient
callsreceive_file
. However, raises autil.DropboxError
in the following circumstances:If no file named
filename
exists.Sharing operations cannot complete due to malicious action, such as an integrity violation.
After the execution of
share_file
finishes, the user namedrecipient
must then be able to gain access to the shared file by calling thereceive_file
operation 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.