-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
executable bndrun #16
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I disagree with this change. As I commented, passing the configuration properties to the working class is done explicitly. Look at how you need to introduce a new interface and a conversion method. You introduce complexity for what? It is a prime example of how types can introduce unnecessary complexity.
As I also indicated, I do not have a problem with an initial script that can be used for a banner with 'echo' but I do not think a special banner is a good idea since you will then want to set the prompt, etc. For the console, this initial script can be set by a system property.
Sorry to not accept it, but especially the increased complexity with additional types and methods is one of my pet peeves.
@@ -8,7 +8,7 @@ | |||
*/ | |||
@ObjectClassDefinition( description = "Configuration for the Gogo SSH interface.") | |||
public @interface SshdConfig { | |||
String PID = "biz.aQute.shell.sshd"; | |||
static String PID = "biz.aQute.shell.sshd"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fields in interfaces are always public static so this is unnecessary
* WelcomeBanner that would be printed after authentication. | ||
*/ | ||
@AttributeDefinition(description = "WelcomeBanner that would be printed after authentication.") | ||
String welcomeBanner() default Config.banner; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I like this ... I could live with an a script that is run at startup. This can 'echo' a banner of course. However, it could the also set the prompt, etc.
@@ -9,7 +9,7 @@ | |||
*/ | |||
@ObjectClassDefinition(description = "Configuration for the Gogo SSH interface in an insecure mode.") | |||
public @interface SshdConfigInsecure { | |||
String PID = "biz.aQute.shell.sshd.insecure"; | |||
static String PID = "biz.aQute.shell.sshd.insecure"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary
* WelcomeBanner that would be printed after authentication. | ||
*/ | ||
@AttributeDefinition(description = "WelcomeBanner that would be printed after authentication.") | ||
String welcomeBanner() default Config.banner; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See other comment, initial script is ok
@@ -28,18 +29,23 @@ | |||
|
|||
volatile int port; | |||
|
|||
AbstractGogoSshd(BundleContext context, CommandProcessor processor, String keypath, String host, int port) | |||
AbstractGogoSshd(BundleContext context, CommandProcessor processor, Config config ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not fond of this style. I explicitly did not pass the config. The reason is that the config belongs to the OSGi DS component and should not leak to other places. So I tend to provide the details and not the config object, even i fit is convenient. It just decouples the system further. I like simple types.
This was just an result of an test. I looked for a way that helped me to fined out that i am connect to the right server. I just let the bndrun. |
Makes sense. However, running a script would allow you to set the Gogo prompt. |
Signed-off-by: Stefan Bischof <[email protected]>
7a405bb
to
81378f3
Compare
5e43999
to
80ca439
Compare
Signed-off-by: Stefan Bischof [email protected]