client module¶
Secure client implementation
This is a skeleton file for you to build your secure file store client.
Fill in the methods for the class Client per the project specification.
You may add additional functions and classes as desired, as long as your Client class conforms to the specification. Be sure to test against the included functionality tests.
-
class
client.
Client
(storage_server, public_key_server, crypto_object, username)¶ Bases:
base_client.BaseClient
-
download
(name)¶ Returns the last value stored at name by the owner or anyone with whom it has been shared, or None if the file does not exist.
A secure client implementation of this method should meet all of the required properties listed in the project specification.
Parameters: name (str) – The name of the file. You can assume file names are alphanumeric (that is, they match the regex [A-Za-z0-9]+
).Returns: A string, the last value stored at name, or None if the file does not exist.
Receive a share message generated by the share method of another client with username from_username. Once this is done, the client calling this method should now be able to access the shared file under the name newname.
A secure client implementation of this method should meet all of the required properties listed in the project specification.
share
andreceive_share
work together as follows:msg = alice.share("bob", filename) bob.receive_share("alice", msg, newfilename)
-
Parameters: |
|
---|
-
revoke
(user, name)¶ Revokes user’s access to the file name.
user should not be able to observe new updated to name, and should not be able update it.
Anyone with whom user shared this file should also be revoked.
You may not send any messages during revocation.
A secure client implementation of this method should meet all of the required properties listed in the project specification.
Parameters: - user (str) – The username of the user whose access will be revoked
- name (str) – The name of the file
Share a file name with user.
A secure client implementation of this method should meet all of the required properties listed in the project specification.
share
andreceive_share
work together as follows:msg = alice.share("bob", filename) bob.receive_share("alice", msg, newfilename)