fix: 替换ssh key 生成密钥方法 (#10995)

Co-authored-by: feng <1304903146@qq.com>
pull/10999/head
fit2bot 1 year ago committed by GitHub
parent f466904a1c
commit 0436487bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,7 +4,7 @@ from rest_framework import serializers
from accounts.const import ( from accounts.const import (
SecretType, DEFAULT_PASSWORD_RULES SecretType, DEFAULT_PASSWORD_RULES
) )
from common.utils import gen_key_pair, random_string from common.utils import ssh_key_gen, random_string
from common.utils import validate_ssh_private_key, parse_ssh_private_key_str from common.utils import validate_ssh_private_key, parse_ssh_private_key_str
@ -16,7 +16,7 @@ class SecretGenerator:
@staticmethod @staticmethod
def generate_ssh_key(): def generate_ssh_key():
private_key, public_key = gen_key_pair() private_key, public_key = ssh_key_gen()
return private_key return private_key
def generate_password(self): def generate_password(self):

Loading…
Cancel
Save