interfaces.py: corrections to take into account that lease cancel secrets are no longer honoured.

This commit is contained in:
david-sarah 2012-07-24 03:40:06 +00:00
parent e8240b0923
commit 5105448421

View File

@ -26,9 +26,10 @@ URIExtensionData = StringConstraint(1000)
Number = IntegerConstraint(8) # 2**(8*8) == 16EiB ~= 18e18 ~= 18 exabytes Number = IntegerConstraint(8) # 2**(8*8) == 16EiB ~= 18e18 ~= 18 exabytes
Offset = Number Offset = Number
ReadSize = int # the 'int' constraint is 2**31 == 2Gib -- large files are processed in not-so-large increments ReadSize = int # the 'int' constraint is 2**31 == 2Gib -- large files are processed in not-so-large increments
WriteEnablerSecret = Hash # used to protect mutable bucket modifications WriteEnablerSecret = Hash # used to protect mutable share modifications
LeaseRenewSecret = Hash # used to protect bucket lease renewal requests LeaseRenewSecret = Hash # used to protect lease renewal requests
LeaseCancelSecret = Hash # used to protect bucket lease cancellation requests LeaseCancelSecret = Hash # was used to protect lease cancellation requests
class RIBucketWriter(RemoteInterface): class RIBucketWriter(RemoteInterface):
""" Objects of this kind live on the server side. """ """ Objects of this kind live on the server side. """
@ -107,7 +108,9 @@ class RIStorageServer(RemoteInterface):
This secret is generated by the client and This secret is generated by the client and
stored for later comparison by the server. Each stored for later comparison by the server. Each
server is given a different secret. server is given a different secret.
@param cancel_secret: Like renew_secret, but protects bucket decref. @param cancel_secret: This no longer allows lease cancellation, but
must still be a unique value identifying the
lease. XXX stop relying on it to be unique.
@param canary: If the canary is lost before close(), the bucket is @param canary: If the canary is lost before close(), the bucket is
deleted. deleted.
@return: tuple of (alreadygot, allocated), where alreadygot is what we @return: tuple of (alreadygot, allocated), where alreadygot is what we
@ -138,8 +141,8 @@ class RIStorageServer(RemoteInterface):
For mutable shares, if the given renew_secret does not match an For mutable shares, if the given renew_secret does not match an
existing lease, IndexError will be raised with a note listing the existing lease, IndexError will be raised with a note listing the
server-nodeids on the existing leases, so leases on migrated shares server-nodeids on the existing leases, so leases on migrated shares
can be renewed or cancelled. For immutable shares, IndexError can be renewed. For immutable shares, IndexError (without the note)
(without the note) will be raised. will be raised.
""" """
return Any() return Any()
@ -188,7 +191,9 @@ class RIStorageServer(RemoteInterface):
This secret is generated by the client and This secret is generated by the client and
stored for later comparison by the server. Each stored for later comparison by the server. Each
server is given a different secret. server is given a different secret.
@param cancel_secret: Like renew_secret, but protects bucket decref. @param cancel_secret: This no longer allows lease cancellation, but
must still be a unique value identifying the
lease. XXX stop relying on it to be unique.
The 'secrets' argument is a tuple of (write_enabler, renew_secret, The 'secrets' argument is a tuple of (write_enabler, renew_secret,
cancel_secret). The first is required to perform any write. The cancel_secret). The first is required to perform any write. The