Description
There is some special logic in the SubjectSourceDiagnostics class. Instead of getting the source id directly from subject.properties, it loops through every subject property trying to match subjectApi.source.*.id values until one matches the config name. I don't understand it, other than the comment that it has to do with configName vs. sourceId. The matcher stores potential match in a variable in a higher scope, so that if nothing matches configId to sourceId, the result is the last source that matched the pattern.
The grouperExternal source in particular shows this, since it is a special source not based on properties. Since all the other sources match the id pattern but none match the source id, it ends up being a random one. This seems to only show up in the SOURCE CONFIGURATION section of the diagnostics, making it appear like an ldap or other source.
edu.internet2.middleware.grouper.grouperUi.serviceLogic.SubjectSourceDiagnostics
String sourceConfigId = null;
|
Pattern sourceIdConfigPattern = Pattern.compile("^subjectApi\\.source\\.([^.]+)\\.id$");
|
|
for (String configName : SubjectConfig.retrieveConfig().propertyNames()) {
|
|
// # generally the <configName> is the same as the source id. Generally this should not have special characters
|
// # subjectApi.source.<configName>.id = sourceId
|
|
Matcher matcher = sourceIdConfigPattern.matcher(configName);
|
if (matcher.matches()) {
|
sourceConfigId = matcher.group(1);
|
if (StringUtils.equals(sourceId, SubjectConfig.retrieveConfig().propertyValueString("subjectApi.source." + sourceConfigId + ".id"))) {
|
break;
|
}
|
}
|