-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9652 from JacobTrossing/fix-for-issue-8055
Protect proxy password by not storing it between sessions
- Loading branch information
Showing
7 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.jabref.logic.net; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class ProxyTest { | ||
/** | ||
* The test checks if ProxyPreference class is still able to store password and use it from memory, | ||
* even though it's no longer stored in register. | ||
*/ | ||
@Test | ||
public void testProxyPreferencesStorePassword() { | ||
// mock data | ||
Boolean useProxy = true; | ||
String hostname = "testName"; | ||
String port = "8080"; | ||
Boolean useAuthentication = true; | ||
String username = "testUserName"; | ||
String password = "testPassword"; | ||
// Creates proxy preference | ||
ProxyPreferences proxyPref = new ProxyPreferences( | ||
useProxy, | ||
hostname, | ||
port, | ||
useAuthentication, | ||
username, | ||
password); | ||
// Check if mock data is stored in object memory and can be extracted | ||
assertEquals(proxyPref.shouldUseProxy(), true); | ||
assertEquals(proxyPref.getHostname(), hostname); | ||
assertEquals(proxyPref.getPort(), port); | ||
assertEquals(proxyPref.shouldUseAuthentication(), true); | ||
assertEquals(proxyPref.getUsername(), username); | ||
assertEquals(proxyPref.getPassword(), password); | ||
} | ||
} |