2.3.2.2. ReceiveFile
Implement this function:
- User.receive_file(filename: str, sender: str)
Accepts a
filename
that was shared by the user with usernamesender
for the calling user viashare_file
. However, raises autil.DropboxError
in the following circumstances:If a file with the same
filename
already exists for the calling user.File receiving cannot complete due to malicious action, such as an integrity violation.
Once the calling user has accepted the shared file, the calling user must have the ability to call
download_file
,upload_file
,append_file
, onfilename
as if the file was owned by therecipient
until their access tofilename
has been revoked via a validrevoke_file
operation.Note
From the perspective of the security definitions, the above paragraph means that any actions taken by the calling user on
filename
should be regarded as confidentiality-preserving (the calling user is allowed to view the latest state offilename
) and integrity-preserving (any changes made by the calling user tofilename
usingdownload_file
,upload_file
, andappend_file
must not result in integrity violations) up until the point at which the calling user’s access tofilename
is revoked.- Parameters:
filename (str) – The name of the file
sender (str) – The username of the user who shared the file
- Returns:
nothing
- Raises:
DropboxError – if an error case occurred