mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
svn: Refactor "RepositoryLoader" - remove useless interactive auth configuration
"SvnClient" instances use interactive auth by default anyway
This commit is contained in:
@@ -5,16 +5,12 @@ import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.idea.svn.SvnVcs;
|
||||
import org.jetbrains.idea.svn.api.Url;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class SvnAuthenticationProvider implements AuthenticationProvider {
|
||||
|
||||
private final Project myProject;
|
||||
private final SvnAuthenticationNotifier myAuthenticationNotifier;
|
||||
private final AuthenticationProvider mySvnInteractiveAuthenticationProvider;
|
||||
private final SvnAuthenticationManager myAuthenticationManager;
|
||||
private static final Set<Thread> ourForceInteractive = new HashSet<>();
|
||||
|
||||
public SvnAuthenticationProvider(final SvnVcs svnVcs,
|
||||
final AuthenticationProvider provider,
|
||||
@@ -33,7 +29,7 @@ public class SvnAuthenticationProvider implements AuthenticationProvider {
|
||||
final SvnAuthenticationNotifier.AuthenticationRequest obj =
|
||||
new SvnAuthenticationNotifier.AuthenticationRequest(myProject, kind, url, realm);
|
||||
final Url wcUrl = myAuthenticationNotifier.getWcUrl(obj);
|
||||
if (wcUrl == null || ourForceInteractive.contains(Thread.currentThread())) {
|
||||
if (wcUrl == null) {
|
||||
// outside-project url
|
||||
return mySvnInteractiveAuthenticationProvider.requestClientAuthentication(kind, url, realm, canCache);
|
||||
} else {
|
||||
@@ -44,14 +40,6 @@ public class SvnAuthenticationProvider implements AuthenticationProvider {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void forceInteractive() {
|
||||
ourForceInteractive.add(Thread.currentThread());
|
||||
}
|
||||
|
||||
public static void clearInteractive() {
|
||||
ourForceInteractive.remove(Thread.currentThread());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AcceptResult acceptServerAuthentication(Url url, String realm, final Object certificate, final boolean canCache) {
|
||||
return mySvnInteractiveAuthenticationProvider.acceptServerAuthentication(url, realm, certificate, canCache);
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.jetbrains.idea.svn.SvnVcs;
|
||||
import org.jetbrains.idea.svn.api.Depth;
|
||||
import org.jetbrains.idea.svn.api.Revision;
|
||||
import org.jetbrains.idea.svn.api.Target;
|
||||
import org.jetbrains.idea.svn.auth.SvnAuthenticationProvider;
|
||||
import org.jetbrains.idea.svn.browse.DirectoryEntry;
|
||||
import org.jetbrains.idea.svn.dialogs.RepositoryTreeNode;
|
||||
|
||||
@@ -100,7 +99,6 @@ class RepositoryLoader extends Loader {
|
||||
List<DirectoryEntry> entries = newArrayList();
|
||||
final RepositoryTreeNode node = myData.first;
|
||||
final SvnVcs vcs = node.getVcs();
|
||||
SvnAuthenticationProvider.forceInteractive();
|
||||
|
||||
try {
|
||||
Target target = Target.on(node.getURL());
|
||||
@@ -112,8 +110,6 @@ class RepositoryLoader extends Loader {
|
||||
startNext();
|
||||
});
|
||||
return;
|
||||
} finally {
|
||||
SvnAuthenticationProvider.clearInteractive();
|
||||
}
|
||||
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
|
||||
Reference in New Issue
Block a user