security

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminUserPermissionHandler

type AdminUserPermissionHandler struct {
	Adaptor *PermissionAdaptor
}

func (AdminUserPermissionHandler) Access

func (AdminUserPermissionHandler) CheckProcess

func (AdminUserPermissionHandler) PermissionListProcess

func (a AdminUserPermissionHandler) PermissionListProcess(ctx context.Context) PermissionProcess

type AppPermissionProcess

type AppPermissionProcess struct {
	Adaptor *PermissionAdaptor
}

func (AppPermissionProcess) GetAllRoles

func (a AppPermissionProcess) GetAllRoles(ctx context.Context) ([]string, error)

type DefaultPermissionProcess

type DefaultPermissionProcess struct {
}

type GetByUserAndScopePermissionProcess

type GetByUserAndScopePermissionProcess struct {
	Adaptor *PermissionAdaptor
}

func (GetByUserAndScopePermissionProcess) GetAllRoles

type InternalUserPermissionHandler

type InternalUserPermissionHandler struct {
	Adaptor *PermissionAdaptor
}

func (InternalUserPermissionHandler) Access

func (InternalUserPermissionHandler) CheckProcess

func (InternalUserPermissionHandler) PermissionListProcess

func (a InternalUserPermissionHandler) PermissionListProcess(ctx context.Context) PermissionProcess

type NormalUserPermissionHandler

type NormalUserPermissionHandler struct {
	Adaptor *PermissionAdaptor
}

func (NormalUserPermissionHandler) Access

func (NormalUserPermissionHandler) CheckProcess

func (NormalUserPermissionHandler) PermissionListProcess

func (n NormalUserPermissionHandler) PermissionListProcess(ctx context.Context) PermissionProcess

type PermissionAdaptor

type PermissionAdaptor struct {
	Db       *dao.DBClient
	Bdl      *bundle.Bundle
	Handlers []PermissionHandler
	Once     sync.Once
}

func (*PermissionAdaptor) CheckPermission

func (this *PermissionAdaptor) CheckPermission(req apistructs.PermissionCheckRequest) (bool, error)

func (*PermissionAdaptor) CheckPublicScope

func (this *PermissionAdaptor) CheckPublicScope(userID string, scopeType apistructs.ScopeType, scopeID int64) (bool, error)

func (*PermissionAdaptor) GetCheckRequest

func (*PermissionAdaptor) GetScopeID

func (this *PermissionAdaptor) GetScopeID(ctx context.Context) int64

func (*PermissionAdaptor) GetScopeType

func (this *PermissionAdaptor) GetScopeType(ctx context.Context) apistructs.ScopeType

func (*PermissionAdaptor) GetUserID

func (this *PermissionAdaptor) GetUserID(ctx context.Context) string

func (*PermissionAdaptor) PermissionList

func (this *PermissionAdaptor) PermissionList(userID string, scopeType apistructs.ScopeType, scopeID int64) (apistructs.PermissionList, error)

func (*PermissionAdaptor) RegisterHandler

func (this *PermissionAdaptor) RegisterHandler(handler PermissionHandler)

func (*PermissionAdaptor) SetCheckRequest

func (*PermissionAdaptor) SetScopeID

func (this *PermissionAdaptor) SetScopeID(ctx context.Context, ScopeID int64) context.Context

func (*PermissionAdaptor) SetScopeType

func (this *PermissionAdaptor) SetScopeType(ctx context.Context, ScopeType apistructs.ScopeType) context.Context

func (*PermissionAdaptor) SetUserID

func (this *PermissionAdaptor) SetUserID(ctx context.Context, userID string) context.Context

type PermissionHandler

type PermissionHandler interface {
	Access(ctx context.Context) bool
	PermissionListProcess(ctx context.Context) PermissionProcess
	CheckProcess(ctx context.Context) PermissionProcess
}

type PermissionProcess

type PermissionProcess interface {
	// contains filtered or unexported methods
}

type PermissionProcessMiddleware

type PermissionProcessMiddleware struct {
	RealProcess  PermissionProcess
	AfterProcess func(context.Context, *apistructs.PermissionList) (*apistructs.PermissionList, error)
	AfterCheck   func(ctx context.Context, check bool) (bool, error)
}

type RolePermissionProcess

type RolePermissionProcess struct {
	Adaptor *PermissionAdaptor
	// contains filtered or unexported fields
}

type SupportUserPermissionHandler

type SupportUserPermissionHandler struct {
	Adaptor *PermissionAdaptor
}

func (SupportUserPermissionHandler) Access

func (SupportUserPermissionHandler) CheckProcess

func (SupportUserPermissionHandler) PermissionListProcess

func (s SupportUserPermissionHandler) PermissionListProcess(ctx context.Context) PermissionProcess

Jump to

Keyboard shortcuts

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