Skip to content
This repository has been archived by the owner on Aug 21, 2021. It is now read-only.

Disable group syncing from crowd server #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/main/java/org/sonar/plugins/crowd/CrowdConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class CrowdConfiguration implements ServerExtension {
static final String KEY_CROWD_APP_NAME = "crowd.application";
static final String KEY_CROWD_APP_PASSWORD = "crowd.password";
static final String FALLBACK_NAME = "sonar";
static final String KEY_CROWD_GRP_SYNC = "crowd.groups.sync";
private final Settings settings;

/**
Expand Down Expand Up @@ -82,4 +83,12 @@ public String getCrowdApplicationPassword() {
public String getCrowdUrl() {
return getAndValidate(KEY_CROWD_URL, settings);
}

/**
* Define if the Groups have to be synced from the Crowd server.
* Defaults to true if not provided.
*/
public String getCrowdGrpSync() {
return get(KEY_CROWD_GRP_SYNC, settings, "true");
}
}
7 changes: 6 additions & 1 deletion src/main/java/org/sonar/plugins/crowd/CrowdRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ public LoginPasswordAuthenticator getLoginPasswordAuthenticator() {

@Override
public ExternalGroupsProvider getGroupsProvider() {
return groupsProvider;
if(this.crowdConfiguration.getCrowdGrpSync() == "true") {
LOG.debug("Sync group from Crowd enabled.");
return groupsProvider;
}
LOG.debug("Sync groups from Crowd disabled.");
return null;
}

@Override
Expand Down