Rework password handling

This commit is contained in:
crschnick
2023-08-08 04:24:07 +00:00
parent f8b56ab774
commit 3d32d6cd84
12 changed files with 179 additions and 68 deletions

View File

@@ -0,0 +1,9 @@
package io.xpipe.core.process;
import lombok.Value;
@Value
public class ElevationConfig {
boolean requiresPassword;
}

View File

@@ -28,6 +28,8 @@ public interface ShellControl extends ProcessControl {
ShellControl onExit(Consumer<ShellControl> pc);
ShellControl onFail(Consumer<Throwable> t);
ElevationResult elevateCommand(String input) throws Exception;
ShellControl withExceptionConverter(ExceptionConverter converter);
ShellControl withErrorFormatter(Function<String, String> formatter);
@@ -90,12 +92,14 @@ public interface ShellControl extends ProcessControl {
}
}
ElevationResult elevateCommand(String input) throws Exception;
ElevationResult buildElevatedCommand(String input) throws Exception;
void restart() throws Exception;
OsType getOsType();
ElevationConfig getElevationConfig();
ShellControl elevated(String message, FailableFunction<ShellControl, Boolean, Exception> elevationFunction);
default ShellControl elevationPassword(SecretValue value) {