commit | author | age
|
b53611
|
1 |
/* |
JM |
2 |
* Copyright 2014 gitblit.com. |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
|
5 |
* use this file except in compliance with the License. You may obtain a copy of |
|
6 |
* the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
|
12 |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
|
13 |
* License for the specific language governing permissions and limitations under |
|
14 |
* the License. |
|
15 |
*/ |
|
16 |
package com.gitblit.transport.ssh; |
|
17 |
|
|
18 |
import java.util.List; |
|
19 |
|
|
20 |
/** |
245836
|
21 |
* Rejects all public key management requests. |
aaecd8
|
22 |
* |
b53611
|
23 |
* @author James Moger |
JM |
24 |
* |
|
25 |
*/ |
245836
|
26 |
public class NullKeyManager extends IPublicKeyManager { |
b53611
|
27 |
|
JM |
28 |
public NullKeyManager() { |
|
29 |
} |
aaecd8
|
30 |
|
b53611
|
31 |
@Override |
JM |
32 |
public String toString() { |
|
33 |
return getClass().getSimpleName(); |
|
34 |
} |
|
35 |
|
|
36 |
@Override |
|
37 |
public NullKeyManager start() { |
245836
|
38 |
log.info(toString()); |
b53611
|
39 |
return this; |
JM |
40 |
} |
aaecd8
|
41 |
|
b53611
|
42 |
@Override |
JM |
43 |
public boolean isReady() { |
|
44 |
return true; |
|
45 |
} |
aaecd8
|
46 |
|
b53611
|
47 |
@Override |
JM |
48 |
public NullKeyManager stop() { |
|
49 |
return this; |
|
50 |
} |
|
51 |
|
|
52 |
@Override |
aaecd8
|
53 |
protected boolean isStale(String username) { |
JM |
54 |
return false; |
|
55 |
} |
|
56 |
|
|
57 |
@Override |
bcc8a0
|
58 |
protected List<SshKey> getKeysImpl(String username) { |
b53611
|
59 |
return null; |
JM |
60 |
} |
|
61 |
|
|
62 |
@Override |
bcc8a0
|
63 |
public boolean addKey(String username, SshKey key) { |
b53611
|
64 |
return false; |
JM |
65 |
} |
aaecd8
|
66 |
|
b53611
|
67 |
@Override |
bcc8a0
|
68 |
public boolean removeKey(String username, SshKey key) { |
b53611
|
69 |
return false; |
JM |
70 |
} |
5eafd9
|
71 |
|
DO |
72 |
@Override |
8ee7c8
|
73 |
public boolean removeAllKeys(String username) { |
5eafd9
|
74 |
return false; |
DO |
75 |
} |
b53611
|
76 |
} |