Changeset 12992 in josm for trunk/src/org/openstreetmap/josm/io/auth
- Timestamp:
- 2017-10-14T00:09:56+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io/auth
- Files:
-
- 3 edited
-
AbstractCredentialsAgent.java (modified) (3 diffs)
-
CredentialsAgent.java (modified) (1 diff)
-
CredentialsManager.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/auth/AbstractCredentialsAgent.java
r12869 r12992 62 62 63 63 /* 64 * Last request was successful and there was no credentials stored 65 * in file (or only the username is stored). 66 * -> Try to recall credentials that have been entered 67 * manually in this session. 64 * Last request was successful and there was no credentials stored in file (or only the username is stored). 65 * -> Try to recall credentials that have been entered manually in this session. 68 66 */ 69 67 if (!noSuccessWithLastResponse && memoryCredentialsCache.containsKey(requestorType) && … … 89 87 response.getPassword() 90 88 )); 91 /*92 * User decides not to save credentials to file. Keep it93 * in memory so we don't have to ask over and over again.94 */95 89 } else { 96 PasswordAuthentication pa = new PasswordAuthentication(response.getUsername(), response.getPassword());97 memoryCredentialsCache.put(requestorType, pa);90 // User decides not to save credentials to file. Keep it in memory so we don't have to ask over and over again. 91 memoryCredentialsCache.put(requestorType, new PasswordAuthentication(response.getUsername(), response.getPassword())); 98 92 } 99 /*100 * We got it from file.101 */102 93 } else { 94 // We got it from file. 103 95 response.setUsername(username); 104 96 response.setPassword(password.toCharArray()); … … 106 98 } 107 99 return response; 100 } 101 102 @Override 103 public final void purgeCredentialsCache(RequestorType requestorType) { 104 memoryCredentialsCache.remove(requestorType); 108 105 } 109 106 -
trunk/src/org/openstreetmap/josm/io/auth/CredentialsAgent.java
r8929 r12992 74 74 75 75 /** 76 * Purges the internal credentials cache for the given requestor type. 77 * @param requestorType the type of service. 78 * {@link RequestorType#SERVER} for the OSM API server, {@link RequestorType#PROXY} for a proxy server 79 * @since 12992 80 */ 81 void purgeCredentialsCache(RequestorType requestorType); 82 83 /** 76 84 * Provide a Panel that is shown below the API password / username fields 77 85 * in the JOSM Preferences. (E.g. a warning that password is saved unencrypted.) -
trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java
r12743 r12992 43 43 private static CredentialsAgentFactory agentFactory; 44 44 45 /** 46 * Credentials agent factory. 47 */ 45 48 @FunctionalInterface 46 49 public interface CredentialsAgentFactory { 50 /** 51 * Returns the credentials agent instance. 52 * @return the credentials agent instance 53 */ 47 54 CredentialsAgent getCredentialsAgent(); 48 55 } … … 148 155 return delegate.getPreferencesDecorationPanel(); 149 156 } 157 158 @Override 159 public void purgeCredentialsCache(RequestorType requestorType) { 160 delegate.purgeCredentialsCache(requestorType); 161 } 150 162 }
Note:
See TracChangeset
for help on using the changeset viewer.
