Skip to content

Commit

Permalink
Bring up KeePassXC unlock dialog, when KeePassXC database is locked
Browse files Browse the repository at this point in the history
Implements #94
  • Loading branch information
purejava committed Dec 13, 2024
1 parent 366f0bb commit 7b6759d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class KeePassXCAccess implements KeychainAccessProvider {

private static final Logger LOG = LoggerFactory.getLogger(KeePassXCAccess.class);

private KeepassProxyAccess proxy;
private final KeepassProxyAccess proxy;
private final String URL_SCHEME = "https://";
private final String APP_NAME = "Cryptomator";

Expand Down Expand Up @@ -65,6 +65,7 @@ public void storePassphrase(String vault, String displayName, CharSequence passw
public void storePassphrase(String vault, String name, CharSequence password, boolean requireOsAuthentication) throws KeychainAccessException {
if (isLocked()) {
LOG.info("Failed to store password. KeePassXC database is locked. Needs to be unlocked first.");
unlock();
return;
}
ensureAssociation();
Expand All @@ -85,6 +86,7 @@ public void storePassphrase(String vault, String name, CharSequence password, bo
public char[] loadPassphrase(String vault) throws KeychainAccessException {
if (isLocked()) {
LOG.info("Failed to load password. KeePassXC database is locked. Needs to be unlocked first.");
unlock();
return null;
}
ensureAssociation();
Expand All @@ -108,6 +110,7 @@ public char[] loadPassphrase(String vault) throws KeychainAccessException {
public void deletePassphrase(String vault) throws KeychainAccessException {
if (isLocked()) {
LOG.info("Failed to delete password. KeePassXC database is locked. Needs to be unlocked first.");
unlock();
return;
}
ensureAssociation();
Expand Down Expand Up @@ -137,6 +140,7 @@ public void changePassphrase(String vault, CharSequence password) throws Keychai
public void changePassphrase(String vault, String name, CharSequence password) throws KeychainAccessException {
if (isLocked()) {
LOG.info("Failed to change password. KeePassXC database is locked. Needs to be unlocked first.");
unlock();
return;
}
ensureAssociation();
Expand Down

0 comments on commit 7b6759d

Please sign in to comment.