Add validation and fail early if a participant identifier is illegal - #67
Add validation and fail early if a participant identifier is illegal#67bmontuelle wants to merge 3 commits into
Conversation
|
I’m not in a position to judge whether this change is technically necessary, but I did notice a potential functional concern. The validator limits the identifier to 28 characters, while Peppol recently increased the maximum length (up to 130 characters).
This could lead to rejecting valid identifiers. Should this be aligned with the updated Peppol limits? |
6cb05b2 to
18e571c
Compare
|
@jvanbrakel good catch, I updated the code so it reflects the maximum length change in participant identifiers. |
|
Thanks for contribution @bmontuelle . I have suggestions for improvements:
Additionally validateAndWarn() is somewhat misleading because validation failures are immediately treated as fatal by the caller (PeppolParsingException / OxalisContentException). The method name suggests a non-fatal validation that only logs a warning, whereas callers actually abort processing. |
18e571c to
e9ff3cb
Compare
|
@aaron-kumar I updated to use vefa peppol-icd to validate ICDs against the official icd list and adress other feedback provided about thins PR. |
|
Hello @bmontuelle and @aaron-kumar, if you consider merging this, could you at least introduce some setting to disable the validation entirely? This change with hard failure everytime could potentially cause a breaking change especially when new jurisdiction is adopting peppol and a new schema code is introduced (for example Slovakia 0245 and Oman 0248 latest). This would lead to companies using oxalis-ng to be unable to send anything and to for example pass the required testbed in the early stages of the peppol adoption. Not everytime the required code lists changes and release of oxalis-ng are in sync with what is already published on testbed and processed by local peppol authority. Thanks |
|
Hi @vrbyjimmy this is a very serious concern, I didnt knew that participant countries were adding ICP prefixes, and using the vefa Peppol Icd static list for a hard validation would then require a dependency upgrade and rollout through an oxalis-ng release to have the new prefixes. vefa-peppol v4.5.0 Already covers
|
…refix list lag in vefa-peppol library
Pull Request Description
Validating participant ids received from SBDH so their length and other caracteristics are enforced before attempting to process the message any further.
This change is motivated because we received obviously invalid receiver participant Id that were causing failure in persistence for oxalis-ng-statistics, i.e.
Data too long for column 'receiver'Type of Pull Request
Type of Change
Pull Request Checklist:
mvn clean installbefore commit and all tests run successfullymasterbranch