Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit ebce1081 authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

add restriction for sml smp id

parent f9a85182
No related branches found
No related tags found
No related merge requests found
......@@ -144,14 +144,14 @@ public class UIDomainService extends UIServiceBase<DBDomain, DomainRO> {
throw new BadRequestException(ErrorBusinessCode.NOT_FOUND, msg);
}
Optional<DBDomain> domainBySmlSmpId = domainDao.getDomainBySmlSmpId(data.getSmlSmpId());
Optional<DBDomain> domainBySmlSmpId = domainDao.getDomainBySmlSmpId(StringUtils.trim(data.getSmlSmpId()));
if (domainBySmlSmpId.isPresent() && !Objects.equals(domainBySmlSmpId.get().getId(), domain.getId())) {
String msg = "SMP-SML identifier must unique. The SmlSmpId [" + data.getSmlSmpId() + "] is already used by other domains!";
throw new BadRequestException(ErrorBusinessCode.NOT_FOUND, msg);
}
domain.setSmlSubdomain(data.getSmlSubdomain());
domain.setSmlSmpId(data.getSmlSmpId());
domain.setSmlSmpId(StringUtils.trim(data.getSmlSmpId()));
domain.setSmlClientKeyAlias(data.getSmlClientKeyAlias());
domain.setSmlClientCertAuth(data.isSmlClientCertAuth());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment