kopia lustrzana https://gitlab.com/jaywink/federation
Remove deprecated 'user.key' lookup for private key
rodzic
64b1c8c02e
commit
ccf161a5d3
|
@ -9,6 +9,7 @@
|
|||
|
||||
### Removed
|
||||
* `Post.photos` entity attribute was never used by any code and has been removed. Child entities of type `Image` are stored in the `Post._children` as before.
|
||||
* Removed deprecated user private key lookup using `user.key` in Diaspora receive processing. Passed in `user` objects must now have a `private_key` attribute.
|
||||
|
||||
## [0.12.0] - 2017-05-22
|
||||
|
||||
|
|
|
@ -78,12 +78,7 @@ class Protocol(BaseProtocol):
|
|||
return self.sender_handle, self.content
|
||||
|
||||
def _get_user_key(self, user):
|
||||
if not hasattr(self.user, "private_key") or not self.user.private_key:
|
||||
if hasattr(self.user, "key") and self.user.key:
|
||||
warnings.warn("Using `key` in user object for private key has been deprecated. Please "
|
||||
"have available `private_key` instead. Usage of `key` will be removed after 0.8.0.",
|
||||
DeprecationWarning)
|
||||
return self.user.key
|
||||
if not getattr(self.user, "private_key", None):
|
||||
raise EncryptedMessageError("Cannot decrypt private message without user key")
|
||||
return self.user.private_key
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue