core

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ROLE_GUEST string = "guest"
	ROLE_ADMIN string = "admin"
)
View Source
const (
	//GUEST
	PERMISSION_SNAPSHOT_VIEW string = "view_snapshot"

	//ADMIN
	PERMISSION_ADMIN_MINIMAL string = "admin_minimal"
)

Variables

This section is empty.

Functions

func GetPermissionsByRole

func GetPermissionsByRole(role string) (*hashset.Set, error)

Types

type Handler

type Handler struct {
	api.Handler
}

Handler is the object of http handler

func (Handler) ClusterRequired

func (handler Handler) ClusterRequired(h httprouter.Handle, route ...string) httprouter.Handle

func (Handler) GetAllowedClusters

func (handler Handler) GetAllowedClusters(r *http.Request) ([]string, bool)

func (Handler) GetAllowedIndices

func (handler Handler) GetAllowedIndices(r *http.Request, clusterID string) ([]string, bool)

func (Handler) GetClusterFilter

func (handler Handler) GetClusterFilter(r *http.Request, field string) (util.MapStr, bool)

func (Handler) GetCurrentUser

func (handler Handler) GetCurrentUser(req *http.Request) string

func (Handler) GetCurrentUserClusterIndex

func (handler Handler) GetCurrentUserClusterIndex(req *http.Request, clusterID string) (bool, []string)

func (Handler) GetCurrentUserIndex

func (handler Handler) GetCurrentUserIndex(req *http.Request) (bool, map[string][]string)

func (Handler) IndexRequired

func (handler Handler) IndexRequired(h httprouter.Handle, route ...string) httprouter.Handle

func (Handler) IsIndexAllowed

func (handler Handler) IsIndexAllowed(r *http.Request, clusterID string, indexName string) bool

func (Handler) RequireClusterPermission

func (handler Handler) RequireClusterPermission(h httprouter.Handle, permissions ...string) httprouter.Handle

func (Handler) RequireLogin

func (handler Handler) RequireLogin(h httprouter.Handle) httprouter.Handle

func (Handler) RequirePermission

func (handler Handler) RequirePermission(h httprouter.Handle, permissions ...string) httprouter.Handle

func (Handler) ValidateProxyRequest

func (handler Handler) ValidateProxyRequest(req *http.Request, clusterID string) (bool, string, error)

func (Handler) WriteError added in v1.27.0

func (handler Handler) WriteError(w http.ResponseWriter, err interface{}, status int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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