From d48c4d15e24e69e6df8efc5a8aa4349fc022648a Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Sat, 19 Oct 2024 16:57:44 +0800 Subject: [PATCH] feat(auth): update intercept event type --- app/chain/user.py | 4 ++-- app/schemas/types.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/chain/user.py b/app/chain/user.py index 67c9288a..917c4c46 100644 --- a/app/chain/user.py +++ b/app/chain/user.py @@ -94,7 +94,7 @@ class UserChain(ChainBase, metaclass=Singleton): return False, "认证失败" else: logger.debug(f"辅助认证未启用,认证类型 {grant_type} 未实现") - return False, "未实现的认证类型" + return False, "不支持的认证类型" def password_authenticate(self, credentials: AuthCredentials) -> Tuple[bool, Union[User, str]]: """ @@ -202,7 +202,7 @@ class UserChain(ChainBase, metaclass=Singleton): # 触发认证通过的拦截事件 intercept_event = self.eventmanager.send_event( - etype=ChainEventType.AuthPassedIntercept, + etype=ChainEventType.AuthIntercept, data=AuthInterceptCredentials(username=username, channel=channel, service=service, token=token) ) diff --git a/app/schemas/types.py b/app/schemas/types.py index 5fe66c3a..c2815a85 100644 --- a/app/schemas/types.py +++ b/app/schemas/types.py @@ -64,8 +64,8 @@ class ChainEventType(Enum): NameRecognize = "name.recognize" # 认证验证请求 AuthVerification = "auth.verification" - # 认证通过拦截 - AuthPassedIntercept = "auth.passed.intercept" + # 认证拦截请求 + AuthIntercept = "auth.intercept" # 系统配置Key字典