Skip to content

Commit

Permalink
Include the inbox message format
Browse files Browse the repository at this point in the history
  • Loading branch information
silverdaz committed Oct 24, 2018
1 parent 89d7d02 commit f9806ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/connection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ The message arriving in ``v1.stableIDs`` contains:
Examples
--------

CentralEGA gets notified of an inbox upload with:

.. code-block:: json
{
"user": "john",
"filepath": "somedir/encrypted.file.c4gh",
"filesize": 123456,
"checksums": [{"type": "sha256", "checksum': "8ce5a6fd145f758c49a8e2e6028fb8654b5545f5eb27a051026f8f5e83426f76"}
}
CentralEGA could send:
.. code-block:: json
Expand Down
2 changes: 1 addition & 1 deletion lega/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def send_message(self, username, filename):
}
c = calculate(filepath, 'sha256')
if c:
msg['encrypted_integrity'] = {'algorithm': 'sha256', 'checksum': c}
msg['checksums'] = [{'type': 'sha256', 'value': c}]
# Sending
publish(msg, 'cega', 'files.inbox')

Expand Down

0 comments on commit f9806ce

Please sign in to comment.