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);
|
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 String SPLIT_REGEXP = "/";
|
||||||
|
|
||||||
private static final int MINIMUM_TOKENS = 2;
|
|
||||||
|
|
||||||
private static final int EMPTY_TOKEN_INDEX = 0;
|
private static final int EMPTY_TOKEN_INDEX = 0;
|
||||||
|
|
||||||
private static final int ROOT_VO_TOKEN_INDEX = EMPTY_TOKEN_INDEX + 1;
|
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);
|
logger.debug("Roles for site are: {}", roles);
|
||||||
String[] siteTokens = site.split(SPLIT_REGEXP);
|
String[] siteTokens = site.split(SPLIT_REGEXP);
|
||||||
logger.debug("Tokens are: {}", siteTokens.length);
|
logger.debug("Tokens are: {}", siteTokens.length);
|
||||||
if (siteTokens.length < MINIMUM_TOKENS) {
|
if (siteTokens.length < 2) {
|
||||||
String message = "Found " + siteTokens.length + " tokens only. Minimum should be: " + MINIMUM_TOKENS;
|
logger.debug("Skipping resource not starting with '{}'", SPLIT_REGEXP);
|
||||||
if (FAULT_TOLERANT) {
|
|
||||||
logger.warn(message);
|
|
||||||
continue;
|
continue;
|
||||||
} else {
|
|
||||||
throw new SitesMapperExecption(message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
String rootVO = siteTokens[ROOT_VO_TOKEN_INDEX];
|
String rootVO = siteTokens[ROOT_VO_TOKEN_INDEX];
|
||||||
logger.debug("Root VO is: {}", rootVO);
|
logger.debug("Root VO is: {}", rootVO);
|
||||||
|
|
Loading…
Reference in New Issue