Fixes for missing access

This commit is contained in:
crschnick
2026-09-09 19:54:33 +00:00
parent 43ad013724
commit 1aee315253
3 changed files with 11 additions and 1 deletions
@@ -11,6 +11,7 @@ import io.xpipe.app.hub.list.StoreViewState;
import io.xpipe.app.issue.ErrorEventFactory;
import io.xpipe.app.platform.PlatformThread;
import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.secret.DataStorageAccessHandler;
import io.xpipe.app.storage.DataStorage;
import io.xpipe.app.storage.DataStoreEntry;
import io.xpipe.app.store.DataStore;
@@ -155,6 +156,10 @@ public class StoreCreationDialog {
StoreCreationConsumer con,
boolean staticDisplay,
DataStoreEntry existingEntry) {
if (!DataStorageAccessHandler.getInstance().isAccessible()) {
throw ErrorEventFactory.expected(new IllegalStateException("Current vault encryption is not accessible. Vault data can't be modified in this state"));
}
var ex = StoreCreationQueueEntry.findExisting(existingEntry);
if (ex.isPresent()) {
ex.get().execute();
@@ -34,7 +34,7 @@ public class ErrorHandlerDialog {
var comp = new ErrorHandlerComp(event, () -> {
AppDialog.hide(modal.get());
});
comp.prefWidth(event.getThrowable() != null ? 600 : 500);
comp.prefWidth(600);
var headerId = event.isTerminal() ? "terminalErrorOccurred" : "errorOccurred";
var errorModal = ModalOverlay.of(headerId, comp, new LabelGraphic.NodeGraphic(() -> {
var graphic = new FontIcon("mdomz-warning");
@@ -57,7 +57,12 @@ public class DataStoreAccessScope {
var handler = DataStorageAccessHandler.getInstance();
var vaultPrincipal = handler.getFallbackPrincipal();
var encryptPrincipal = handler.getEncryptAllPrincipal();
// If we can't access the encryption principal, just keep it
if (!encryptPrincipal.isAccessible()) {
return principal;
}
var isVault = vaultPrincipal.equals(principal);
var exists = handler.getAllEncryptionPrincipals().contains(principal);