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 edb40c4b authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

Fix identifier scheme validation

parent 9af39547
No related branches found
No related tags found
No related merge requests found
Pipeline #223052 failed
......@@ -312,10 +312,10 @@ public enum SMPPropertyEnum {
"^(LOW|MEDIUM|HIGH)$", "Allowed values are: LOW, MEDIUM, HIGH"),
ALERT_USER_UPDATED_ENABLED("smp.alert.user.updated.enabled",
"true", "Enable/disable the user creation alert",
"true", "Enable/disable the user update alert",
OPTIONAL, NOT_ENCRYPTED, NO_RESTART_NEEDED, BOOLEAN),
ALERT_USER_UPDATED_LEVEL("smp.alert.user.updated.level",
"HIGH", "User creation alert level. Values: {LOW, MEDIUM, HIGH}",
"HIGH", "User update alert level. Values: {LOW, MEDIUM, HIGH}",
OPTIONAL, NOT_ENCRYPTED, NO_RESTART_NEEDED, STRING,
"^(LOW|MEDIUM|HIGH)$", "Allowed values are: LOW, MEDIUM, HIGH"),
......
......@@ -49,7 +49,6 @@ import java.util.Collections;
import java.util.List;
import java.util.Optional;
import static eu.europa.ec.edelivery.smp.exceptions.ErrorCode.SML_INVALID_IDENTIFIER;
import static eu.europa.ec.edelivery.smp.logging.SMPLogger.SECURITY_MARKER;
import static org.apache.commons.lang3.StringUtils.*;
......@@ -136,7 +135,6 @@ public class ResourceResolverService {
Identifier resourceId = identifierService.normalizeParticipantIdentifier(domain.getDomainCode(), currentParameter);
boolean isCaseSensitive = identifierService.isResourceIdentifierCaseSensitive(resourceId, domain.getDomainCode());
// validate identifier
validateResourceIdentifier(resourceId);
DBResource resource = resolveResourceIdentifier(domain, resourceDef, resourceId, isCaseSensitive);
if (resource == null) {
// the resource must be found because if action is not "create" action nor the last parameter to be resolved
......@@ -394,13 +392,6 @@ public class ResourceResolverService {
urlPathSegment, "Subresource [" + urlPathSegment + "] does not exist for resource type [" + resourceDef.getName() + "]"));
}
public void validateResourceIdentifier(Identifier identifier) {
LOG.debug("Validate resource identifier: [{}]", identifier);
if (configurationService.getParticipantSchemeMandatory() && StringUtils.isBlank(identifier.getScheme())) {
throw new SMPRuntimeException(SML_INVALID_IDENTIFIER, identifier.getValue());
}
}
public String getUsername(UserDetails user) {
return user == null ? "Anonymous" : user.getUsername();
}
......
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