Now mapping is fault tollerant to support all kind of clients
This commit is contained in:
parent
db882bd0bf
commit
faf59e9d00
|
@ -7,6 +7,8 @@ import java.util.Map;
|
||||||
|
|
||||||
public class SlashSeparatedContextMapper extends AbstractOIDCToSitesAndRolesMapper {
|
public class SlashSeparatedContextMapper extends AbstractOIDCToSitesAndRolesMapper {
|
||||||
|
|
||||||
|
private static final Boolean FAULT_TOLLERANT = 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 MINIMUM_TOKENS = 2;
|
||||||
|
@ -40,8 +42,13 @@ public class SlashSeparatedContextMapper extends AbstractOIDCToSitesAndRolesMapp
|
||||||
logger.debug("Tokens are: " + siteTokens.length);
|
logger.debug("Tokens are: " + siteTokens.length);
|
||||||
}
|
}
|
||||||
if (siteTokens.length < MINIMUM_TOKENS) {
|
if (siteTokens.length < MINIMUM_TOKENS) {
|
||||||
throw new SitesMapperExecption(
|
String message = "Found " + siteTokens.length + " tokens only. Minimum should be: " + MINIMUM_TOKENS;
|
||||||
"Found " + siteTokens.length + " tokens only. Minimum should be: " + MINIMUM_TOKENS);
|
if (FAULT_TOLLERANT) {
|
||||||
|
logger.warn(message);
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
throw new SitesMapperExecption(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
String rootVO = siteTokens[ROOT_VO_TOKEN_INDEX];
|
String rootVO = siteTokens[ROOT_VO_TOKEN_INDEX];
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
|
|
Loading…
Reference in New Issue