2.3.2.1. ShareFile

Implement this function:

User.share_file(filename: str, recipient: str)

Shares the file named filename with recipient such that recipient will have access to filename after recipient calls receive_file. However, raises a util.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 named recipient must then be able to gain access to the shared file by calling the receive_file operation with the given filename, 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.