Send rejection response for out-of-scope GOPACS flex messages#49
Merged
Conversation
The GOPACS UFTP manual requires the AGR to always answer a FlexRequest or FlexOrder with a response message. Out-of-scope congestion points were silently dropped, leaving the DSO conversation without a reply. Now a FlexRequestResponse/FlexOrderResponse with Result=Rejected and a rejection reason is sent, while asset mutation and the FlexOffer are still skipped.
igorrutka
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes openremote/denhaag#178
Problem
GOPACSHandler.processRawMessagesilently dropped validly-signed flex messages whose congestion point is outside the contracted EAN: the transport call returned HTTP 200 but no UFTP response message was ever sent, leaving the DSO's conversation without a reply.The GOPACS manual Use own UFTP implementation for handling CSC and ATR calls (Chapter 5, steps 3 and 7) requires the AGR to always answer a FlexRequest/FlexOrder with a FlexRequestResponse/FlexOrderResponse, and to reject it when it does not meet the contract terms — which an out-of-scope congestion point is.
Change
Result=Rejected,RejectionReason="CongestionPoint not within contracted scope"), built with shapeshifter'sUftpValidationResponseCreator(the same factory the library uses for the accepted path) and sent through the existing outgoing-message path with the usual response delay so the HTTP 200 goes out first.Note: an incoming out-of-scope FlexOffer would map to a FlexOfferResponse, which
notifyNewOutgoingMessagedoes not send — irrelevant in practice since as AGR we never receive FlexOffers. Full per-contract/role scoping remains tracked in #28.