diff --git a/smp-angular/src/app/domain/domain-details-dialog/domain-details-dialog.component.html b/smp-angular/src/app/domain/domain-details-dialog/domain-details-dialog.component.html index 174f6fa8cc77c40bea35c3e5c4d243c124c6df61..d04934b9041353e2aba90ad033104843e7b328fa 100644 --- a/smp-angular/src/app/domain/domain-details-dialog/domain-details-dialog.component.html +++ b/smp-angular/src/app/domain/domain-details-dialog/domain-details-dialog.component.html @@ -3,11 +3,12 @@ <form [formGroup]="domainForm"> <mat-card> <mat-card-title>Domain properties</mat-card-title> - <mat-card-content > + <mat-card-content> <fieldset style="border: none;"> <mat-form-field style="width:100%"> <input matInput placeholder="Domain Code" name="domainCode" id="domainCode_id" + matTooltip="The SMP's domain code. The code is used in HTTP header 'Domain' when adding service group using the webservice API" [formControl]="domainForm.controls['domainCode']" maxlength="63" required> <mat-hint align="end">For WS API integration: the Domain property</mat-hint> <div @@ -23,9 +24,10 @@ </mat-form-field> <mat-form-field style="width:100%"> <input matInput placeholder="SML domain" + matTooltip="The domain-specific part of the SML DNS zone (e.g., ‘mydomain’ for mydomain.sml.dns.zone or leave empty for sml.dns.zone). Note: has informative value only, SML DNS zone used for publishing is based on SML configuration." name="smlSubdomain" id="smldomain_id" - [formControl]="domainForm.controls['smlSubdomain']" maxlength="63" > - <mat-hint align="end">The domain-specific part of the SML DNS zone (e.g., ‘mydomain’ for mydomain.sml.dns.zone or leave empty for sml.dns.zone). Note: informative value.</mat-hint> + [formControl]="domainForm.controls['smlSubdomain']" maxlength="63"> + <mat-hint align="end">The domain-specific part of the SML DNS zone (e.g., ‘mydomain’ for mydomain.sml.dns.zone).</mat-hint> <div *ngIf="(!editMode && domainForm.controls['smlSubdomain'].touched || editMode) && domainForm.controls['smlSubdomain'].hasError('pattern')" @@ -54,7 +56,8 @@ {{cert.alias}} ({{cert.certificateId}}) </mat-option> </mat-select> - <mat-hint align="end">Empty value will cause that ServiceMetadata response will not be signed by SMP!</mat-hint> + <mat-hint align="end">Empty value will cause that ServiceMetadata response will not be signed by SMP! + </mat-hint> </mat-form-field> </fieldset> </mat-card-content> @@ -64,7 +67,8 @@ <mat-card-content> <fieldset style="border: none;"> <mat-form-field style="width:100%"> - <input matInput placeholder="SML SMP identifier" name="smlSmpId" id="smlSMPId_id" + <input matInput placeholder="SML SMP identifier" name="smlSmpId" + id="smlSMPId_id" [formControl]="domainForm.controls['smlSmpId']" maxlength="63"> <mat-hint align="end">SMP ID used for SML</mat-hint> <div @@ -80,7 +84,8 @@ </div> </mat-form-field> - <mat-form-field style="width:100%" matTooltip="Client Certificate used for SML authentication. The SML Client-Cert http Header is also generated from the certificate"> + <mat-form-field style="width:100%" + matTooltip="Client Certificate used for SML authentication. The SML Client-Cert http Header is also generated from the certificate"> <mat-select [(value)]="selectedSMLCert" placeholder="SML ClientCert Alias" @@ -94,7 +99,8 @@ </mat-select> </mat-form-field> - <mat-form-field style="width:100%" matTooltip="SML Client-Cert http Header used for SML authentication. The header is generated from chosen SML ClientCert Alias"> + <mat-form-field style="width:100%" + matTooltip="SML Client-Cert http Header used for SML authentication. The header is generated from chosen SML ClientCert Alias"> <input matInput placeholder="SML ClientCert Header" name="Client certificate" id="smlClientHeader_id" [value]="selectedSMLCert?.blueCoatHeader" maxlength="2000" readonly="true"> </mat-form-field> diff --git a/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/ConfigurationService.java b/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/ConfigurationService.java index 523f0b3de3af23564e8d7ed540c93071ae130291..c18ebe7222d1d270f99331c89c7836bc530b86e7 100644 --- a/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/ConfigurationService.java +++ b/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/ConfigurationService.java @@ -133,8 +133,10 @@ public class ConfigurationService { return (List<String>) configurationDAO.getCachedPropertyValue(CS_PARTICIPANTS); } - public Boolean getParticipantSchemeMandatory() { - return (Boolean) configurationDAO.getCachedPropertyValue(PARTC_SCH_MANDATORY); + public boolean getParticipantSchemeMandatory() { + // not mandatory by default + Boolean value = (Boolean) configurationDAO.getCachedPropertyValue(PARTC_SCH_MANDATORY); + return value != null && value; } public boolean isProxyEnabled() { diff --git a/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/validation/ServiceGroupValidator.java b/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/validation/ServiceGroupValidator.java index 21d4154f48378562e89508c19370ac36414f98d4..21a87d8a94893789af6ee871dc6b416d4498cc35 100644 --- a/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/validation/ServiceGroupValidator.java +++ b/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/validation/ServiceGroupValidator.java @@ -15,6 +15,8 @@ package eu.europa.ec.edelivery.smp.validation; import eu.europa.ec.edelivery.smp.conversion.CaseSensitivityNormalizer; import eu.europa.ec.edelivery.smp.error.exceptions.BadRequestException; +import eu.europa.ec.edelivery.smp.logging.SMPLogger; +import eu.europa.ec.edelivery.smp.logging.SMPLoggerFactory; import eu.europa.ec.edelivery.smp.services.ConfigurationService; import eu.europa.ec.smp.api.Identifiers; import org.oasis_open.docs.bdxr.ns.smp._2016._05.ParticipantIdentifierType; @@ -33,7 +35,7 @@ import static org.springframework.util.CollectionUtils.isEmpty; */ @Component public class ServiceGroupValidator { - + private static final SMPLogger LOG = SMPLoggerFactory.getLogger(ServiceGroupValidator.class); protected final ConfigurationService configurationService; protected final CaseSensitivityNormalizer caseSensitivityNormalizer; @@ -45,9 +47,10 @@ public class ServiceGroupValidator { } public void validate(String serviceGroupId, ServiceGroup serviceGroup) { + boolean schemeMandatory = configurationService.getParticipantSchemeMandatory(); + LOG.debug("Parse service group [{}] with [{}] scheme", serviceGroupId, (schemeMandatory?"mandatory":"optional")); - final ParticipantIdentifierType participantId = caseSensitivityNormalizer.normalize( - Identifiers.asParticipantId(serviceGroupId, configurationService.getParticipantSchemeMandatory())); + final ParticipantIdentifierType participantId = caseSensitivityNormalizer.normalize(Identifiers.asParticipantId(serviceGroupId, schemeMandatory)); final ParticipantIdentifierType serviceGroupParticipantId = caseSensitivityNormalizer.normalize( serviceGroup.getParticipantIdentifier()); diff --git a/smp-webapp/src/test/java/eu/europa/ec/edelivery/smp/controllers/ServiceGroupControllerTest.java b/smp-webapp/src/test/java/eu/europa/ec/edelivery/smp/controllers/ServiceGroupControllerTest.java index f8146a5789e0fc0f5de3b6da097c2b396d451ffa..134ff9ae9a6d93a841f8674eb5ff22676cf4972d 100644 --- a/smp-webapp/src/test/java/eu/europa/ec/edelivery/smp/controllers/ServiceGroupControllerTest.java +++ b/smp-webapp/src/test/java/eu/europa/ec/edelivery/smp/controllers/ServiceGroupControllerTest.java @@ -98,7 +98,7 @@ public class ServiceGroupControllerTest { public void setup() throws IOException { forwardedHeaderTransformer.setRemoveOnly(false); configurationDao.setPropertyToDatabase(SMPPropertyEnum.EXTERNAL_TLS_AUTHENTICATION_CLIENT_CERT_HEADER_ENABLED, "true", null); - configurationDao.setPropertyToDatabase(SMPPropertyEnum.PARTC_SCH_MANDATORY, "true", null); + configurationDao.setPropertyToDatabase(SMPPropertyEnum.PARTC_SCH_MANDATORY, "false", null); X509CertificateTestUtils.reloadKeystores(); mvc = MockMvcUtils.initializeMockMvc(webAppContext); }