Simply ignoring resources that not start with slash ('/') and removed warn level log for it.
This commit is contained in:
parent
1e48c3ce03
commit
c75eb8af91
|
@ -12,12 +12,8 @@ public class SlashSeparatedContextMapper extends AbstractOIDCToSitesAndRolesMapp
|
|||
|
||||
protected static final Logger logger = LoggerFactory.getLogger(SlashSeparatedContextMapper.class);
|
||||
|
||||
private static final Boolean FAULT_TOLERANT = Boolean.TRUE;
|
||||
|
||||
private static final String SPLIT_REGEXP = "/";
|
||||
|
||||
private static final int MINIMUM_TOKENS = 2;
|
||||
|
||||
private static final int EMPTY_TOKEN_INDEX = 0;
|
||||
|
||||
private static final int ROOT_VO_TOKEN_INDEX = EMPTY_TOKEN_INDEX + 1;
|
||||
|
@ -42,14 +38,9 @@ public class SlashSeparatedContextMapper extends AbstractOIDCToSitesAndRolesMapp
|
|||
logger.debug("Roles for site are: {}", roles);
|
||||
String[] siteTokens = site.split(SPLIT_REGEXP);
|
||||
logger.debug("Tokens are: {}", siteTokens.length);
|
||||
if (siteTokens.length < MINIMUM_TOKENS) {
|
||||
String message = "Found " + siteTokens.length + " tokens only. Minimum should be: " + MINIMUM_TOKENS;
|
||||
if (FAULT_TOLERANT) {
|
||||
logger.warn(message);
|
||||
continue;
|
||||
} else {
|
||||
throw new SitesMapperExecption(message);
|
||||
}
|
||||
if (siteTokens.length < 2) {
|
||||
logger.debug("Skipping resource not starting with '{}'", SPLIT_REGEXP);
|
||||
continue;
|
||||
}
|
||||
String rootVO = siteTokens[ROOT_VO_TOKEN_INDEX];
|
||||
logger.debug("Root VO is: {}", rootVO);
|
||||
|
|
Loading…
Reference in New Issue