mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-07-10 01:39:13 +00:00
* 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
31 lines
1 KiB
Java
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);
|
|
}
|
|
}
|