mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-03 16:35:10 +00:00
perf: 优化confirm接口 (#8451)
* 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>
This commit is contained in:
30
apps/authentication/confirm/base.py
Normal file
30
apps/authentication/confirm/base.py
Normal file
@@ -0,0 +1,30 @@
|
||||
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'
|
Reference in New Issue
Block a user