5.6. User.CreateInvitation: Create a secure file share invitation¶
-
CreateInvitation
(filename string, recipientUsername string) (invitationPtr UUID, err error)¶ Given a
filename
in the personal namespace of the caller, this function creates a secure file share invitation that contains all of the information required forrecipientUsername
to take the actions detailed in Sharing and Revoking #1 on the corresponding file.The returned
invitationPtr
must be the UUID storage key at which the secure file share invitation is stored in the Datastore.You should assume that, after this function is called, the recipient receives a notification via a secure communication channel that is separate from your client. This notification includes the
invitationPtr
and the username of the caller who created the invitation.Note that the first parameter to the StoreFile(), LoadFile(), and AppendToFile() functions in the client API is a filename in the caller’s personal namespace. The recipient will not have a name for the shared file in their personal namespace until they accept the invitation by calling AcceptInvitation().
You may assume this function will not be called on a recipient who is already currently authorized to access the file (see Sharing and Revoking).
Returns an error if:
the given
filename
does not exist in the caller’s personal file namespace; orthe given
recipientUsername
does not exist; orsharing cannot complete due to any malicious action.
- Parameters
filename (string) – The name of the file to share with the recipient.
recipient – The username of the user with whom the file should be shared.
- Return type
UUID, error
Warning
Do not forget that your design must satisfy all requirements, including:
All Sharing and Revoking requirements.