Просмотр исходного кода

Ensure that stored credentials aren't reset too early

Some commands are started without showing a dialog allowing to enter
credentials if needed. Hence we need to tolerate one failing HTTP
authentication to trigger loading credentials from the secure store.
Hence we should not immediately reset the stored credentials if the
first attempt to authenticate fails.

Bug: 431209
Change-Id: I1b9fa34c3d70be226bb1c59c9ebe995998d29bc8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tags/v3.3.2.201404171909-r
Matthias Sohn 10 лет назад
Родитель
Сommit
a53a18e988
1 измененных файлов: 2 добавлений и 2 удалений
  1. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java Просмотреть файл

@@ -472,13 +472,13 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
throw new TransportException(uri, MessageFormat.format(
JGitText.get().authenticationNotSupported, uri));
CredentialsProvider credentialsProvider = getCredentialsProvider();
if (authAttempts > 1)
credentialsProvider.reset(uri);
if (3 < authAttempts
|| !authMethod.authorize(uri, credentialsProvider)) {
credentialsProvider.reset(uri);
throw new TransportException(uri,
JGitText.get().notAuthorized);
}
credentialsProvider.reset(uri);
authAttempts++;
continue;


Загрузка…
Отмена
Сохранить