-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Stefan Bischof <[email protected]>
- Loading branch information
Showing
7 changed files
with
106 additions
and
15 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
biz.aQute.shell.sshd.provider/src/main/java/biz/aQute/shell/sshd/config/Config.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package biz.aQute.shell.sshd.config; | ||
|
||
public interface Config { | ||
|
||
static String banner = "aQute ssh, welcome!"; | ||
int getPort(); | ||
|
||
String getHost(); | ||
|
||
String getKeyPath(); | ||
|
||
String getWelcomeBanner(); | ||
|
||
static Config toConfig(SshdConfigInsecure config) { | ||
return new Config() { | ||
|
||
@Override | ||
public int getPort() { | ||
return config.port(); | ||
} | ||
|
||
@Override | ||
public String getKeyPath() { | ||
return config.hostkey(); | ||
} | ||
|
||
@Override | ||
public String getHost() { | ||
|
||
return "localhost"; | ||
} | ||
|
||
@Override | ||
public String getWelcomeBanner() { | ||
return config.welcomeBanner(); | ||
} | ||
}; | ||
} | ||
|
||
static Config toConfig(SshdConfig config) { | ||
return new Config() { | ||
|
||
@Override | ||
public int getPort() { | ||
return config.port(); | ||
} | ||
|
||
@Override | ||
public String getKeyPath() { | ||
return config.hostkey(); | ||
} | ||
|
||
@Override | ||
public String getHost() { | ||
|
||
return config.address(); | ||
} | ||
|
||
@Override | ||
public String getWelcomeBanner() { | ||
return config.welcomeBanner(); | ||
} | ||
}; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters