mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-10 03:39:59 +00:00
[Update] 添加用户profile public-key序列类
This commit is contained in:
@@ -47,6 +47,10 @@ class AuthMixin:
|
||||
post_user_change_password.send(self.__class__, user=self)
|
||||
super().set_password(raw_password)
|
||||
|
||||
def set_public_key(self, public_key):
|
||||
self.public_key = public_key
|
||||
self.save()
|
||||
|
||||
def can_update_password(self):
|
||||
return self.is_local
|
||||
|
||||
@@ -79,6 +83,14 @@ class AuthMixin:
|
||||
pass
|
||||
return PubKey()
|
||||
|
||||
def get_public_key_comment(self):
|
||||
return self.public_key_obj.comment
|
||||
|
||||
def get_public_key_hash_md5(self):
|
||||
if not callable(self.public_key_obj.hash_md5):
|
||||
return ''
|
||||
return self.public_key_obj.hash_md5()
|
||||
|
||||
def reset_password(self, new_password):
|
||||
self.set_password(new_password)
|
||||
self.save()
|
||||
|
Reference in New Issue
Block a user