plugin pubsub signature: fix attachment setting + default signer:
- attachment setting was crashing when `item_elt` was not specified due to argument typo - if `signer` is set to None in attachment data, client's bare jid will be used to sign the item rel 381
This commit is contained in:
parent
8cf01c8569
commit
0988c73644
1 changed files with 2 additions and 2 deletions
|
|
@ -255,7 +255,7 @@ class PubsubSigning:
|
|||
node = attachments_data["node"]
|
||||
item_id = attachments_data["id"]
|
||||
items, __ = await self._p.getItems(
|
||||
client, service, node, items_ids=[item_id]
|
||||
client, service, node, item_ids=[item_id]
|
||||
)
|
||||
if not items != 1:
|
||||
raise exceptions.NotFound(
|
||||
|
|
@ -263,7 +263,7 @@ class PubsubSigning:
|
|||
)
|
||||
item_elt = items[0]
|
||||
|
||||
signer = signature_data["signer"]
|
||||
signer = signature_data.get("signer") or client.jid.userhost()
|
||||
timestamp = time.time()
|
||||
timestamp_xmpp = utils.xmpp_date(timestamp)
|
||||
to_sign = self.get_data_to_sign(item_elt, service, timestamp, signer)
|
||||
|
|
|
|||
Loading…
Reference in a new issue