Documentation
¶
Index ¶
- Constants
- func AuthJWTTokenCheck(ctx context.Context, input interface{}) (interface{}, error)
- func AuthJWTTokenRefresh(ctx context.Context, input interface{}) (interface{}, error)
- func AuthLoginEmail(ctx context.Context, input interface{}) (interface{}, error)
- func AuthLoginPhone(ctx context.Context, input interface{}) (interface{}, error)
- func AuthLogout(ctx context.Context, input interface{}) (interface{}, error)
- func AuthenticateRequest(ctx context.Context, abilityParams interface{}) (context.Context, error)
- func AuthenticatedUser(ctx context.Context) (*ability_user_model.User, *authModel.AuthSession, error)
- func LoadAPIMethods()
Constants ¶
View Source
const ( MethodLoginEmail = "auth.login.email" MethodLoginPhone = "auth.login.phone" MethodLogout = "auth.logout" MethodJWTTokenCheck = "auth.jwt_token.check" MethodJWTTokenRefresh = "auth.jwt_token.refresh" )
Variables ¶
This section is empty.
Functions ¶
func AuthJWTTokenCheck ¶
func AuthJWTTokenRefresh ¶
func AuthLoginEmail ¶
func AuthLoginPhone ¶
func AuthLogout ¶
func AuthenticateRequest ¶
AuthenticateRequest 是 APIExecuter 统一准入门禁入口:按 auth_cfg.auth_type 分发鉴权类型 (当前仅 jwt:验证 arguments.jwt_token 并把身份写入 context;未来新类型在此 switch 扩分支)。 非 Public 方法在门禁启用时 Execute 前必经此函数;失败统一返回业务错误,不区分 token 缺失与无效。 验证通过后 jwt_token 由 APIExecuter 从 arguments 移除,业务层零感知。
func AuthenticatedUser ¶
func AuthenticatedUser(ctx context.Context) (*ability_user_model.User, *authModel.AuthSession, error)
AuthenticatedUser 供业务方法读取准入门禁下传的当前用户与会话;非 Public 方法执行时必有。
func LoadAPIMethods ¶
func LoadAPIMethods()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.