- Updated to ph-commons 12.5.0, ph-schedule 6.2.0, ph-web 11.4.6, ph-oton-bootstrap5 0.9.5, peppol-commons 13.0.0, peppol-shared-ui 0.11.0, phoss-directory 0.19.0, Flyway 13.7.0, the MongoDB driver 5.12.0, protobuf 4.36.2 and Jackson 3.2.3
- peppol-commons 13.0.0 moved the network neutral base types of the Peppol libraries into separate submodules, so that Peppol, OASIS BDXR, DBNAlliance and HR eDelivery share them instead of every network carrying its own copy.
Nothing changes for a running SMP installation, and no configuration property and no REST API is affected, but the public API of phoss-SMP moved along with it.
That is relevant if you maintain a custom backend or a fork, because the transport profile manager is one of the managers that a backend has to provide:ISMPTransportProfile,SMPTransportProfileandESMPTransportProfileStatemoved fromcom.helger.peppol.smptocom.helger.edelivery.smp, soISMPTransportProfileManager,SMPTransportProfileManagerXML,SMPTransportProfileManagerJDBC,SMPTransportProfileManagerMongoDB,SMPTransportProfileCacheandHCSMPTransportProfileSelectnow use the new types in their signaturesESMPAPITypemoved fromcom.helger.peppol.smltocom.helger.edelivery.smp, soESMPRESTType.getAPIType ()returns the new typeEPeppolCodeListItemStatewas renamed toECodeListItemStateand moved fromcom.helger.peppolid.peppoltocom.helger.peppolid.codelist- it is used bySMPNiceNameUIto render the state of a transport profile- The DNS based URL providers moved from
com.helger.smpclient.urltocom.helger.smpclient.url.dns, andIPeppolURLProvideris deprecated in favour ofIBDXLURLProvider, so the Check DNS state action of the Service Groups page only distinguishesIBDXLURLProvidernow. Both providers that can be active -PeppolNaptrURLProviderforsmp.rest.type = peppolandBDXLURLProviderfor the OASIS BDXR types - implement it, so the behaviour is unchanged SMPExtensionList.getAsPeppolExtension ()was removed, so the conversion of an SMP extension into the Peppol SMP v1 data model now goes throughPeppolSMPExtensionHelper.getAsPeppolExtension (...). The OASIS BDXR SMP v1 and v2 conversions are unchanged
- The NAPTR lookups of the Check DNS state action of the Service Groups page and of the Remote Query API are faster for participants that are not registered in the SML:
- peppol-commons 13.0.0 performs the lookup with an absolute DNS name, so that the
searchdomains of the operating system resolver configuration are no longer appended to it. Previously an unresolvable participant caused one additional DNS query persearchentry, each of which could run into the full DNS timeout - ph-web 11.4.6 only retries a lookup via TCP if the UDP lookup ended in a transient failure, instead of also retrying the definitive answers
HOST_NOT_FOUNDandTYPE_NOT_FOUND- that previously doubled the runtime of every unresolvable lookup - ph-web 11.4.6 additionally applies the configured DNS timeout to the single resolvers inside the
ExtendedResolver, and gives each of them a smaller timeout than the overall lookup, so that a second configured DNS server is actually tried. Previously the overall timeout was already used up when the first server timed out
- peppol-commons 13.0.0 performs the lookup with an absolute DNS name, so that the
- The WAR files are roughly 2.6 MB smaller than in v8.4.3, mostly because BouncyCastle 1.86 - that comes with ph-commons 12.5.0 - is about 3 MB smaller than 1.85.2.
The module split of peppol-commons 13.0.0 itself is size neutral for phoss-SMP: the Mozilla NSS root certificates that leftpeppol-commonssave 160 KB, but the OASIS BDXR identifiers that phoss-SMP needs now arrive in the separatebdxr-idandedelivery-idJARs - The configuration property
webapp.security.login.errordetailsnow defaults tofalse, so that a failed login in the management GUI shows the same generic error message, no matter whether the login name is unknown, the password is wrong, or the user is deleted, disabled or lacks the required role.
Previously it defaulted totruefor backwards compatibility, which allowed an unauthenticated user to find out whether a specific user exists.
Set the property totrueexplicitly to get the previous behaviour back on a development or a troubleshooting installation.
The detailed reason is still written to the audit log, so it stays available under Administration / Audit.
See #564 - thx @RetarusEDI. - The session cookie (
JSESSIONID) now usesSameSite=Strictby default, so that a browser does not send it on cross-site requests.
The value is configurable with the new configuration propertywebapp.session.cookie.samesite, that acceptsStrict,LaxandNone- an empty value leaves the attribute untouched, so that only theweb.xmlor the application server determine it.
Because ofStrict, following a link from an external page into the management GUI now leads to the login page, as the session cookie is not sent with that request.
IfNoneis used, the cookie must be marked asSecureas well, otherwise browsers reject it - a warning is logged on startup in that case.
See #565. - The session cookie (
JSESSIONID) can now be marked with theSecureflag, so that a browser only sends it via https, using the new configuration propertywebapp.session.cookie.secure.
Possible values aretrue,falseandauto, withautobeing the default: it enables the flag, ifsmp.publicurlis anhttpsURL, and leaves it untouched otherwise, so that installations that are only reachable via plain http - like a local development instance - keep working without any change.
Only the explicit valuestrueandfalseoverrule an existing setting from theweb.xmlor from the application server.
The flag is set on startup, before theServletContextis initialized, because the session cookie configuration is immutable afterwards.
See #563. - (MongoDB) Added the indexes that were missing on the hot paths, as the counterpart of the SQL migration
V38.
They are created on startup, like all the other MongoDB indexes:dtonsmp-audit, which grows unbounded and is only ever read sorted by date, so that reading it no longer needs a collection scan with an in-memory sort;sgid, doctypeidonsmp-serviceinfoand onsmp-redirectfor the Service Metadata lookup of the REST API, which is the most frequent query of an SMP at all;owneridonsmp-servicegroupfor the listing of the Service Groups of a single owner;emailonusersfor the login; andtokens.tokenonuser-tokensfor the resolution of a Bearer token, which happens on every token authenticated REST request.
Onsmp-redirectandsmp-serviceinfothe Document Type is part of the index, so that the lookup by Service Group alone - used when a Service Group is deleted - can use it as well.
The first startup after the upgrade can take noticeably longer if the audit collection is large, because the index is built then. - The Service Group select boxes of the pages Endpoints, Redirects, Business Cards and Participant Migration (outbound) now load their entries on demand via Ajax, in chunks of 25 entries, instead of rendering every Service Group into the HTML.
On an SMP with many Service Groups the affected pages took very long to load, or froze the browser altogether, because select2 had to ingest one<option>per Service Group on initialisation.
The entries are now queried, searched, sorted and paged by the backend, using the new methodsgetAllSMPServiceGroups (ESMPServiceGroupFilter, IPagingSpec, String),getSMPServiceGroupCount (ESMPServiceGroupFilter, String)andcontainsAnySMPServiceGroup (ESMPServiceGroupFilter)ofISMPServiceGroupManager.
The newESMPServiceGroupFilterexpresses the page specific filters - "has no Business Card" and "has no Participant Migration that prevents a new one" - as part of the backend query, with aNOT EXISTSsub select for SQL and a$lookupfor MongoDB, so that they no longer need to read the whole table.
(MongoDB) Two indexes are created for that on startup:sgidon the collectionsmp-businesscard, andpidas well asdirection, stateon the collectionsmp-participant-migration.
The create forms now open on "(please select)" instead of silently preselecting the first Service Group.
The classHCServiceGroupSelectis now a factory with the single methodcreateAjax (...); the previous methodcreate (...)and the eager select box were removed.
Based on #548 - thx @vrbyjimmy.
See #546. - (SQL) Added the new database migration
V38that creates the indexes that were missing on the hot paths, for MySQL, PostgreSQL, Oracle, DB2 and SQL Server.
Created in all dialects areIX_smp_endpoint_tprofileonsmp_endpoint (transportProfile)for the transport profile usage check,IX_smp_pmigration_dir_stateonsmp_pmigration (direction, state)andIX_smp_pmigration_pidonsmp_pmigration (pid)for the listing and the deletion of participant migrations,IX_smp_audit_dtonsmp_audit (dt)andIX_smp_audit_useridonsmp_audit (userid)for the audit list, which is ordered by date and filtered by user and which grows unbounded, andIX_smp_secusertoken_useridonsmp_secusertoken (userid)for the resolution of a user token to its user.
IX_smp_secuser_emailonsmp_secuser (email)is created for all dialects except DB2 and SQL Server,IX_smp_ownership_usernameonsmp_ownership (username)for all except MySQL,IX_smp_secuser_loginnameonsmp_secuser (loginname)for MySQL, PostgreSQL and Oracle,IX_smp_smr_participantonsmp_service_metadata_red (businessIdentifierScheme, businessIdentifier)for PostgreSQL, DB2 and SQL Server, andIX_smp_bce_pidonsmp_bce (pid)for PostgreSQL and Oracle - the remaining dialects already have these indexes sinceV1respectivelyV8.
On MySQL the columnsloginnameandemailare of typeTEXT, so they are indexed by their first 191 characters.
The indexes are created unconditionally - if you already created one of them manually, drop it before starting, because the migration fails otherwise.
Based on #554 - thx @ismailbennani. - (SQL) Fixed the counting of the Business Cards on MySQL, which failed with a syntax error because the statement used
COUNT (DISTINCT pid), with a blank between the name of the function and the opening parenthesis.
MySQL only accepts that blank if the SQL modeIGNORE_SPACEis enabled, which is not the default.
The query therefore returned -1 on MySQL, so that the Business Cards page showed a wrong total number of entries, and the button Publish all Business Cards to the Directory was permanently disabled, because it is only enabled if the total count is positive.
MySQL installations are affected since v8.4.0, because the server side pagination introduced there is what started to call the counting method.
Based on #559 - thx @vrbyjimmy. - (SQL) A new block of IDs is now reserved atomically, so that several SMP instances sharing one database can no longer hand out the same IDs.
Previously the counter stored in thesmp_settingsentrylatest-idwas read with a plainSELECTand written back with an absoluteUPDATE, without any locking, so that two instances reading the counter at the same time reserved the identical block of 20 IDs.
The lock of the ID factory only serializes the threads of a single JVM and can not help across instances.
Affected were all IDs taken from the global ID factory - among them the business card entities, contacts and identifiers, the participant migrations and the SML information - which either ran into a primary key violation or overwrote an existing row.
The new counter value is now written with a conditionalUPDATEthat only matches if the stored value is still the one that was read, and the whole reservation is retried in a new transaction if another instance was faster.
Additionally a failed reservation now leads to an exception, instead of silently handing out the IDs of a block that was never persisted. - Added the new REST API
PUT /{ServiceGroupId}/services/{DocumentTypeId}/{ProcessId}that adds a single Endpoint to the referenced Process, as the additive counterpart ofPUT /{ServiceGroupId}/services/{DocumentTypeId}, which overwrites all existing Processes and Endpoints of a Document Type.
The expected body is a singleEndpointelement, in the flavour of the configuredsmp.rest.type. The Service Information and the Process are created on the fly if they do not exist yet, so a Document Type can be built up Endpoint by Endpoint without ever reading and re-PUTing the whole Service Metadata.
An Endpoint whose validity period overlaps that of an already existing Endpoint of the same Transport Profile is rejected with400, so the call can never silently replace an existing Endpoint. Redirects are not touched by this call.
The new method issaveServiceRegistrationEndpoint (String, String, String, EndpointType, SMPAPICredentials)ofSMPServerAPI,BDXR1ServerAPIandBDXR2ServerAPI.
The body is read with the new marshallersSmpEndpointMarshaller,Bdxr1EndpointMarshallerandBdxr2EndpointMarshallerof the new packagecom.helger.phoss.smp.jaxb. The Peppol SMP and the OASIS BDXR SMP v1 XSD declare no globalEndpointelement, so for these two the body is read without XML Schema validation and the name of the root element is checked explicitly instead - the OASIS BDXR SMP v2 Aggregate Components XSD does declare one, so there the body is validated against the schema.
What's Changed
- Fixed mysql select count for smp_bce by @vrbyjimmy in #559
- Add the missing indexes on the hot paths, for all database systems by @ismailbennani in #554
- Ajax loading of service groups in secure section redirects, endpoints… by @vrbyjimmy in #548
- Include the cause message in SMPSMLException by @rgruendlervrtx in #568
New Contributors
- @ismailbennani made their first contribution in #554
- @rgruendlervrtx made their first contribution in #568
Full Changelog: phoss-smp-parent-pom-8.4.3...phoss-smp-parent-pom-8.5.0