policyhandler

package
v1.0.56 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const SelectAllResources = "*"

Variables

View Source
var (
	YAML_PREFIX = []string{".yaml", ".yml"}
	JSON_PREFIX = []string{".json"}
)

Functions

func HTTPRespToString

func HTTPRespToString(resp *http.Response) (string, error)

HTTPRespToString parses the body as string and checks the HTTP status code, it closes the body reader at the end

func JSONDecoder

func JSONDecoder(origin string) *json.Decoder

JSONDecoder returns JSON decoder for given string

func URLEncoder

func URLEncoder(oldURL string) string

URLEncoder encode url

Types

type ArmoAPI

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

func NewArmoAPI

func NewArmoAPI() *ArmoAPI

func (*ArmoAPI) GetHttpClient

func (db *ArmoAPI) GetHttpClient() *http.Client

func (*ArmoAPI) GetServerAddress

func (db *ArmoAPI) GetServerAddress() string

func (*ArmoAPI) OPAFRAMEWORKGet

func (db *ArmoAPI) OPAFRAMEWORKGet(name string) ([]opapolicy.Framework, error)

type FileFormat

type FileFormat string
const (
	YAML_FILE_FORMAT FileFormat = "yaml"
	JSON_FILE_FORMAT FileFormat = "json"
)

type IArmoAPI

type IArmoAPI interface {
	OPAFRAMEWORKGet(string) ([]opapolicy.Framework, error)
}

type PolicyHandler

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

PolicyHandler -

func NewPolicyHandler

func NewPolicyHandler(processPolicy *chan *cautils.OPASessionObj, k8s *k8sinterface.KubernetesApi) *PolicyHandler

CreatePolicyHandler Create ws-handler obj

func (*PolicyHandler) GetPoliciesFromBackend

func (policyHandler *PolicyHandler) GetPoliciesFromBackend(notification *opapolicy.PolicyNotification) ([]opapolicy.Framework, error)

func (*PolicyHandler) HandleNotificationRequest

func (policyHandler *PolicyHandler) HandleNotificationRequest(notification *opapolicy.PolicyNotification, scanInfo *opapolicy.ScanInfo) error

Jump to

Keyboard shortcuts

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