diff --git a/CHANGELOG.md b/CHANGELOG.md index 284a9311440..3763ab5a8be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We enabled the user to change the name of a field in a custom entry type by double-clicking on it. [#9840](https://github.com/JabRef/jabref/issues/9840) - We integrated two mail actions ("As Email" and "To Kindle") under a new "Send" option in the right-click & Tools menus. The Kindle option creates an email targeted to the user's Kindle email, which can be set in preferences under "External programs" [#6186](https://github.com/JabRef/jabref/issues/6186) - We added an option to clear recent libraries' history. [#10003](https://github.com/JabRef/jabref/issues/10003) +- We added an option to encrypt and remember the proxy password. [#8055](https://github.com/JabRef/jabref/issues/8055)[#10044](https://github.com/JabRef/jabref/issues/10044) ### Changed @@ -70,6 +71,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We improved the error message when no terminal was found [#9607](https://github.com/JabRef/jabref/issues/9607) - In the context of the "systematic literature functionality", we changed the name "database" to "catalog" to use a separate term for online catalogs in comparison to SQL databases. [#9951](https://github.com/JabRef/jabref/pull/9951) - We now show more fields (including Special Fields) in the dropdown selection for "Save sort order" in the library properties and for "Export sort order" in the preferences. [#10010](https://github.com/JabRef/jabref/issues/10010) +- We now encrypt and store the custom API keys in the OS native credential store. [#10044](https://github.com/JabRef/jabref/issues/10044) ### Fixed @@ -81,7 +83,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where custom field in the custom entry types could not be set to mulitline. [#9609](https://github.com/JabRef/jabref/issues/9609) - We fixed an issue where the Office XML exporter did not resolve BibTeX-Strings when exporting entries. [forum#3741](https://discourse.jabref.org/t/exporting-bibtex-constant-strings-to-ms-office-2007-xml/3741) - We fixed an issue where the Merge Entries Toolbar configuration was not saved after hitting 'Merge Entries' button. [#9091](https://github.com/JabRef/jabref/issues/9091) -- We fixed an issue where the password is saved locally if user wants to use proxy with authentication. [#8055](https://github.com/JabRef/jabref/issues/8055) +- We fixed an issue where the password is stored in clear text if the user wants to use a proxy with authentication. [#8055](https://github.com/JabRef/jabref/issues/8055) - JabRef is now more relaxed when parsing field content: In case a field content ended with `\`, the combination `\}` was treated as plain `}`. [#9668](https://github.com/JabRef/jabref/issues/9668) - We resolved an issue that cut off the number of group entries when it exceeded four digits. [#8797](https://github.com/JabRef/jabref/issues/8797) - We fixed the issue where the size of the global search window was not retained after closing. [#9362](https://github.com/JabRef/jabref/issues/9362) diff --git a/build.gradle b/build.gradle index 7a75a7847fd..14324d78e2e 100644 --- a/build.gradle +++ b/build.gradle @@ -141,6 +141,7 @@ dependencies { implementation 'io.github.java-diff-utils:java-diff-utils:4.12' implementation 'info.debatty:java-string-similarity:2.0.0' + implementation 'com.github.javakeyring:java-keyring:1.0.2' antlr4 'org.antlr:antlr4:4.13.0' implementation 'org.antlr:antlr4-runtime:4.13.0' diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 91229649901..2138923ed88 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -99,6 +99,8 @@ requires com.h2database.mvstore; + requires java.keyring; + requires org.jooq.jool; // fulltext search diff --git a/src/main/java/org/jabref/gui/JabRefGUI.java b/src/main/java/org/jabref/gui/JabRefGUI.java index 74afaa50314..133df390b3f 100644 --- a/src/main/java/org/jabref/gui/JabRefGUI.java +++ b/src/main/java/org/jabref/gui/JabRefGUI.java @@ -4,6 +4,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; import javafx.application.Platform; @@ -25,6 +26,7 @@ import org.jabref.logic.shared.exception.InvalidDBMSConnectionPropertiesException; import org.jabref.logic.shared.exception.NotASharedDatabaseException; import org.jabref.logic.util.WebViewStore; +import org.jabref.model.strings.StringUtil; import org.jabref.model.util.FileUpdateMonitor; import org.jabref.preferences.GuiPreferences; import org.jabref.preferences.PreferencesService; @@ -71,13 +73,32 @@ public JabRefGUI(Stage mainStage, preferencesService.getInternalPreferences()) .checkForNewVersionDelayed(); - if (preferencesService.getProxyPreferences().shouldUseProxy() && preferencesService.getProxyPreferences().shouldUseAuthentication()) { - DialogService dialogService = Injector.instantiateModelOrService(DialogService.class); - dialogService.showPasswordDialogAndWait(Localization.lang("Proxy configuration"), Localization.lang("Proxy requires password"), Localization.lang("Password")) - .ifPresent(newPassword -> { - preferencesService.getProxyPreferences().setPassword(newPassword); - ProxyRegisterer.register(preferencesService.getProxyPreferences()); - }); + setupProxy(); + } + + private void setupProxy() { + if (!preferencesService.getProxyPreferences().shouldUseProxy() + || !preferencesService.getProxyPreferences().shouldUseAuthentication()) { + return; + } + + if (preferencesService.getProxyPreferences().shouldPersistPassword() + && StringUtil.isNotBlank(preferencesService.getProxyPreferences().getPassword())) { + ProxyRegisterer.register(preferencesService.getProxyPreferences()); + return; + } + + DialogService dialogService = Injector.instantiateModelOrService(DialogService.class); + Optional password = dialogService.showPasswordDialogAndWait( + Localization.lang("Proxy configuration"), + Localization.lang("Proxy requires password"), + Localization.lang("Password")); + + if (password.isPresent()) { + preferencesService.getProxyPreferences().setPassword(password.get()); + ProxyRegisterer.register(preferencesService.getProxyPreferences()); + } else { + LOGGER.warn("No proxy password specified"); } } diff --git a/src/main/java/org/jabref/gui/preferences/general/GeneralTab.fxml b/src/main/java/org/jabref/gui/preferences/general/GeneralTab.fxml index 706d9510baf..60892aea5cf 100644 --- a/src/main/java/org/jabref/gui/preferences/general/GeneralTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/general/GeneralTab.fxml @@ -65,7 +65,6 @@ -