diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/gitblit/ConfigUserService.java | 7 | ||||
-rw-r--r-- | src/main/java/com/gitblit/GitBlit.java | 2 | ||||
-rw-r--r-- | src/main/java/com/gitblit/GitblitUserService.java | 3 | ||||
-rw-r--r-- | src/main/java/com/gitblit/HtpasswdUserService.java | 12 | ||||
-rw-r--r-- | src/main/java/com/gitblit/IUserService.java | 7 | ||||
-rw-r--r-- | src/main/java/com/gitblit/LdapUserService.java | 5 | ||||
-rw-r--r-- | src/main/java/com/gitblit/PAMUserService.java | 5 | ||||
-rw-r--r-- | src/main/java/com/gitblit/RedmineUserService.java | 5 | ||||
-rw-r--r-- | src/main/java/com/gitblit/SalesforceUserService.java | 5 | ||||
-rw-r--r-- | src/main/java/com/gitblit/WindowsUserService.java | 5 |
10 files changed, 26 insertions, 30 deletions
diff --git a/src/main/java/com/gitblit/ConfigUserService.java b/src/main/java/com/gitblit/ConfigUserService.java index 6b721a83..79cbdba7 100644 --- a/src/main/java/com/gitblit/ConfigUserService.java +++ b/src/main/java/com/gitblit/ConfigUserService.java @@ -35,6 +35,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory;
import com.gitblit.Constants.AccessPermission;
+import com.gitblit.manager.IRuntimeManager;
import com.gitblit.models.TeamModel;
import com.gitblit.models.UserModel;
import com.gitblit.models.UserRepositoryPreferences;
@@ -115,11 +116,11 @@ public class ConfigUserService implements IUserService { /**
* Setup the user service.
*
- * @param settings
- * @since 0.7.0
+ * @param runtimeManager
+ * @since 1.4.0
*/
@Override
- public void setup(IStoredSettings settings) {
+ public void setup(IRuntimeManager runtimeManager) {
}
/**
diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java index 8be50fb6..737167fe 100644 --- a/src/main/java/com/gitblit/GitBlit.java +++ b/src/main/java/com/gitblit/GitBlit.java @@ -611,7 +611,7 @@ public class GitBlit extends DaggerContextListener public void setUserService(IUserService userService) { logger.info("Setting up user service " + userService.toString()); this.userService = userService; - this.userService.setup(settings); + this.userService.setup(getManager(IRuntimeManager.class)); } @Override diff --git a/src/main/java/com/gitblit/GitblitUserService.java b/src/main/java/com/gitblit/GitblitUserService.java index ba4c9c5d..7278b222 100644 --- a/src/main/java/com/gitblit/GitblitUserService.java +++ b/src/main/java/com/gitblit/GitblitUserService.java @@ -59,8 +59,7 @@ public class GitblitUserService implements IUserService { }
@Override
- public void setup(IStoredSettings settings) {
- IRuntimeManager runtimeManager = GitBlit.getManager(IRuntimeManager.class);
+ public void setup(IRuntimeManager runtimeManager) {
File realmFile = runtimeManager.getFileOrFolder(Keys.realm.userService, "${baseFolder}/users.conf");
serviceImpl = createUserService(realmFile);
logger.info("GUS delegating to " + serviceImpl.toString());
diff --git a/src/main/java/com/gitblit/HtpasswdUserService.java b/src/main/java/com/gitblit/HtpasswdUserService.java index a98777b9..3b7120f0 100644 --- a/src/main/java/com/gitblit/HtpasswdUserService.java +++ b/src/main/java/com/gitblit/HtpasswdUserService.java @@ -80,6 +80,7 @@ public class HtpasswdUserService extends GitblitUserService private final boolean SUPPORT_PLAINTEXT_PWD; + private IRuntimeManager runtimeManager; private IStoredSettings settings; private File htpasswdFile; @@ -117,16 +118,16 @@ public class HtpasswdUserService extends GitblitUserService * In addition the setup tries to read and parse the htpasswd file to be used * for authentication. * - * @param settings - * @since 0.7.0 + * @param runtimeManager + * @since 1.4.0 */ @Override - public void setup(IStoredSettings settings) + public void setup(IRuntimeManager runtimeManager) { - this.settings = settings; + this.runtimeManager = runtimeManager; + this.settings = runtimeManager.getSettings(); // This is done in two steps in order to avoid calling GitBlit.getFileOrFolder(String, String) which will segfault for unit tests. - IRuntimeManager runtimeManager = GitBlit.getManager(IRuntimeManager.class); String file = settings.getString(KEY_BACKING_US, DEFAULT_BACKING_US); File realmFile = runtimeManager.getFileOrFolder(file); serviceImpl = createUserService(realmFile); @@ -293,7 +294,6 @@ public class HtpasswdUserService extends GitblitUserService if ( !file.equals(htpasswdFilePath) ) { // The htpasswd file setting changed. Rediscover the file. this.htpasswdFilePath = file; - IRuntimeManager runtimeManager = GitBlit.getManager(IRuntimeManager.class); this.htpasswdFile = runtimeManager.getFileOrFolder(file); this.htUsers.clear(); this.forceReload = true; diff --git a/src/main/java/com/gitblit/IUserService.java b/src/main/java/com/gitblit/IUserService.java index 628c1650..33f519f0 100644 --- a/src/main/java/com/gitblit/IUserService.java +++ b/src/main/java/com/gitblit/IUserService.java @@ -18,6 +18,7 @@ package com.gitblit; import java.util.Collection;
import java.util.List;
+import com.gitblit.manager.IRuntimeManager;
import com.gitblit.models.TeamModel;
import com.gitblit.models.UserModel;
@@ -35,10 +36,10 @@ public interface IUserService { * retrieve settings from gitblit.properties or the web.xml file without
* relying on the GitBlit static singleton.
*
- * @param settings
- * @since 0.7.0
+ * @param runtimeManager
+ * @since 1.4.0
*/
- void setup(IStoredSettings settings);
+ void setup(IRuntimeManager runtimeManager);
/**
* Does the user service support changes to credentials?
diff --git a/src/main/java/com/gitblit/LdapUserService.java b/src/main/java/com/gitblit/LdapUserService.java index e6951b40..5619dadd 100644 --- a/src/main/java/com/gitblit/LdapUserService.java +++ b/src/main/java/com/gitblit/LdapUserService.java @@ -81,10 +81,9 @@ public class LdapUserService extends GitblitUserService { }
@Override
- public void setup(IStoredSettings settings) {
- this.settings = settings;
+ public void setup(IRuntimeManager runtimeManager) {
+ this.settings = runtimeManager.getSettings();
String file = settings.getString(Keys.realm.ldap.backingUserService, "${baseFolder}/users.conf");
- IRuntimeManager runtimeManager = GitBlit.getManager(IRuntimeManager.class);
File realmFile = runtimeManager.getFileOrFolder(file);
serviceImpl = createUserService(realmFile);
diff --git a/src/main/java/com/gitblit/PAMUserService.java b/src/main/java/com/gitblit/PAMUserService.java index e6ab04a8..b348e64c 100644 --- a/src/main/java/com/gitblit/PAMUserService.java +++ b/src/main/java/com/gitblit/PAMUserService.java @@ -45,11 +45,10 @@ public class PAMUserService extends GitblitUserService { }
@Override
- public void setup(IStoredSettings settings) {
- this.settings = settings;
+ public void setup(IRuntimeManager runtimeManager) {
+ this.settings = runtimeManager.getSettings();
String file = settings.getString(Keys.realm.pam.backingUserService, "${baseFolder}/users.conf");
- IRuntimeManager runtimeManager = GitBlit.getManager(IRuntimeManager.class);
File realmFile = runtimeManager.getFileOrFolder(file);
serviceImpl = createUserService(realmFile);
diff --git a/src/main/java/com/gitblit/RedmineUserService.java b/src/main/java/com/gitblit/RedmineUserService.java index 1148925b..62322ebc 100644 --- a/src/main/java/com/gitblit/RedmineUserService.java +++ b/src/main/java/com/gitblit/RedmineUserService.java @@ -60,11 +60,10 @@ public class RedmineUserService extends GitblitUserService { }
@Override
- public void setup(IStoredSettings settings) {
- this.settings = settings;
+ public void setup(IRuntimeManager runtimeManager) {
+ this.settings = runtimeManager.getSettings();
String file = settings.getString(Keys.realm.redmine.backingUserService, "${baseFolder}/users.conf");
- IRuntimeManager runtimeManager = GitBlit.getManager(IRuntimeManager.class);
File realmFile = runtimeManager.getFileOrFolder(file);
serviceImpl = createUserService(realmFile);
diff --git a/src/main/java/com/gitblit/SalesforceUserService.java b/src/main/java/com/gitblit/SalesforceUserService.java index bfc96be0..0eca6c9c 100644 --- a/src/main/java/com/gitblit/SalesforceUserService.java +++ b/src/main/java/com/gitblit/SalesforceUserService.java @@ -27,12 +27,11 @@ public class SalesforceUserService extends GitblitUserService { } @Override - public void setup(IStoredSettings settings) { - this.settings = settings; + public void setup(IRuntimeManager runtimeManager) { + this.settings = runtimeManager.getSettings(); String file = settings.getString( Keys.realm.salesforce.backingUserService, "${baseFolder}/users.conf"); - IRuntimeManager runtimeManager = GitBlit.getManager(IRuntimeManager.class); File realmFile = runtimeManager.getFileOrFolder(file); serviceImpl = createUserService(realmFile); diff --git a/src/main/java/com/gitblit/WindowsUserService.java b/src/main/java/com/gitblit/WindowsUserService.java index 03d65e02..9b25efbe 100644 --- a/src/main/java/com/gitblit/WindowsUserService.java +++ b/src/main/java/com/gitblit/WindowsUserService.java @@ -53,11 +53,10 @@ public class WindowsUserService extends GitblitUserService { }
@Override
- public void setup(IStoredSettings settings) {
- this.settings = settings;
+ public void setup(IRuntimeManager runtimeManager) {
+ this.settings = runtimeManager.getSettings();
String file = settings.getString(Keys.realm.windows.backingUserService, "${baseFolder}/users.conf");
- IRuntimeManager runtimeManager = GitBlit.getManager(IRuntimeManager.class);
File realmFile = runtimeManager.getFileOrFolder(file);
serviceImpl = createUserService(realmFile);
|