Add a new extension point SshExecuteCommandInterceptor

It allows plugin to intercept ssh commands within the SshScope.

It is added to address some limitations of the current
SshCreateCommandInterceptor extension point by allowing:
- to inject the SshSession within the interceptor (impossible with
  SshCreateCommandInterceptor being injected just before the
  SshContext is created)
- multiple plugins to bind it using DynamicSet bindings

Change-Id: If57cae8f82b48f6c2ae8f71fc6ff2027b51b9e98
This commit is contained in:
David Causse
2019-04-09 14:19:28 +02:00
parent 552bfcdc5a
commit 01c1340185
4 changed files with 92 additions and 7 deletions

View File

@@ -101,6 +101,7 @@ public class SshModule extends LifecycleModule {
.to(SshPluginStarterCallback.class);
DynamicItem.itemOf(binder(), SshCreateCommandInterceptor.class);
DynamicSet.setOf(binder(), SshExecuteCommandInterceptor.class);
listener().toInstance(registerInParentInjectors());
listener().to(SshLog.class);