diff options
author | James Moger <james.moger@gitblit.com> | 2014-04-10 16:57:32 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-04-10 19:01:30 -0400 |
commit | f5ca1655278d8b34a402120864a5a5c628b1c31d (patch) | |
tree | b038839868e2b800cabfe83e76d9b7927208eeda /src/main/java/com/gitblit/transport | |
parent | 521cb6022a9ee30bf3115a8dcb991aa5c7e420e3 (diff) | |
download | gitblit-f5ca1655278d8b34a402120864a5a5c628b1c31d.tar.gz gitblit-f5ca1655278d8b34a402120864a5a5c628b1c31d.zip |
Rename SSH key store on user rename
Diffstat (limited to 'src/main/java/com/gitblit/transport')
-rw-r--r-- | src/main/java/com/gitblit/transport/ssh/IPublicKeyManager.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/transport/ssh/IPublicKeyManager.java b/src/main/java/com/gitblit/transport/ssh/IPublicKeyManager.java index 0dbee637..1e74b2f0 100644 --- a/src/main/java/com/gitblit/transport/ssh/IPublicKeyManager.java +++ b/src/main/java/com/gitblit/transport/ssh/IPublicKeyManager.java @@ -79,6 +79,17 @@ public abstract class IPublicKeyManager implements IManager { return null; } + public final void renameUser(String oldName, String newName) { + List<SshKey> keys = getKeys(oldName); + if (keys == null || keys.isEmpty()) { + return; + } + removeAllKeys(oldName); + for (SshKey key : keys) { + addKey(newName, key); + } + } + protected abstract boolean isStale(String username); protected abstract List<SshKey> getKeysImpl(String username); |