mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-30 00:56:56 +13:00
Handle askpass without platform
This commit is contained in:
parent
d5442e858d
commit
4fdf89b77d
2 changed files with 9 additions and 10 deletions
|
@ -1,8 +1,5 @@
|
||||||
package io.xpipe.app.exchange;
|
package io.xpipe.app.exchange;
|
||||||
|
|
||||||
import io.xpipe.app.core.AppStyle;
|
|
||||||
import io.xpipe.app.core.AppTheme;
|
|
||||||
import io.xpipe.app.util.PlatformState;
|
|
||||||
import io.xpipe.app.util.SecretManager;
|
import io.xpipe.app.util.SecretManager;
|
||||||
import io.xpipe.beacon.BeaconHandler;
|
import io.xpipe.beacon.BeaconHandler;
|
||||||
import io.xpipe.beacon.exchange.AskpassExchange;
|
import io.xpipe.beacon.exchange.AskpassExchange;
|
||||||
|
@ -19,13 +16,6 @@ public class AskpassExchangeImpl extends AskpassExchange
|
||||||
return Response.builder().build();
|
return Response.builder().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PlatformState.initPlatformIfNeeded()) {
|
|
||||||
return Response.builder().build();
|
|
||||||
}
|
|
||||||
|
|
||||||
AppStyle.init();
|
|
||||||
AppTheme.init();
|
|
||||||
|
|
||||||
var p = found.get();
|
var p = found.get();
|
||||||
var secret = p.process(msg.getPrompt());
|
var secret = p.process(msg.getPrompt());
|
||||||
return Response.builder()
|
return Response.builder()
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package io.xpipe.app.util;
|
package io.xpipe.app.util;
|
||||||
|
|
||||||
import io.xpipe.app.core.AppI18n;
|
import io.xpipe.app.core.AppI18n;
|
||||||
|
import io.xpipe.app.core.AppStyle;
|
||||||
|
import io.xpipe.app.core.AppTheme;
|
||||||
import io.xpipe.app.core.AppWindowHelper;
|
import io.xpipe.app.core.AppWindowHelper;
|
||||||
import io.xpipe.app.fxcomps.impl.SecretFieldComp;
|
import io.xpipe.app.fxcomps.impl.SecretFieldComp;
|
||||||
import io.xpipe.core.util.InPlaceSecretValue;
|
import io.xpipe.core.util.InPlaceSecretValue;
|
||||||
|
@ -17,6 +19,13 @@ import javafx.stage.Stage;
|
||||||
public class AskpassAlert {
|
public class AskpassAlert {
|
||||||
|
|
||||||
public static SecretQueryResult queryRaw(String prompt, InPlaceSecretValue secretValue) {
|
public static SecretQueryResult queryRaw(String prompt, InPlaceSecretValue secretValue) {
|
||||||
|
if (!PlatformState.initPlatformIfNeeded()) {
|
||||||
|
return new SecretQueryResult(null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
AppStyle.init();
|
||||||
|
AppTheme.init();
|
||||||
|
|
||||||
var prop = new SimpleObjectProperty<>(secretValue);
|
var prop = new SimpleObjectProperty<>(secretValue);
|
||||||
var r = AppWindowHelper.showBlockingAlert(alert -> {
|
var r = AppWindowHelper.showBlockingAlert(alert -> {
|
||||||
alert.setTitle(AppI18n.get("askpassAlertTitle"));
|
alert.setTitle(AppI18n.get("askpassAlertTitle"));
|
||||||
|
|
Loading…
Reference in a new issue