mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-03 14:27:32 +08:00
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:
@@ -29,13 +29,13 @@ import (
|
||||
|
||||
// EncryptPassword encrypts a password using RSA public key
|
||||
// This matches the Python implementation in api/utils/crypt.py
|
||||
func EncryptPassword(password string) (string, error) {
|
||||
func EncryptPassword(password string, publicKeyPEM []byte) (string, error) {
|
||||
// Read public key from conf/public.pem
|
||||
publicKeyPath := filepath.Join(getProjectBaseDirectory(), "conf", "public.pem")
|
||||
publicKeyPEM, err := os.ReadFile(publicKeyPath)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to read public key: %w", err)
|
||||
}
|
||||
//publicKeyPath := filepath.Join(getProjectBaseDirectory(), "conf", "public.pem")
|
||||
//publicKeyPEM, err := os.ReadFile(publicKeyPath)
|
||||
//if err != nil {
|
||||
// return "", fmt.Errorf("failed to read public key: %w", err)
|
||||
//}
|
||||
|
||||
// Parse public key
|
||||
block, _ := pem.Decode(publicKeyPEM)
|
||||
|
||||
Reference in New Issue
Block a user