Skip to content

Commit

Permalink
Rename exportStem config param to baseStem
Browse files Browse the repository at this point in the history
Also changed connector version to 0.6.
  • Loading branch information
mederly committed Nov 25, 2019
1 parent 8d410ad commit f4a934e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</parent>

<artifactId>connector-grouper-rest</artifactId>
<version>0.5</version>
<version>0.6</version>
<packaging>jar</packaging>

<name>Grouper REST Connector</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class GroupProcessor extends Processor {
private static final String ATTR_EXTENSION = J_EXTENSION;
public static final String ATTR_MEMBER = "member";

private static final String DEFAULT_EXPORT_STEM = ":";
private static final String DEFAULT_BASE_STEM = ":";

GroupProcessor(GrouperConfiguration configuration) {
super(configuration);
Expand Down Expand Up @@ -148,12 +148,12 @@ private void getAllGroupsNoMembers(ResultsHandler handler) {
URIBuilder uriBuilder = getUriBuilderForGroups();
try {
HttpPost request = new HttpPost(uriBuilder.build());
String configuredExportStem = configuration.getExportStem();
String configuredBaseStem = configuration.getBaseStem();
JSONObject body = new JSONObject()
.put(J_WS_REST_FIND_GROUPS_REQUEST, new JSONObject()
.put(J_WS_QUERY_FILTER, new JSONObject()
.put(J_QUERY_FILTER_TYPE, VAL_FIND_BY_STEM_NAME)
.put(J_STEM_NAME, configuredExportStem != null ? configuredExportStem : DEFAULT_EXPORT_STEM)
.put(J_STEM_NAME, configuredBaseStem != null ? configuredBaseStem : DEFAULT_BASE_STEM)
.put(J_STEM_NAME_SCOPE, VAL_ALL_IN_SUBTREE)));
executeFindGroups(request, body, handler);
} catch (RuntimeException | URISyntaxException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class GrouperConfiguration extends AbstractConfiguration implements State
private GuardedString password;
private Boolean ignoreSslValidation;

private String exportStem;
private String baseStem;
private String[] groupIncludePattern;
private String[] groupExcludePattern;
private String subjectSource;
Expand Down Expand Up @@ -95,13 +95,13 @@ public void setIgnoreSslValidation(Boolean ignoreSslValidation) {
/**
* Used to specify root stem for groups returned by this connector. The default is ":" (the whole tree).
*/
@ConfigurationProperty(order = 50, displayMessageKey = "exportStem.display", helpMessageKey = "exportStem.help")
public String getExportStem() {
return exportStem;
@ConfigurationProperty(order = 50, displayMessageKey = "baseStem.display", helpMessageKey = "baseStem.help")
public String getBaseStem() {
return baseStem;
}

public void setExportStem(String exportStem) {
this.exportStem = exportStem;
public void setBaseStem(String baseStem) {
this.baseStem = baseStem;
}

/**
Expand Down Expand Up @@ -188,7 +188,7 @@ public void release() {
this.username = null;
this.password = null;
this.ignoreSslValidation = null;
this.exportStem = null;
this.baseStem = null;
this.groupIncludePattern = null;
this.groupExcludePattern = null;
this.subjectSource = null;
Expand All @@ -201,7 +201,7 @@ public String toString() {
"baseUrl='" + baseUrl + '\'' +
", username='" + username + '\'' +
", ignoreSslValidation=" + ignoreSslValidation +
", exportStem='" + exportStem + '\'' +
", baseStem='" + baseStem + '\'' +
", groupIncludePattern=" + Arrays.toString(groupIncludePattern) +
", groupExcludePattern=" + Arrays.toString(groupExcludePattern) +
", subjectSource='" + subjectSource + '\'' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ username.help=Name of the user that is used to access the Grouper REST service.
password.display=Password
password.help=Password of the user that is used to access the Grouper REST service.

exportStem.display=Root stem
exportStem.help=The stem that is to be exported (visible) to this connector. The default is ":" (the whole tree).
baseStem.display=Base stem
baseStem.help=The stem whose content is to be visible to this connector. The default is ":" (the whole tree).

groupIncludePattern.display=Groups to include
groupIncludePattern.help=Groups that should be visible to this connector. Specify them using regular expressions like "ref:.*". If nothing is specified, all groups under root stem are included.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AbstractTest {
private static final String BASE_URL = "https://192.168.56.101:9443";
private static final String ADMIN_USERNAME = TEST_USER;
private static final String ADMIN_PASSWORD = "password";
private static final String EXPORT_STEM = "etc";
private static final String BASE_STEM = "etc";
private static final String[] GROUP_INCLUDE_PATTERN = { ".*" };
private static final String[] GROUP_EXCLUDE_PATTERN = { ".*_(includes|excludes|systemOfRecord|systemOfRecordAndIncludes)" };
private static final String SUBJECT_SOURCE = "ldap";
Expand Down Expand Up @@ -69,7 +69,7 @@ GrouperConfiguration getConfiguration() {
config.setUsername(ADMIN_USERNAME);
config.setPassword(new GuardedString(ADMIN_PASSWORD.toCharArray()));
config.setIgnoreSslValidation(true);
config.setExportStem(EXPORT_STEM);
config.setBaseStem(BASE_STEM);
config.setGroupIncludePattern(GROUP_INCLUDE_PATTERN);
config.setGroupExcludePattern(GROUP_EXCLUDE_PATTERN);
config.setSubjectSource(SUBJECT_SOURCE);
Expand Down

0 comments on commit f4a934e

Please sign in to comment.