mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-10-22 16:31:33 +00:00
* perf: 优化confirm接口 * perf: 修改 校验 * perf: 优化 confirm API 逻辑 * Delete django.po Co-authored-by: feng626 <1304903146@qq.com> Co-authored-by: ibuler <ibuler@qq.com> Co-authored-by: Jiangjie.Bai <bugatti_it@163.com> Co-authored-by: feng626 <57284900+feng626@users.noreply.github.com>
31 lines
562 B
Python
31 lines
562 B
Python
import abc
|
|
|
|
|
|
class BaseConfirm(abc.ABC):
|
|
|
|
def __init__(self, user, request):
|
|
self.user = user
|
|
self.request = request
|
|
|
|
@property
|
|
@abc.abstractmethod
|
|
def name(self) -> str:
|
|
return ''
|
|
|
|
@property
|
|
@abc.abstractmethod
|
|
def display_name(self) -> str:
|
|
return ''
|
|
|
|
@abc.abstractmethod
|
|
def check(self) -> bool:
|
|
return False
|
|
|
|
@property
|
|
def content(self):
|
|
return ''
|
|
|
|
@abc.abstractmethod
|
|
def authenticate(self, secret_key, mfa_type) -> tuple:
|
|
return False, 'Error msg'
|