api_auth_session

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

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 AuthJWTTokenCheck(ctx context.Context, input interface{}) (interface{}, error)

func AuthJWTTokenRefresh

func AuthJWTTokenRefresh(ctx context.Context, input interface{}) (interface{}, error)

func AuthLoginEmail

func AuthLoginEmail(ctx context.Context, input interface{}) (interface{}, error)

func AuthLoginPhone

func AuthLoginPhone(ctx context.Context, input interface{}) (interface{}, error)

func AuthLogout

func AuthLogout(ctx context.Context, input interface{}) (interface{}, error)

func AuthenticateRequest

func AuthenticateRequest(ctx context.Context, abilityParams interface{}) (context.Context, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL