Documentation ¶
Index ¶
- type Test
- func (t *Test) DisableMagic()
- func (t *Test) LogContains(log string) bool
- func (t *Test) OutputErrors() []string
- func (t *Test) OutputInterruptionErrors() []string
- func (t *Test) Request() string
- func (t *Test) RunPhases() error
- func (t *Test) SetEncodedRequest(request string) error
- func (t *Test) SetRawRequest(request []byte) error
- func (t *Test) SetRequestBody(body interface{}) error
- func (t *Test) SetResponseBody(body interface{}) error
- func (t *Test) SetWAF(waf coraza.WAF)
- func (t *Test) Transaction() types.Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Test ¶
type Test struct { Name string // public variables // RequestAddress contains the address of the request RequestAddress string // RequestPort contains the port of the request RequestPort int // RequestURI contains the uri of the request RequestURI string // RequestMethod contains the method of the request RequestMethod string // RequestProtocol contains the protocol of the request RequestProtocol string // RequestHeaders contains the headers of the request RequestHeaders map[string]string // ResponseHeaders contains the headers of the response ResponseHeaders map[string]string // ResponseCode contains the response code of the response ResponseCode int // ResponseProtocol contains the protocol of the response ResponseProtocol string // ServerAddress contains the address of the server ServerAddress string // ServerPort contains the port of the server ServerPort int // Expected contains the expected result of the test ExpectedOutput profile.ExpectedOutput // contains filtered or unexported fields }
Test represents a unique transaction within a WAF instance for a test case
func (*Test) DisableMagic ¶
func (t *Test) DisableMagic()
DisableMagic disables the magic flag which auto sets content-type and content-length
func (*Test) LogContains ¶
LogContains checks if the log contains a string
func (*Test) OutputErrors ¶
OutputErrors returns a list of errors that occurred during the test when comparing log and rule ids
func (*Test) OutputInterruptionErrors ¶
OutputInterruptionErrors returns a list of errors that occured when comparing the interruption result
func (*Test) SetEncodedRequest ¶
SetEncodedRequest reads a base64 encoded request and sets it as the current request
func (*Test) SetRawRequest ¶
SetRawRequest reads a raw request and sets it as the current request
func (*Test) SetRequestBody ¶
SetRequestBody sets the request body
func (*Test) SetResponseBody ¶
SetResponseBody sets the request body
func (*Test) Transaction ¶
func (t *Test) Transaction() types.Transaction
Transaction returns the transaction