phax / phase4

phase4 - AS4 client and server for integration into existing systems. Specific support for Peppol and CEF eDelivery built-in.
Apache License 2.0
154 stars 47 forks source link

IAS4SignalMessageConsumer: Add possibility to validate the signal (Signature) #177

Closed phax closed 12 months ago

phax commented 1 year ago

Discussed in https://github.com/phax/phase4/discussions/176

Originally posted by **sopgreg** October 10, 2023 Similiar to https://github.com/phax/phase4/issues/162, it would be helpful to have a possibility to validate the Signal/Receipt received on the outgoing side, e.g. through the `SignalMessageConsumer` Right now, the signature of `IAS4SignalMessageConsumer#handleSignalMessage` looks like this: `void handleSignalMessage (@Nonnull Ebms3SignalMessage aSignalMsg) throws Phase4Exception;` If the signature looked like this, it would be possible to check the message state for `isSoapSignatureChecked`/`isSoapDecrypted`: `void handleSignalMessage (@Nonnull Ebms3SignalMessage aSignalMsg, @Nonnull IAS4MessageState state) throws Phase4Exception;` Technically, this should be possible quite easily by changing the result of `com.helger.phase4.servlet.AS4IncomingHandler#parseSignalMessage` to return both the `Ebms3SignalMessage` and the `IAS4MessageState` and return this to the `SignalMessageConsumer`. Looking forward to reading your opinion in this requirement.
phax commented 12 months ago

Part of the 2.5.0 release

sopgreg commented 12 months ago

Thanks. I looked into the commit - you included the IAS4IncomingMessageMetadata into the interface method. But the IAS4MessageState is not included there.

Is this an oversight or did I miss something?

phax commented 12 months ago

My mistake - I mixed up the interfaces ;-) I add that one as well.

phax commented 12 months ago

@sopgreg hope that suits you now :)

sopgreg commented 12 months ago

Seems fine, we will have a look at it. Thanks! :)