diff options
author | James Moger <james.moger@gitblit.com> | 2014-07-02 16:39:47 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-07-03 17:00:40 -0400 |
commit | 241f57365649ffbbcc1923a1712ab86f6a443bc6 (patch) | |
tree | 768a2245e504bf50a9728938dc24e1106bfeb395 /src/main/java/com/gitblit/transport/ssh | |
parent | f9980ea7a6615f8bfef89fae7e6569c54bc749c3 (diff) | |
download | gitblit-241f57365649ffbbcc1923a1712ab86f6a443bc6.tar.gz gitblit-241f57365649ffbbcc1923a1712ab86f6a443bc6.zip |
Implement custom IPublicKeyManager provider
Diffstat (limited to 'src/main/java/com/gitblit/transport/ssh')
3 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/transport/ssh/FileKeyManager.java b/src/main/java/com/gitblit/transport/ssh/FileKeyManager.java index a063dc7d..1a2cd682 100644 --- a/src/main/java/com/gitblit/transport/ssh/FileKeyManager.java +++ b/src/main/java/com/gitblit/transport/ssh/FileKeyManager.java @@ -29,6 +29,7 @@ import com.gitblit.manager.IRuntimeManager; import com.google.common.base.Charsets; import com.google.common.base.Joiner; import com.google.common.io.Files; +import com.google.inject.Inject; /** * Manages public keys on the filesystem. @@ -42,6 +43,7 @@ public class FileKeyManager extends IPublicKeyManager { protected final Map<File, Long> lastModifieds; + @Inject public FileKeyManager(IRuntimeManager runtimeManager) { this.runtimeManager = runtimeManager; this.lastModifieds = new ConcurrentHashMap<File, Long>(); diff --git a/src/main/java/com/gitblit/transport/ssh/MemoryKeyManager.java b/src/main/java/com/gitblit/transport/ssh/MemoryKeyManager.java index 357b34a2..bf783786 100644 --- a/src/main/java/com/gitblit/transport/ssh/MemoryKeyManager.java +++ b/src/main/java/com/gitblit/transport/ssh/MemoryKeyManager.java @@ -20,6 +20,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.google.inject.Inject; + /** * Memory public key manager. * @@ -30,6 +32,7 @@ public class MemoryKeyManager extends IPublicKeyManager { final Map<String, List<SshKey>> keys; + @Inject public MemoryKeyManager() { keys = new HashMap<String, List<SshKey>>(); } diff --git a/src/main/java/com/gitblit/transport/ssh/NullKeyManager.java b/src/main/java/com/gitblit/transport/ssh/NullKeyManager.java index 0761d842..fcd3e197 100644 --- a/src/main/java/com/gitblit/transport/ssh/NullKeyManager.java +++ b/src/main/java/com/gitblit/transport/ssh/NullKeyManager.java @@ -17,6 +17,8 @@ package com.gitblit.transport.ssh; import java.util.List; +import com.google.inject.Inject; + /** * Rejects all public key management requests. * @@ -25,6 +27,7 @@ import java.util.List; */ public class NullKeyManager extends IPublicKeyManager { + @Inject public NullKeyManager() { } |