Commit ceeaab65 authored by ls1947's avatar ls1947
Browse files

add command an from parameters to authorized keys

parent d0ccb136
......@@ -18,6 +18,7 @@ import edu.kit.scc.webreg.entity.RegistryEntity;
import edu.kit.scc.webreg.entity.RegistryStatus;
import edu.kit.scc.webreg.entity.ServiceEntity;
import edu.kit.scc.webreg.entity.SshPubKeyRegistryEntity;
import edu.kit.scc.webreg.entity.SshPubKeyUsageType;
import edu.kit.scc.webreg.entity.UserEntity;
import edu.kit.scc.webreg.entity.UserLoginInfoEntity;
import edu.kit.scc.webreg.entity.UserLoginInfoStatus;
......@@ -180,6 +181,13 @@ public class SshLoginServiceImpl implements SshLoginService {
protected String buildKeyList(List<SshPubKeyRegistryEntity> regKeyList, UserEntity user) {
StringBuffer sb = new StringBuffer();
for (SshPubKeyRegistryEntity regKey : regKeyList) {
if (regKey.getUsageType().equals(SshPubKeyUsageType.COMMAND)) {
sb.append("command=");
sb.append(regKey.getCommand());
sb.append(" from=");
sb.append(regKey.getFrom());
sb.append(" ");
}
sb.append(regKey.getSshPubKey().getKeyType());
sb.append(" ");
sb.append(regKey.getSshPubKey().getEncodedKey());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment