policy

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SDK

type SDK struct {
	// contains filtered or unexported fields
}

SDK 提供登录验证和权限鉴权的 Gin 中间件

func NewSDK

func NewSDK() *SDK

NewSDK 创建鉴权 SDK 实例,通过读取配置 policy.auth_url 获取 ECMDB 地址 NOTE: 需要在配置文件中声明 policy.auth_url: http://ecmdb:8000

func NewSDKWithURL

func NewSDKWithURL(baseURL string) *SDK

NewSDKWithURL 创建鉴权 SDK 实例,显式传入 ECMDB 的地址

func (*SDK) CheckLogin

func (s *SDK) CheckLogin() gin.HandlerFunc

CheckLogin 登录检查中间件

func (*SDK) CheckPolicy

func (s *SDK) CheckPolicy(resource string) gin.HandlerFunc

CheckPolicy 权限鉴权中间件

Jump to

Keyboard shortcuts

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