diff --git a/platform/credential-store/src/PasswordSafeConfigurable.kt b/platform/credential-store/src/PasswordSafeConfigurable.kt index e6ead52b6438..2c907b17a1e6 100644 --- a/platform/credential-store/src/PasswordSafeConfigurable.kt +++ b/platform/credential-store/src/PasswordSafeConfigurable.kt @@ -106,6 +106,7 @@ class PasswordSafeConfigurableUi : ConfigurableUi { } settings.providerType = providerType + passwordSafe.currentProvider = provider } fun updateEnabledState() { diff --git a/platform/credential-store/src/PasswordSafeImpl.kt b/platform/credential-store/src/PasswordSafeImpl.kt index cad093d65074..c8e5981cd81d 100644 --- a/platform/credential-store/src/PasswordSafeImpl.kt +++ b/platform/credential-store/src/PasswordSafeImpl.kt @@ -24,7 +24,6 @@ import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.SettingsSavingComponent import com.intellij.openapi.diagnostic.catchAndLog import org.jetbrains.concurrency.runAsync -import java.nio.file.Path class PasswordSafeImpl(/* public - backward compatibility */val settings: PasswordSafeSettings) : PasswordSafe(), SettingsSavingComponent { internal @Volatile var currentProvider: PasswordStorage @@ -46,23 +45,6 @@ class PasswordSafeImpl(/* public - backward compatibility */val settings: Passwo } } - internal fun setProvider(type: ProviderType) { - val memoryOnly = type == ProviderType.MEMORY_ONLY - if (memoryOnly) { - val provider = currentProvider - if (provider is KeePassCredentialStore) { - provider.memoryOnly = true - provider.deleteFileStorage() - } - else { - currentProvider = KeePassCredentialStore(memoryOnly = true) - } - } - else { - currentProvider = createPersistentCredentialStore(currentProvider as? KeePassCredentialStore) - } - } - override fun get(attributes: CredentialAttributes): Credentials? { val value = currentProvider.get(attributes) if ((value == null || value.password.isNullOrEmpty()) && memoryHelperProvider.isInitialized()) { @@ -119,12 +101,6 @@ class PasswordSafeImpl(/* public - backward compatibility */val settings: Passwo ApplicationManager.getApplication().messageBus.syncPublisher(PasswordSafeSettings.TOPIC).credentialStoreCleared() } - internal fun getKeePassCredentialStore() = currentProvider as KeePassCredentialStore - - fun importFileDatabase(path: Path, masterPassword: String) { - currentProvider = copyFileDatabase(path, masterPassword) - } - override fun isPasswordStoredOnlyInMemory(attributes: CredentialAttributes): Boolean { if (isMemoryOnly) { return true