Go: default public key (#16265)

### What problem does this PR solve?

Provider default public key for CLI

### Type of change

- [x] Refactoring

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-06-23 17:43:26 +08:00
committed by GitHub
parent dec2ce4a60
commit e15130534f
5 changed files with 65 additions and 11 deletions

View File

@@ -160,8 +160,14 @@ func (c *CLI) PingServer(iterations int) (ResponseIf, error) {
// loginUser performs the actual login request
func (c *CLI) loginUser(email, password string) (string, error) {
// Encrypt password using scrypt (same as Python implementation)
encryptedPassword, err := EncryptPassword(password)
publicKey, err := c.GetPublicKeyPEM()
if err != nil {
return "", fmt.Errorf("failed to get public key: %w", err)
}
// Encrypt password using RSA
encryptedPassword, err := EncryptPassword(password, publicKey)
if err != nil {
return "", fmt.Errorf("failed to encrypt password: %w", err)
}