@@ -112,9 +112,7 @@ public function getIncomingSignedRequest(
112112 $ this ->prepIncomingSignatureHeader ($ signedRequest );
113113 $ this ->verifyIncomingSignatureHeader ($ signedRequest );
114114 $ this ->prepEstimatedSignature ($ signedRequest , $ options ['extraSignatureHeaders ' ] ?? []);
115- $ this ->verifyIncomingRequestSignature (
116- $ signedRequest , $ signatoryManager , $ options ['ttlSignatory ' ] ?? self ::SIGNATORY_TTL
117- );
115+ $ this ->verifyIncomingRequestSignature ($ signedRequest , $ signatoryManager , $ options ['ttlSignatory ' ] ?? self ::SIGNATORY_TTL );
118116 } catch (SignatureException $ e ) {
119117 $ this ->logger ->warning (
120118 'signature could not be verified ' , [
@@ -458,7 +456,8 @@ private function verifyIncomingRequestSignature(
458456 $ this ->verifySignedRequest ($ signedRequest );
459457 } catch (InvalidKeyOriginException $ e ) {
460458 throw $ e ; // issue while requesting remote instance also means there is no 2nd try
461- } catch (SignatoryNotFoundException |SignatureException ) {
459+ } catch (SignatoryNotFoundException |SignatureException $ e ) {
460+ $ this ->logger ->warning ('signatory not found ' , ['exception ' => $ e , 'signedRequest ' => $ signedRequest ]);
462461 try {
463462 $ signatory = $ this ->getSafeRemoteSignatory ($ signatoryManager , $ signedRequest );
464463 } catch (SignatoryNotFoundException $ e ) {
@@ -724,7 +723,6 @@ private function updateKnownSignatory(ISignatory $signatory): void {
724723 case SignatoryType::FORGIVABLE :
725724 $ this ->deleteSignatory ($ knownSignatory ->getKeyId ());
726725 $ this ->insertSignatory ($ signatory );
727-
728726 return ;
729727
730728 case SignatoryType::REFRESHABLE :
@@ -734,13 +732,11 @@ private function updateKnownSignatory(ISignatory $signatory): void {
734732
735733 case SignatoryType::TRUSTED :
736734 // TODO: send notice to admin
737- throw new SignatoryConflictException ();
738- break ;
735+ throw new SignatoryConflictException ('conflict between ' . json_encode ($ signatory ) . ' ' . json_encode ($ knownSignatory ));
739736
740737 case SignatoryType::STATIC :
741738 // TODO: send warning to admin
742739 throw new SignatoryConflictException ();
743- break ;
744740 }
745741 }
746742
0 commit comments