ProxyAI/src/main/java/ee/carlrobert/codegpt/credentials/UserCredentialsManager.java
Carl-Robert 37af74ebdf
You API integration (#203)
* Ability to configure custom service

* Add example preset templates, rename module

* Custom service client impl

* Add YOU API integration

* Remove/ignore generated antlr classes

* Remove text completion models(deprecated)

* Remove unused code, fix settings state sync

* Display model name/icon in the tool window

* Update chat history UI

* Fix model/service sync

* Clear plugin state

* Fix minor bugs, add settings sync tests

* UI changes

* Separate model configuration

* Add support for overriding the completion path

* Update Find Bugs prompt
2023-09-14 14:52:18 +03:00

31 lines
1 KiB
Java

package ee.carlrobert.codegpt.credentials;
import com.intellij.credentialStore.CredentialAttributes;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.Service;
import org.jetbrains.annotations.Nullable;
@Service
public final class UserCredentialsManager {
private static final CredentialAttributes accountPasswordCredentialAttributes = CredentialsUtil.createCredentialAttributes("ACCOUNT_PASSWORD");
private String accountPassword;
private UserCredentialsManager() {
accountPassword = CredentialsUtil.getPassword(accountPasswordCredentialAttributes);
}
public static UserCredentialsManager getInstance() {
return ApplicationManager.getApplication().getService(UserCredentialsManager.class);
}
public @Nullable String getAccountPassword() {
return accountPassword;
}
public void setAccountPassword(String accountPassword) {
this.accountPassword = accountPassword;
CredentialsUtil.setPassword(accountPasswordCredentialAttributes, accountPassword);
}
}