diff options
author | James Moger <james.moger@gitblit.com> | 2014-03-19 08:51:17 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-04-10 18:58:09 -0400 |
commit | 13331ae61c7f08b4a202a531e005915147467bd8 (patch) | |
tree | 615fb056d77ec2951b85a0dfccd45f2912ce6ef6 /src/main/java/com/gitblit/manager | |
parent | e1dbd00bf504d8ebadeb8f3f590f16d7750aaf85 (diff) | |
download | gitblit-13331ae61c7f08b4a202a531e005915147467bd8.tar.gz gitblit-13331ae61c7f08b4a202a531e005915147467bd8.zip |
Exclude SSH repository urls from anonymous users
Diffstat (limited to 'src/main/java/com/gitblit/manager')
-rw-r--r-- | src/main/java/com/gitblit/manager/ServicesManager.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/manager/ServicesManager.java b/src/main/java/com/gitblit/manager/ServicesManager.java index 17724f2b..93121cfb 100644 --- a/src/main/java/com/gitblit/manager/ServicesManager.java +++ b/src/main/java/com/gitblit/manager/ServicesManager.java @@ -228,6 +228,10 @@ public class ServicesManager implements IManager { } public String getSshDaemonUrl(HttpServletRequest request, UserModel user, RepositoryModel repository) { + if (user == null || UserModel.ANONYMOUS.equals(user)) { + // SSH always requires authentication - anonymous access prohibited + return null; + } if (sshDaemon != null) { String bindInterface = settings.getString(Keys.git.sshBindInterface, "localhost"); if (bindInterface.equals("localhost") |