mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Add support for message formatting in process control
This commit is contained in:
parent
fe6d56d71e
commit
8da34c670a
4 changed files with 19 additions and 1 deletions
|
@ -1,5 +1,9 @@
|
||||||
# Security
|
# Security
|
||||||
|
|
||||||
|
Due to its nature, X-Pipe has to handle a lot of sensitive information.
|
||||||
|
This can range from passwords for all kinds of servers, to SSH keys, and more.
|
||||||
|
Therefore, you should definitely be interested in the security model of X-Pipe.
|
||||||
|
|
||||||
This document summarizes the approach of X-Pipe when it comes to the security of your sensitive information.
|
This document summarizes the approach of X-Pipe when it comes to the security of your sensitive information.
|
||||||
If any of your questions are left unanswered by this document, feel free to file an
|
If any of your questions are left unanswered by this document, feel free to file an
|
||||||
issue report so your question can be answered individually and can also potentially be included in this document.
|
issue report so your question can be answered individually and can also potentially be included in this document.
|
||||||
|
|
|
@ -7,10 +7,14 @@ import io.xpipe.app.fxcomps.impl.LabelComp;
|
||||||
import io.xpipe.app.fxcomps.impl.SecretFieldComp;
|
import io.xpipe.app.fxcomps.impl.SecretFieldComp;
|
||||||
import io.xpipe.app.prefs.AppPrefs;
|
import io.xpipe.app.prefs.AppPrefs;
|
||||||
import io.xpipe.core.util.SecretValue;
|
import io.xpipe.core.util.SecretValue;
|
||||||
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.scene.control.Alert;
|
import javafx.scene.control.Alert;
|
||||||
|
import javafx.scene.control.ButtonType;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class LockChangeAlert {
|
public class LockChangeAlert {
|
||||||
|
|
||||||
public static void show() {
|
public static void show() {
|
||||||
|
@ -42,8 +46,13 @@ public class LockChangeAlert {
|
||||||
var content = new VBox(label1, p1, new Spacer(15), label2, p2);
|
var content = new VBox(label1, p1, new Spacer(15), label2, p2);
|
||||||
content.setSpacing(5);
|
content.setSpacing(5);
|
||||||
alert.getDialogPane().setContent(content);
|
alert.getDialogPane().setContent(content);
|
||||||
|
|
||||||
|
var button = alert.getDialogPane().lookupButton(ButtonType.OK);
|
||||||
|
button.disableProperty().bind(Bindings.createBooleanBinding(() -> {
|
||||||
|
return !Objects.equals(prop1.getValue(), prop2.getValue());
|
||||||
|
}, prop1, prop2));
|
||||||
})
|
})
|
||||||
.filter(b -> b.getButtonData().isDefaultButton() && ((prop1.getValue() != null && prop2.getValue() != null && prop1.getValue().equals(prop2.getValue())) || (prop1.getValue() == null && prop2.getValue() == null)))
|
.filter(b -> b.getButtonData().isDefaultButton())
|
||||||
.ifPresent(t -> {
|
.ifPresent(t -> {
|
||||||
AppPrefs.get().changeLock(prop1.getValue());
|
AppPrefs.get().changeLock(prop1.getValue());
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,6 +8,7 @@ import java.io.InputStreamReader;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
public interface CommandControl extends ProcessControl {
|
public interface CommandControl extends ProcessControl {
|
||||||
|
|
||||||
|
@ -20,6 +21,8 @@ public interface CommandControl extends ProcessControl {
|
||||||
CLOSE
|
CLOSE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CommandControl withMessageFormatter(Function<String, String> formatter);
|
||||||
|
|
||||||
CommandControl terminalExitMode(TerminalExitMode mode);
|
CommandControl terminalExitMode(TerminalExitMode mode);
|
||||||
|
|
||||||
public CommandControl doesNotObeyReturnValueConvention();
|
public CommandControl doesNotObeyReturnValueConvention();
|
||||||
|
|
|
@ -19,6 +19,8 @@ public interface ShellControl extends ProcessControl {
|
||||||
|
|
||||||
ShellControl onExit(Consumer<ShellControl> pc);
|
ShellControl onExit(Consumer<ShellControl> pc);
|
||||||
|
|
||||||
|
ShellControl withMessageFormatter(Function<String, String> formatter);
|
||||||
|
|
||||||
String prepareTerminalOpen() throws Exception;
|
String prepareTerminalOpen() throws Exception;
|
||||||
|
|
||||||
String prepareIntermediateTerminalOpen(String content) throws Exception;
|
String prepareIntermediateTerminalOpen(String content) throws Exception;
|
||||||
|
|
Loading…
Reference in a new issue