handlerutil

package
v0.0.0-...-9b5a78d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePatch

func CreatePatch(name, reqJson string, labels map[string]string, deleteKeys []string) []byte

Return value is a document of JSON Patch. JSON Patch format is specified in RFC 6902 from the IETF.

func MutationMessage

func MutationMessage(resourceName string, diffResult []mapnode.Difference) (msg string)

func ValidateHelmReleaseMetadata

func ValidateHelmReleaseMetadata(reqc *common.ReqContext) (bool, error)

func ValidateResource

func ValidateResource(reqc *common.ReqContext, verifierNamespace string) (bool, string)

func ValidateResourceSignature

func ValidateResourceSignature(reqc *common.ReqContext) (bool, error)

func ValidateResourceSigningProfile

func ValidateResourceSigningProfile(reqc *common.ReqContext, verifierNamespace string) (bool, error)

func ValidateSignPolicy

func ValidateSignPolicy(reqc *common.ReqContext) (bool, error)

func ValidateVerifierConfig

func ValidateVerifierConfig(reqc *common.ReqContext) (bool, error)

Types

type ConcreteMutationChecker

type ConcreteMutationChecker struct{}

func (*ConcreteMutationChecker) Eval

type MAResult

type MAResult struct {
	IsMutated   bool
	Diff        string
	Filtered    string
	MatchedKeys []string
	Checked     bool
	Msg         string
	Error       error
}

func GetMAResult

func GetMAResult(ma4kInput *Ma4kInput, rules []*profile.AttrsPattern) (*MAResult, error)

type Ma4kInput

type Ma4kInput struct {
	Before     map[string]interface{} `json:"before"`
	After      map[string]interface{} `json:"after"`
	Namespace  string                 `json:"namespace"`
	UserName   string                 `json:"userName"`
	Kind       string                 `json:"kind"`
	Name       string                 `json:"name"`
	UserGroups []string               `json:"userGroups"`
}

func NewMa4kInput

func NewMa4kInput(namespace, kind, name, username string, usergroups []string, oldObj map[string]interface{}, newObj map[string]interface{}) *Ma4kInput

type MutationChecker

type MutationChecker interface {
	Eval(reqc *common.ReqContext, signingProfile rspapi.ResourceSigningProfile) (*common.MutationEvalResult, error)
}

func NewMutationChecker

func NewMutationChecker() MutationChecker

type PatchOperation

type PatchOperation struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value,omitempty"`
}

Jump to

Keyboard shortcuts

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