mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-19 01:07:51 +00:00
fix: Add third party login check is block
This commit is contained in:
parent
c7dcf1ba59
commit
accde77307
@ -35,7 +35,7 @@ class MFAMiddleware:
|
|||||||
|
|
||||||
# 这个是 mfa 登录页需要的请求, 也得放出来, 用户其实已经在 CAS/OIDC 中完成登录了
|
# 这个是 mfa 登录页需要的请求, 也得放出来, 用户其实已经在 CAS/OIDC 中完成登录了
|
||||||
white_urls = [
|
white_urls = [
|
||||||
'login/mfa', 'mfa/select', 'face/context','jsi18n/', '/static/',
|
'login/mfa', 'mfa/select', 'face/context', 'jsi18n/', '/static/',
|
||||||
'/profile/otp', '/logout/',
|
'/profile/otp', '/logout/',
|
||||||
]
|
]
|
||||||
for url in white_urls:
|
for url in white_urls:
|
||||||
@ -77,6 +77,7 @@ class ThirdPartyLoginMiddleware(mixins.AuthMixin):
|
|||||||
ip = get_request_ip(request)
|
ip = get_request_ip(request)
|
||||||
try:
|
try:
|
||||||
self.request = request
|
self.request = request
|
||||||
|
self.check_is_block()
|
||||||
self._check_third_party_login_acl()
|
self._check_third_party_login_acl()
|
||||||
self._check_login_acl(request.user, ip)
|
self._check_login_acl(request.user, ip)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -161,7 +161,7 @@ class BlockUtilBase:
|
|||||||
BLOCK_KEY_TMPL: str
|
BLOCK_KEY_TMPL: str
|
||||||
|
|
||||||
def __init__(self, username, ip):
|
def __init__(self, username, ip):
|
||||||
username = username.lower()
|
username = username.lower() if username else ''
|
||||||
self.username = username
|
self.username = username
|
||||||
self.ip = ip
|
self.ip = ip
|
||||||
self.limit_key = self.LIMIT_KEY_TMPL.format(username, ip)
|
self.limit_key = self.LIMIT_KEY_TMPL.format(username, ip)
|
||||||
|
Loading…
Reference in New Issue
Block a user