testing

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Profile

type Profile struct {
	Meta  ProfileMeta   `yaml:"meta"`
	Tests []ProfileTest `yaml:"tests"`
	Rules string        `yaml:"rules"`
	Pass  bool
}

func NewProfile

func NewProfile(path string) (*Profile, error)

NewProfile creates a new profile from a file

type ProfileMeta

type ProfileMeta struct {
	Author      string `yaml:"author"`
	Description string `yaml:"description"`
	Enabled     bool   `yaml:"enabled"`
	Name        string `yaml:"name"`
}

type ProfileTest

type ProfileTest struct {
	Title       string             `yaml:"test_title"`
	Description string             `yaml:"desc"`
	Stages      []ProfileTestStage `yaml:"stages"`
}

type ProfileTestStage

type ProfileTestStage struct {
	Stage ProfileTestStageInner `yaml:"stage"`
	Pass  bool
}

func (*ProfileTestStage) Start

func (stage *ProfileTestStage) Start(waf *engine.Waf) error

Start will begin the test stage

type ProfileTestStageInner

type ProfileTestStageInner struct {
	Input  ProfileTestStageInnerInput  `yaml:"input"`
	Output ProfileTestStageInnerOutput `yaml:"output"`
}

type ProfileTestStageInnerInput

type ProfileTestStageInnerInput struct {
	DestAddr       string            `yaml:"dest_addr"`
	Port           int               `yaml:"port"`
	Method         string            `yaml:"method"`
	Uri            string            `yaml:"uri"`
	Version        string            `yaml:"version"`
	Data           interface{}       `yaml:"data"` //Accepts array or string
	Headers        map[string]string `yaml:"headers"`
	RawRequest     string            `yaml:"raw_request"`
	EncodedRequest string            `yaml:"encoded_request"`
}

type ProfileTestStageInnerOutput

type ProfileTestStageInnerOutput struct {
	LogContains       string      `yaml:"log_contains"`
	NoLogContains     string      `yaml:"no_log_contains"`
	ExpectError       bool        `yaml:"expect_error"`
	TriggeredRules    []int       `yaml:"triggered_rules"`
	NonTriggeredRules []int       `yaml:"non_triggered_rules"`
	Status            interface{} `yaml:"status"`
}

Jump to

Keyboard shortcuts

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