Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 134763 Details for
Bug 275233
[transport] cancelling authentication during Help>Check for Updates... cancels the update check
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
updated path - this time with both classes, and messages
275233.txt (text/plain), 6.49 KB, created by
Henrik Lindberg
on 2009-05-07 05:32:34 EDT
(
hide
)
Description:
updated path - this time with both classes, and messages
Filename:
MIME Type:
Creator:
Henrik Lindberg
Created:
2009-05-07 05:32:34 EDT
Size:
6.49 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.repository >Index: src/org/eclipse/equinox/internal/p2/repository/Credentials.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/Credentials.java,v >retrieving revision 1.6 >diff -u -r1.6 Credentials.java >--- src/org/eclipse/equinox/internal/p2/repository/Credentials.java 28 Apr 2009 00:27:12 -0000 1.6 >+++ src/org/eclipse/equinox/internal/p2/repository/Credentials.java 7 May 2009 09:29:27 -0000 >@@ -30,6 +30,11 @@ > * in a store, if none is provided the user is optionally prompted for the information. > */ > public class Credentials { >+ public static class LoginCanceledException extends Exception { >+ private static final long serialVersionUID = 1L; >+ >+ } >+ > private static final Map savedAuthInfo = Collections.synchronizedMap(new HashMap()); > > /** >@@ -48,7 +53,7 @@ > * @throws CoreException if the password cannot be read or saved > * @return The authentication info. > */ >- public static AuthenticationInfo forLocation(URI location, boolean prompt) throws UserCancelledException, CoreException { >+ public static AuthenticationInfo forLocation(URI location, boolean prompt) throws LoginCanceledException, CoreException { > return forLocation(location, prompt, null); > } > >@@ -70,7 +75,7 @@ > * @throws UserCancelledException - user canceled the prompt for name/password > * @throws CoreException if there is an error > */ >- public static AuthenticationInfo forLocation(URI location, boolean prompt, AuthenticationInfo lastUsed) throws UserCancelledException, CoreException { >+ public static AuthenticationInfo forLocation(URI location, boolean prompt, AuthenticationInfo lastUsed) throws LoginCanceledException, CoreException { > ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault(); > > // if URI is not opaque, just getting the host may be enough >@@ -137,7 +142,7 @@ > loginDetails = lastUsed != null ? adminUIService.getUsernamePassword(host, lastUsed) : adminUIService.getUsernamePassword(host); > //null result means user canceled password dialog > if (loginDetails == null) >- throw new UserCancelledException(); >+ throw new LoginCanceledException(); > //save user name and password if requested by user > if (loginDetails.saveResult()) { > if (prefNode == null) >Index: src/org/eclipse/equinox/internal/p2/repository/Messages.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/Messages.java,v >retrieving revision 1.5 >diff -u -r1.5 Messages.java >--- src/org/eclipse/equinox/internal/p2/repository/Messages.java 29 Apr 2009 16:10:52 -0000 1.5 >+++ src/org/eclipse/equinox/internal/p2/repository/Messages.java 7 May 2009 09:29:27 -0000 >@@ -72,7 +72,7 @@ > public static String FileTransport_reader; > > public static String UnableToRead_0_TooManyAttempts; >- >+ public static String UnableToRead_0_UserCanceled; > static { > // initialize resource bundles > NLS.initializeMessages(BUNDLE_NAME, Messages.class); >Index: src/org/eclipse/equinox/internal/p2/repository/RepositoryTransport.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/RepositoryTransport.java,v >retrieving revision 1.9 >diff -u -r1.9 RepositoryTransport.java >--- src/org/eclipse/equinox/internal/p2/repository/RepositoryTransport.java 7 May 2009 00:21:19 -0000 1.9 >+++ src/org/eclipse/equinox/internal/p2/repository/RepositoryTransport.java 7 May 2009 09:29:27 -0000 >@@ -18,6 +18,7 @@ > import org.eclipse.ecf.core.security.ConnectContextFactory; > import org.eclipse.ecf.core.security.IConnectContext; > import org.eclipse.ecf.filetransfer.UserCancelledException; >+import org.eclipse.equinox.internal.p2.repository.Credentials.LoginCanceledException; > import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; > import org.eclipse.equinox.internal.provisional.p2.core.IServiceUI.AuthenticationInfo; > import org.eclipse.equinox.internal.provisional.p2.repository.IStateful; >@@ -92,6 +93,11 @@ > return statusOn(target, RepositoryStatus.forException(e, toDownload), reader); > } catch (AuthenticationFailedException e) { > promptUser = true; >+ } catch (Credentials.LoginCanceledException e) { >+ DownloadStatus status = new DownloadStatus(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, // >+ NLS.bind(Messages.UnableToRead_0_UserCanceled, toDownload), null); >+ return statusOn(target, status, null); >+ > } > } > // reached maximum number of retries without success >@@ -147,6 +153,9 @@ > if (e.getStatus().getException() == null) > throw new CoreException(RepositoryStatus.forException(e, toDownload)); > throw new CoreException(RepositoryStatus.forStatus(e.getStatus(), toDownload)); >+ } catch (LoginCanceledException e) { >+ // i.e. same behavior when user cancels as when failing n attempts. >+ throw new AuthenticationFailedException(); > } > } > throw new AuthenticationFailedException(); >@@ -202,6 +211,9 @@ > throw new CoreException(RepositoryStatus.forStatus(e.getStatus(), toDownload)); > } catch (AuthenticationFailedException e) { > promptUser = true; >+ } catch (LoginCanceledException e) { >+ // same behavior as if user failed n attempts. >+ throw new AuthenticationFailedException(); > } > } > // reached maximum number of authentication retries without success >Index: src/org/eclipse/equinox/internal/p2/repository/messages.properties >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/messages.properties,v >retrieving revision 1.9 >diff -u -r1.9 messages.properties >--- src/org/eclipse/equinox/internal/p2/repository/messages.properties 29 Apr 2009 16:10:52 -0000 1.9 >+++ src/org/eclipse/equinox/internal/p2/repository/messages.properties 7 May 2009 09:29:27 -0000 >@@ -69,3 +69,4 @@ > FileTransport_reader=File Transport Reader > connection_to_0_failed_on_1_retry_attempt_2=Connection to {0} failed on {1}. Retry attempt {2} started > UnableToRead_0_TooManyAttempts=Unable to read repository at: {0}. Too many failed login attempts. >+UnableToRead_0_UserCanceled=Unable to read repository at: {0}. Login canceled by user.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 275233
:
134716
|
134717
| 134763