File tree Expand file tree Collapse file tree
app/grandchallenge/components/backends Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -818,17 +818,14 @@ def _get_task_return_code(self):
818818
819819 body = response ["Body" ].read ()
820820
821- signature_hmac_sha256 = response ["Metadata" ].get (
822- "signature_hmac_sha256"
823- )
821+ signature_hmac_sha256 = response ["Metadata" ]["signature_hmac_sha256" ]
824822 body_signature_hmac_sha256 = hmac .new (
825823 key = self ._signing_key , msg = body , digestmod = hashlib .sha256
826824 ).hexdigest ()
827825
828- if signature_hmac_sha256 and not secrets .compare_digest (
826+ if not secrets .compare_digest (
829827 body_signature_hmac_sha256 , signature_hmac_sha256
830828 ):
831- # TODO The signature should always be present when all images use sagemaker shim >= 0.5.0
832829 logger .error (
833830 "The invocation response object has been tampered with"
834831 )
You can’t perform that action at this time.
0 commit comments