]> source.dussan.org Git - gitblit.git/commitdiff
Added IUserService.setup(IStoredSettings) for custom implementations.
authorJames Moger <james.moger@gitblit.com>
Wed, 28 Sep 2011 22:55:34 +0000 (18:55 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 28 Sep 2011 22:55:34 +0000 (18:55 -0400)
This allows custom implementations to store their settings alongside the
Gitblit GO or WAR settings while remaining unit-testable.

docs/00_index.mkd
docs/01_setup.mkd
docs/04_releases.mkd
src/com/gitblit/FileUserService.java
src/com/gitblit/GitBlit.java
src/com/gitblit/IUserService.java

index 0da7f742bb8a790f3d9857ff542b24685500378d..856c3eb23f50fd2fe22a82a8ff0db69290dae01d 100644 (file)
@@ -28,22 +28,7 @@ Gitblit requires a Java 6 Runtime Environment (JRE) or a Java 6 Development Kit
 \r
 **%VERSION%** ([go](http://code.google.com/p/gitblit/downloads/detail?name=%GO%)|[war](http://code.google.com/p/gitblit/downloads/detail?name=%WAR%)|[fedclient](http://code.google.com/p/gitblit/downloads/detail?name=%FEDCLIENT%)) based on [%JGIT%][jgit] &nbsp; *released %BUILDDATE%*\r
 \r
-- added: federation feature to allow gitblit instances (or gitblit federation clients) to pull repositories and, optionally, settings and accounts from other gitblit instances.  This is something like [svn-sync](http://svnbook.red-bean.com/en/1.5/svn.ref.svnsync.html) for gitblit.\r
-<br/>**New:** *federation.name =*\r
-<br/>**New:** *federation.passphrase =*\r
-<br/>**New:** *federation.allowProposals = false*\r
-<br/>**New:** *federation.proposalsFolder = proposals*\r
-<br/>**New:** *federation.defaultFrequency = 60 mins*\r
-<br/>**New:** *federation.sets =*\r
-<br/>**New:** *mail.* settings for sending emails\r
-<br/>**New:** user role *#notfederated* to prevent a user account from being pulled by a federated Gitblit instance\r
-- added: google-gson dependency\r
-- added: javamail dependency\r
-- updated: MarkdownPapers 1.1.1\r
-- updated: Wicket 1.4.18\r
-- updated: JGit 1.1.0\r
-- fixed: syndication urls for WAR deployments\r
-- fixed: authentication for zip downloads\r
+- added: IUserService.setup(IStoredSettings) for custom user service implementations\r
 \r
 issues, binaries, and sources @ [Google Code][googlecode]<br/>\r
 sources @ [Github][gitbltsrc]\r
index 91900e1e62e2b65001bd01a2b994bd2f423f7c30..125bac23d19d158b0b4fe5c54741f06071035e95 100644 (file)
@@ -171,6 +171,16 @@ Your user service class must be on Gitblit's classpath and must have a public de
 %BEGINCODE%\r
 public interface IUserService {\r
 \r
+       /**\r
+        * Setup the user service.\r
+        * \r
+        * @param settings\r
+        * @since 0.6.1\r
+        */\r
+       @Override\r
+       public void setup(IStoredSettings settings) {\r
+       }\r
+       \r
        /**\r
         * Does the user service support cookie authentication?\r
         * \r
index 3941c9f43f56ab9290bf96def1071835980a93ae..a77cfd5085ebdadc28136f4411bda28376cf3df0 100644 (file)
@@ -3,6 +3,12 @@
 ### Current Release\r
 **%VERSION%** ([go](http://code.google.com/p/gitblit/downloads/detail?name=%GO%)|[war](http://code.google.com/p/gitblit/downloads/detail?name=%WAR%)|[fedclient](http://code.google.com/p/gitblit/downloads/detail?name=%FEDCLIENT%)) based on [%JGIT%][jgit] &nbsp; *released %BUILDDATE%*\r
 \r
+- added: IUserService.setup(IStoredSettings) for custom user service implementations\r
+\r
+### Older Releases\r
+\r
+**0.6.0** ([go](http://code.google.com/p/gitblit/downloads/detail?name=gitblit-0.6.0.zip)|[war](http://code.google.com/p/gitblit/downloads/detail?name=gitblit-0.6.0.war)|[fedclient](http://code.google.com/p/gitblit/downloads/detail?name=fedclient-0.6.0.zip)) based on [JGit 1.1.0 (201109151100-r)][jgit] &nbsp; *released 2011-09-27*\r
+\r
 - added: federation feature to allow gitblit instances (or gitblit federation clients) to pull repositories and, optionally, settings and accounts from other gitblit instances.  This is something like [svn-sync](http://svnbook.red-bean.com/en/1.5/svn.ref.svnsync.html) for gitblit.\r
 <br/>**New:** *federation.name =*\r
 <br/>**New:** *federation.passphrase =*\r
@@ -20,8 +26,6 @@
 - fixed: syndication urls for WAR deployments\r
 - fixed: authentication for zip downloads\r
 \r
-### Older Releases\r
-\r
 **0.5.2** ([go](http://code.google.com/p/gitblit/downloads/detail?name=gitblit-0.5.2.zip)|[war](http://code.google.com/p/gitblit/downloads/detail?name=gitblit-0.5.2.war)) based on [JGit 1.0.0 (201106090707-r)][jgit] &nbsp; *released 2011-07-27*\r
 \r
 - fixed: active repositories with a HEAD that pointed to an empty branch caused internal errors (issue 14)\r
index 9dc800874ce1da8b28342ee24013bb49d62022ef..cae0d791538f28f397bd88b052b3cc63f2a78613 100644 (file)
@@ -52,6 +52,16 @@ public class FileUserService extends FileSettings implements IUserService {
                super(realmFile.getAbsolutePath());\r
        }\r
 \r
+       /**\r
+        * Setup the user service.\r
+        * \r
+        * @param settings\r
+        * @since 0.6.1\r
+        */\r
+       @Override\r
+       public void setup(IStoredSettings settings) {\r
+       }\r
+\r
        /**\r
         * Does the user service support cookie authentication?\r
         * \r
index f7c43a85a64efc9614c1bc086bcb6c67fc25537e..c35340ac55ca262e2a970679bd4652c69ce44661 100644 (file)
@@ -249,6 +249,7 @@ public class GitBlit implements ServletContextListener {
        public void setUserService(IUserService userService) {\r
                logger.info("Setting up user service " + userService.toString());\r
                this.userService = userService;\r
+               this.userService.setup(settings);\r
        }\r
 \r
        /**\r
index 426d38c01dc40495b42bcfa7ab460d81f0a467b7..a85c997f2be6e594074e2dcf1a81c1339a7f7a0f 100644 (file)
@@ -28,6 +28,16 @@ import com.gitblit.models.UserModel;
  */\r
 public interface IUserService {\r
 \r
+       /**\r
+        * Setup the user service. This method allows custom implementations to\r
+        * retrieve settings from gitblit.properties or the web.xml file without\r
+        * relying on the GitBlit static singleton.\r
+        * \r
+        * @param settings\r
+        * @since 0.6.1\r
+        */\r
+       void setup(IStoredSettings settings);\r
+\r
        /**\r
         * Does the user service support cookie authentication?\r
         * \r