mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
[tasks] dropping obsolete PasswordUtil usages
GitOrigin-RevId: 3743123128cff7556d3f1592c677b9760fdfe991
This commit is contained in:
committed by
intellij-monorepo-bot
parent
38a28db180
commit
68623e9458
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.tasks.impl;
|
||||
|
||||
import com.intellij.credentialStore.CredentialAttributes;
|
||||
@@ -6,7 +6,6 @@ import com.intellij.credentialStore.CredentialAttributesKt;
|
||||
import com.intellij.credentialStore.Credentials;
|
||||
import com.intellij.ide.passwordSafe.PasswordSafe;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.PasswordUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.tasks.CustomTaskState;
|
||||
import com.intellij.tasks.TaskRepository;
|
||||
@@ -74,21 +73,6 @@ public abstract class BaseRepository extends TaskRepository {
|
||||
return myPassword;
|
||||
}
|
||||
|
||||
@Tag("password")
|
||||
public String getEncodedPassword() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void setEncodedPassword(String password) {
|
||||
try {
|
||||
setPassword(PasswordUtil.decodePassword(password));
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
private void loadPassword() {
|
||||
if (StringUtil.isEmpty(getPassword())) {
|
||||
CredentialAttributes attributes = getAttributes();
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.tasks.fogbugz;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.PasswordUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.tasks.*;
|
||||
import com.intellij.tasks.impl.BaseRepository;
|
||||
@@ -262,7 +261,6 @@ public final class FogBugzRepository extends BaseRepositoryImpl {
|
||||
return method;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CancellableConnection createCancellableConnection() {
|
||||
return new CancellableConnection() {
|
||||
@@ -302,21 +300,4 @@ public final class FogBugzRepository extends BaseRepositoryImpl {
|
||||
public String getComment() {
|
||||
return "{id} (e.g. 2344245), {summary}";
|
||||
}
|
||||
|
||||
@Tag("token")
|
||||
@NotNull
|
||||
public String getEncodedToken() {
|
||||
// The same approach as used for passwords in BaseRepository
|
||||
return PasswordUtil.encodePassword(myToken);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void setEncodedToken(@Nullable String token) {
|
||||
try {
|
||||
myToken = PasswordUtil.decodePassword(token);
|
||||
}
|
||||
catch (NumberFormatException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.tasks;
|
||||
|
||||
import com.intellij.configurationStore.XmlSerializer;
|
||||
import com.intellij.notification.Notification;
|
||||
import com.intellij.notification.Notifications;
|
||||
import com.intellij.openapi.progress.EmptyProgressIndicator;
|
||||
import com.intellij.openapi.util.PasswordUtil;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.tasks.actions.TaskSearchSupport;
|
||||
import com.intellij.tasks.impl.LocalTaskImpl;
|
||||
@@ -186,15 +185,4 @@ public class TaskManagerTest extends TaskManagerTestCase {
|
||||
assertEquals("${id}", myTaskManager.getState().branchNameFormat);
|
||||
assertEquals("${id} ${summary}", myTaskManager.getState().changelistNameFormat);
|
||||
}
|
||||
|
||||
public void testPasswordMigration() {
|
||||
TestRepository repository = new TestRepository();
|
||||
repository.setUrl("http://server");
|
||||
repository.setUsername("me");
|
||||
String password = "foo";
|
||||
repository.setEncodedPassword(PasswordUtil.encodePassword(password));
|
||||
repository.initializeRepository();
|
||||
assertEquals(password, repository.getPassword());
|
||||
assertNull(repository.getEncodedPassword());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user