Documentation ¶
Index ¶
- Constants
- Variables
- type Active
- type ChangeHTTPMethodType
- type Config
- type FileProvider
- func (fp FileProvider) Actives() []*Active
- func (fp FileProvider) ActivesEnabled() []*Active
- func (fp FileProvider) From() []string
- func (fp FileProvider) PassiveReqs() []*Request
- func (fp FileProvider) PassiveReqsEnabled() []*Request
- func (fp FileProvider) PassiveRes() []*Response
- func (fp FileProvider) PassiveResEnabled() []*Response
- func (fp FileProvider) Tags() []string
- type Grep
- type GrepOperator
- type GrepOption
- type GrepType
- func (gt GrepType) BlindHost() bool
- func (gt GrepType) ContentLength() bool
- func (gt GrepType) ContentLengthDiff() bool
- func (gt GrepType) ContentType() bool
- func (gt GrepType) ContentURLExtension() bool
- func (gt GrepType) Payload() bool
- func (gt GrepType) PreEncodedPayload() bool
- func (gt GrepType) Regex() bool
- func (gt GrepType) SimpleString() bool
- func (gt GrepType) StatusCode() bool
- func (gt GrepType) String() string
- func (gt GrepType) TimeDelay() bool
- type GrepValue
- func (v GrepValue) AsContentLength() int
- func (v GrepValue) AsContentTypes() []string
- func (v GrepValue) AsPayload() string
- func (v GrepValue) AsPreEncodedPayload() string
- func (v GrepValue) AsRegex() string
- func (v GrepValue) AsStatusCodes() []int
- func (v GrepValue) AsString() string
- func (v GrepValue) AsTimeDelaySeconds() int
- func (v GrepValue) AsURLExtensions() []string
- func (v GrepValue) Replace(rr map[string]string) GrepValue
- type InsertionPointMode
- type InsertionPointType
- type IssueInformation
- type MatchAndReplace
- type MatchAndReplaceRegex
- type MatchAndReplaceType
- type PayloadPosition
- type Profile
- type Provider
- type Redirect
- type Request
- func (r Request) GetIssueBackground() string
- func (r Request) GetIssueConfidence() string
- func (r Request) GetIssueDetail() string
- func (r Request) GetIssueName() string
- func (r Request) GetIssueSeverity() string
- func (r Request) GetName() string
- func (r Request) GetRemediationBackground() string
- func (r Request) GetRemediationDetail() string
- func (r Request) GetTags() []string
- func (r Request) GetType() Type
- func (r Request) GrepAt(idx int, rr map[string]string) (Grep, error)
- func (r Request) IsEnabled() bool
- type RequestType
- type Response
- func (p Response) GetIssueBackground() string
- func (p Response) GetIssueConfidence() string
- func (p Response) GetIssueDetail() string
- func (p Response) GetIssueName() string
- func (p Response) GetIssueSeverity() string
- func (p Response) GetName() string
- func (p Response) GetRemediationBackground() string
- func (p Response) GetRemediationDetail() string
- func (p Response) GetTags() []string
- func (p Response) GetType() Type
- func (p Response) GrepAt(idx int, rr map[string]string) (Grep, error)
- func (p Response) IsEnabled() bool
- type ShowAlertType
- type Step
- func (s Step) GetIssueBackground() string
- func (s Step) GetIssueConfidence() string
- func (s Step) GetIssueDetail() string
- func (s Step) GetIssueName() string
- func (s Step) GetIssueSeverity() string
- func (s Step) GetRemediationBackground() string
- func (s Step) GetRemediationDetail() string
- func (s Step) GetToPost() bool
- func (s Step) GrepAt(idx int, rr map[string]string) (Grep, error)
- func (s Step) HasBHGrepType() bool
- func (s Step) InsertionPointEnabled(ipt InsertionPointType, method string) bool
- func (s Step) MaxRedirects() int
- func (s Step) PayloadAt(idx int) (bool, string, error)
- func (s Step) PayloadAtEncoded(idx int) (bool, string, error)
- func (s Step) PostToGet() bool
- func (s Step) RedirectType() Redirect
- func (s Step) SwapGetAndPost() bool
- type Type
- type ZipProvider
- func (zp ZipProvider) Actives() []*Active
- func (zp ZipProvider) ActivesEnabled() []*Active
- func (zp ZipProvider) From() []string
- func (zp ZipProvider) PassiveReqs() []*Request
- func (zp ZipProvider) PassiveReqsEnabled() []*Request
- func (zp ZipProvider) PassiveRes() []*Response
- func (zp ZipProvider) PassiveResEnabled() []*Response
- func (zp ZipProvider) Tags() []string
Constants ¶
const (
FileExtension = ".bb2"
)
Variables ¶
var ( ErrInvalidGrepEnabled = errors.New("invalid grep enabled") ErrInvalidGrepOperator = errors.New("invalid grep operator") ErrInvalidGrepType = errors.New("invalid grep type") ErrInvalidGrepOption = errors.New("invalid grep option") ErrInvalidStatusCode = errors.New("invalid status code") ErrInvalidTimeDelay = errors.New("invalid time delay") ErrInvalidContentLength = errors.New("invalid content length") ErrInvalidURLExtension = errors.New("invalid url extension") )
var ( ErrInvalidPayloadIdx = errors.New("invalid payload index") ErrInvalidPayloadBool = errors.New("invalid payload bool") ErrInvalidPayloadFormat = errors.New("invalid payload format") ErrInvalidGrepIdx = errors.New("invalid grep index") )
var ( ErrProfilePath = errors.New("cannot read profile path") ErrUnknownType = errors.New("unknown profile type") )
var ErrMissingProfiles = errors.New("missing profiles")
Functions ¶
This section is empty.
Types ¶
type Active ¶
type Active struct { // Basic information Name string `json:"profile_name"` Enabled bool `json:"enabled"` Type Type `json:"scanner"` Author string `json:"author"` Tags []string `json:"Tags"` Steps []Step `json:"steps"` }
Active represents an active profile.
type ChangeHTTPMethodType ¶
type ChangeHTTPMethodType string
ChangeHTTPMethodType represents the type of change to be made to the HTTP method during the scan. It can be PostToGet, GetToPost, or SwapGetAndPost.
const ( ChangePostToGet ChangeHTTPMethodType = "post_to_get" ChangeGetToPost ChangeHTTPMethodType = "get_to_post" ChangeSwapGetAndPost ChangeHTTPMethodType = "get_post_get" )
func (ChangeHTTPMethodType) GetToPost ¶
func (t ChangeHTTPMethodType) GetToPost() bool
GetToPost returns true if the change is from GET to POST.
func (ChangeHTTPMethodType) PostToGet ¶
func (t ChangeHTTPMethodType) PostToGet() bool
PostToGet returns true if the change is from POST to GET.
func (ChangeHTTPMethodType) SwapGetAndPost ¶
func (t ChangeHTTPMethodType) SwapGetAndPost() bool
SwapGetAndPost returns true if the change is from GET to POST and vice versa.
type Config ¶
type Config struct {
Path string `default:"profiles"`
}
Config is the configuration for the FileProvider.
func (Config) ProfilesPath ¶
ProfilesPath returns the path to the profiles' directory.
type FileProvider ¶
type FileProvider struct {
// contains filtered or unexported fields
}
FileProvider is an implementation of the Provider interface that reads profiles from one or multiple file system locations.
func NewFileProvider ¶
func NewFileProvider(locations ...string) (FileProvider, error)
NewFileProvider creates a new FileProvider instance.
func (FileProvider) Actives ¶
func (fp FileProvider) Actives() []*Active
Actives returns all the active profiles loaded from file system.
func (FileProvider) ActivesEnabled ¶
func (fp FileProvider) ActivesEnabled() []*Active
ActivesEnabled returns all the active profiles loaded from the file system that are enabled.
func (FileProvider) From ¶
func (fp FileProvider) From() []string
From returns the locations from where the profiles were loaded.
func (FileProvider) PassiveReqs ¶
func (fp FileProvider) PassiveReqs() []*Request
PassiveReqs returns all the passive request profiles loaded from file system.
func (FileProvider) PassiveReqsEnabled ¶
func (fp FileProvider) PassiveReqsEnabled() []*Request
PassiveReqsEnabled returns all the passive request profiles loaded from the file system that are enabled.
func (FileProvider) PassiveRes ¶
func (fp FileProvider) PassiveRes() []*Response
PassiveRes returns all the passive response profiles loaded from file system.
func (FileProvider) PassiveResEnabled ¶
func (fp FileProvider) PassiveResEnabled() []*Response
PassiveResEnabled returns all the passive response profiles loaded from the file system that are enabled.
func (FileProvider) Tags ¶
func (fp FileProvider) Tags() []string
Tags returns all the tags found in the profiles loaded from the file system.
type Grep ¶
type Grep struct { Enabled bool Operator GrepOperator Type GrepType Value GrepValue Option GrepOption Where string // only used for passive profiles (requests) }
Grep represents a Grep directive, used to identify matches during active and passive scans.
type GrepOperator ¶
type GrepOperator string
GrepOperator represents a Grep operator, used to combine multiple Grep directives within the same step/profile.
const ( GrepOperatorNone GrepOperator = "" GrepOperatorAnd GrepOperator = "AND" GrepOperatorAndNot GrepOperator = "AND NOT" GrepOperatorOr GrepOperator = "OR" GrepOperatorOrNot GrepOperator = "OR NOT" )
func (GrepOperator) And ¶
func (op GrepOperator) And() bool
And returns whether the operator is AND.
func (GrepOperator) AndNot ¶
func (op GrepOperator) AndNot() bool
AndNot returns whether the operator is AND NOT.
func (GrepOperator) Match ¶
func (op GrepOperator) Match(x, y bool) bool
Match returns the result of the operator applied to the two given boolean values. So, basic logic operations are performed.
func (GrepOperator) None ¶
func (op GrepOperator) None() bool
None returns whether the operator is None.
func (GrepOperator) OrNot ¶
func (op GrepOperator) OrNot() bool
OrNot returns whether the operator is OR NOT.
type GrepOption ¶
type GrepOption string
GrepOption represents a Grep option, used to determine how the value should be matched.
const ( GrepOptionNone GrepOption = "" GrepOptionCaseSensitive GrepOption = "Case sensitive" GrepOptionOnlyInHeaders GrepOption = "Only in Headers" GrepOptionNotInHeaders GrepOption = "Not in Headers" )
func (GrepOption) CaseSensitive ¶
func (opt GrepOption) CaseSensitive() bool
CaseSensitive returns whether the GrepOption is CaseSensitive.
func (GrepOption) None ¶
func (opt GrepOption) None() bool
None returns whether the GrepOption is None.
func (GrepOption) NotInHeaders ¶
func (opt GrepOption) NotInHeaders() bool
NotInHeaders returns whether the GrepOption is NotInHeaders.
func (GrepOption) OnlyInHeaders ¶
func (opt GrepOption) OnlyInHeaders() bool
OnlyInHeaders returns whether the GrepOption is OnlyInHeaders.
func (GrepOption) String ¶
func (opt GrepOption) String() string
String returns the string representation of the GrepOption.
type GrepType ¶
type GrepType string
GrepType represents a Grep type, used to determine the type of the value that should be matched.
const ( GrepTypeSimpleString GrepType = "Simple String" GrepTypeRegex GrepType = "Regex" GrepTypeBlindHost GrepType = "Blind Host" GrepTypeStatusCode GrepType = "Status Code" GrepTypeTimeDelay GrepType = "Time Delay" GrepTypeContentType GrepType = "Content Type" GrepTypeContentLength GrepType = "Content Length" GrepTypeContentLengthDiff GrepType = "Content Length Diff" GrepTypeURLExtension GrepType = "URL Extension" GrepTypePayload GrepType = "Payload" GrepTypePreEncodedPayload GrepType = "Pre-Encoded Payload" )
func (GrepType) ContentLength ¶
ContentLength returns whether the GrepType is ContentLength.
func (GrepType) ContentLengthDiff ¶
ContentLengthDiff returns whether the GrepType is ContentLengthDiff.
func (GrepType) ContentType ¶
ContentType returns whether the GrepType is ContentType.
func (GrepType) ContentURLExtension ¶
ContentURLExtension returns whether the GrepType is URLExtension.
func (GrepType) PreEncodedPayload ¶
PreEncodedPayload returns whether the GrepType is PreEncodedPayload.
func (GrepType) SimpleString ¶
SimpleString returns whether the GrepType is SimpleString.
func (GrepType) StatusCode ¶
StatusCode returns whether the GrepType is StatusCode.
type GrepValue ¶
type GrepValue string
GrepValue represents the value of a Grep directive.
func (GrepValue) AsContentLength ¶
AsContentLength returns the GrepValue as an integer that represents the content length.
func (GrepValue) AsContentTypes ¶
AsContentTypes returns the GrepValue as a slice of content types (strings).
func (GrepValue) AsPreEncodedPayload ¶
AsPreEncodedPayload returns the GrepValue as a string.
func (GrepValue) AsStatusCodes ¶
AsStatusCodes returns the GrepValue as a slice of status codes (integers).
func (GrepValue) AsTimeDelaySeconds ¶
AsTimeDelaySeconds returns the GrepValue as an integer that represents the time delay in seconds.
func (GrepValue) AsURLExtensions ¶
AsURLExtensions returns the GrepValue as a slice of URL extensions (strings).
type InsertionPointMode ¶
type InsertionPointMode string
InsertionPointMode represents the mode of the insertion point.
const ( InsertionPointModeAny InsertionPointMode = "any" InsertionPointModeSame InsertionPointMode = "same" )
func (InsertionPointMode) Any ¶
func (ipm InsertionPointMode) Any() bool
Any returns true if the insertion point mode is any.
func (InsertionPointMode) Same ¶
func (ipm InsertionPointMode) Same() bool
Same returns true if the insertion point mode is same.
type InsertionPointType ¶
type InsertionPointType string
InsertionPointType represents the type of insertion point.
const ( ParamURLValue InsertionPointType = "param_url" ParamBodyValue InsertionPointType = "param_body" CookieValue InsertionPointType = "param_cookie" ParamXMLValue InsertionPointType = "param_xml" ParamXMLAttrValue InsertionPointType = "param_xml_attr" ParamMultiAttrValue InsertionPointType = "param_multipart_attr" ParamJSONValue InsertionPointType = "param_json" CookieName InsertionPointType = "param_name_cookie" ParamXMLName InsertionPointType = "param_name_xml" URLPathFolder InsertionPointType = "url_path_folder" ParamURLName InsertionPointType = "param_name_url" ParamBodyName InsertionPointType = "param_name_body" EntireBodyXML InsertionPointType = "entire_body_xml" URLPathFile InsertionPointType = "url_path_filename" ParamXMLAttrName InsertionPointType = "param_name_xml_attr" ParamMultiAttrName InsertionPointType = "param_name_multi_part_attr" ParamJSONName InsertionPointType = "param_name_json" MultiplePathDiscovery InsertionPointType = "extension_provice" SinglePathDiscovery InsertionPointType = "single_path_discovery" HeaderUserAgent InsertionPointType = "user_agent" HeaderReferer InsertionPointType = "referer" HeaderOrigin InsertionPointType = "origin" HeaderHost InsertionPointType = "host" HeaderContentType InsertionPointType = "content_type" HeaderAccept InsertionPointType = "accept" HeaderAcceptLanguage InsertionPointType = "accept_language" HeaderAcceptEncoding InsertionPointType = "accept_encoding" HeaderNew InsertionPointType = "new_headers" EntireBody InsertionPointType = "entire_body" EntireBodyJSON InsertionPointType = "entire_body_json" EntireBodyMulti InsertionPointType = "entire_body_multipart" )
func (InsertionPointType) String ¶
func (i InsertionPointType) String() string
String returns the string representation of the insertion point type.
type IssueInformation ¶
type IssueInformation interface { GetIssueName() string GetIssueSeverity() string GetIssueConfidence() string GetIssueDetail() string GetIssueBackground() string GetRemediationDetail() string GetRemediationBackground() string }
IssueInformation represents the information of an issue. It can be part of a step (active) or a scan profile (passive).
type MatchAndReplace ¶
type MatchAndReplace struct { Type MatchAndReplaceType `json:"type"` Match string `json:"match"` Replace string `json:"replace"` Regex MatchAndReplaceRegex `json:"regex"` }
MatchAndReplace represents a match and replace operation.
type MatchAndReplaceRegex ¶
type MatchAndReplaceRegex string
MatchAndReplaceRegex represents the type of match and replace operation.
const ( MatchAndReplaceString MatchAndReplaceRegex = "String" MatchAndReplaceRegexp MatchAndReplaceRegex = "Regex" )
func (MatchAndReplaceRegex) Regex ¶
func (r MatchAndReplaceRegex) Regex() bool
Regex returns true if the match and replace operation is for a regular expression.
func (MatchAndReplaceRegex) String ¶
func (r MatchAndReplaceRegex) String() bool
String returns true if the match and replace operation is for a string.
type MatchAndReplaceType ¶
type MatchAndReplaceType string
MatchAndReplaceType represents the type of match and replace operation.
const ( MatchAndReplaceRequest MatchAndReplaceType = "Request" MatchAndReplacePayload MatchAndReplaceType = "Payload" )
func (MatchAndReplaceType) Payload ¶
func (t MatchAndReplaceType) Payload() bool
Payload returns true if the match and replace operation is for the payload.
func (MatchAndReplaceType) Request ¶
func (t MatchAndReplaceType) Request() bool
Request returns true if the match and replace operation is for the request.
type PayloadPosition ¶
type PayloadPosition string
PayloadPosition represents the position of the payload.
const ( Replace PayloadPosition = "replace" Append PayloadPosition = "append" Insert PayloadPosition = "insert" )
type Profile ¶
Profile represents the behavior expected from a scan profile. It can be a passive or active profile (e.g. Active).
type Provider ¶
type Provider interface { Actives() []*Active ActivesEnabled() []*Active PassiveReqs() []*Request PassiveReqsEnabled() []*Request PassiveRes() []*Response PassiveResEnabled() []*Response Tags() []string From() []string }
Provider is the interface that defines the expected behavior of a profile provider.
For instance, the FileProvider provides profiles from one or multiple file-disk location.
type Redirect ¶
type Redirect int
Redirect represents the redirect type.
type Request ¶
type Request struct { // Basic information Name string `json:"profile_name"` Enabled bool `json:"enabled"` Type Type `json:"scanner"` Author string `json:"author"` Tags []string `json:"Tags"` Greps []string `json:"grep"` // Issue information IssueName string `json:"issue_name"` IssueSeverity string `json:"issue_severity"` IssueConfidence string `json:"issue_confidence"` IssueDetail string `json:"issue_detail"` RemediationDetail string `json:"remediation_detail"` IssueBackground string `json:"issue_background"` RemediationBackground string `json:"remediation_background"` }
Request represents a passive request profile.
func (Request) GetIssueBackground ¶
GetIssueBackground returns the issue background associated with the request profile.
func (Request) GetIssueConfidence ¶
GetIssueConfidence returns the issue confidence associated with the request profile.
func (Request) GetIssueDetail ¶
GetIssueDetail returns the issue detail associated with the request profile.
func (Request) GetIssueName ¶
GetIssueName returns the issue name associated with the request profile.
func (Request) GetIssueSeverity ¶
GetIssueSeverity returns the issue severity associated with the request profile.
func (Request) GetRemediationBackground ¶
GetRemediationBackground returns the remediation background associated with the request profile.
func (Request) GetRemediationDetail ¶
GetRemediationDetail returns the remediation detail associated with the request profile.
type RequestType ¶
type RequestType string
RequestType represents the type of request.
const ( OriginalRequest RequestType = "original" RawRequest RequestType = "raw_request" )
func (RequestType) OriginalRequest ¶
func (rt RequestType) OriginalRequest() bool
OriginalRequest returns true if the request type is original.
func (RequestType) RawRequest ¶
func (rt RequestType) RawRequest() bool
RawRequest returns true if the request type is raw.
type Response ¶
type Response struct { // Basic information Name string `json:"profile_name"` Enabled bool `json:"enabled"` Type Type `json:"scanner"` Author string `json:"author"` Tags []string `json:"Tags"` Greps []string `json:"grep"` // Issue information IssueName string `json:"issue_name"` IssueSeverity string `json:"issue_severity"` IssueConfidence string `json:"issue_confidence"` IssueDetail string `json:"issue_detail"` RemediationDetail string `json:"remediation_detail"` IssueBackground string `json:"issue_background"` RemediationBackground string `json:"remediation_background"` }
Response represents a passive response profile.
func (Response) GetIssueBackground ¶
GetIssueBackground returns the issue background associated with the response profile.
func (Response) GetIssueConfidence ¶
GetIssueConfidence returns the issue confidence associated with the response profile.
func (Response) GetIssueDetail ¶
GetIssueDetail returns the issue detail associated with the response profile.
func (Response) GetIssueName ¶
GetIssueName returns the issue name associated with the response profile.
func (Response) GetIssueSeverity ¶
GetIssueSeverity returns the issue severity associated with the response profile.
func (Response) GetRemediationBackground ¶
GetRemediationBackground returns the remediation background associated with the response profile.
func (Response) GetRemediationDetail ¶
GetRemediationDetail returns the remediation detail associated with the response profile.
type ShowAlertType ¶
type ShowAlertType string
ShowAlertType represents the type of alert to show.
const ( ShowAlertNone ShowAlertType = "none" ShowAlertOne ShowAlertType = "one" ShowAlertAlways ShowAlertType = "always" )
func (ShowAlertType) Always ¶
func (t ShowAlertType) Always() bool
Always returns true if the alert type is always.
func (ShowAlertType) Enabled ¶
func (t ShowAlertType) Enabled() bool
Enabled returns true if the alert type is one or always.
func (ShowAlertType) None ¶
func (t ShowAlertType) None() bool
None returns true if the alert type is none.
func (ShowAlertType) One ¶
func (t ShowAlertType) One() bool
One returns true if the alert type is one.
type Step ¶
type Step struct { RequestType RequestType `json:"request_type"` InsertionPoint InsertionPointMode `json:"insertion_point"` RawRequest string `json:"raw_request"` Payloads []string `json:"payloads"` PayloadPosition PayloadPosition `json:"payload_position"` ChangeHTTPMethod bool `json:"change_http_request"` ChangeHTTPMethodType ChangeHTTPMethodType `json:"change_http_request_type"` InsertionPoints []InsertionPointType `json:"insertion_points"` CustomHeaders []string `json:"new_headers"` MatchAndReplaces []MatchAndReplace `json:"match_replace"` Encoder []string `json:"encoder"` URLEncode bool `json:"url_encode"` CharsToURLEncode string `json:"chars_to_url_encode"` Greps []string `json:"grep"` RedirType string `json:"redir_type"` MaxRedir int `json:"max_redir"` // Issue information ShowAlert ShowAlertType `json:"show_alert"` IssueName string `json:"issue_name"` IssueSeverity string `json:"issue_severity"` IssueConfidence string `json:"issue_confidence"` IssueDetail string `json:"issue_detail"` RemediationDetail string `json:"remediation_detail"` IssueBackground string `json:"issue_background"` RemediationBackground string `json:"remediation_background"` }
Step represents a single step, part of an Active profile.
func (Step) GetIssueBackground ¶
GetIssueBackground returns the issue background associated with the step.
func (Step) GetIssueConfidence ¶
GetIssueConfidence returns the issue confidence associated with the step.
func (Step) GetIssueDetail ¶
GetIssueDetail returns the issue detail associated with the step.
func (Step) GetIssueName ¶
GetIssueName returns the issue name associated with the step.
func (Step) GetIssueSeverity ¶
GetIssueSeverity returns the issue severity associated with the step.
func (Step) GetRemediationBackground ¶
GetRemediationBackground returns the remediation background associated with the step.
func (Step) GetRemediationDetail ¶
GetRemediationDetail returns the remediation detail associated with the step.
func (Step) GetToPost ¶
GetToPost returns false if ChangeHTTPMethod is false. Otherwise, returns p.ChangeHTTPMethodType.GetToPost().
func (Step) GrepAt ¶
GrepAt returns the grep at the given index. In case the index is out of range, or the format is invalid, an error is returned.
func (Step) HasBHGrepType ¶
HasBHGrepType returns true if the step has a GrepTypeBlindHost grep.
func (Step) InsertionPointEnabled ¶
func (s Step) InsertionPointEnabled(ipt InsertionPointType, method string) bool
InsertionPointEnabled returns true if the step has the given insertion point enabled.
The method parameter is used to make the decision based on the HTTP method and ChangeHTTPMethodType.
func (Step) MaxRedirects ¶
MaxRedirects is a helper function that returns the maximum number of redirects to follow.
func (Step) PayloadAt ¶
PayloadAt returns the payload at the given index, and whether it is enabled or not. In case the index is out of range, or the format is invalid, an error is returned.
func (Step) PayloadAtEncoded ¶
PayloadAtEncoded is the equivalent of PayloadAt, but it returns the Payload encoded, if so.
func (Step) PostToGet ¶
PostToGet returns false if ChangeHTTPMethod is false. Otherwise, returns p.ChangeHTTPMethodType.PostToGet().
func (Step) RedirectType ¶
RedirectType is a helper function that returns the allowed redirect type based on the profile.
func (Step) SwapGetAndPost ¶
SwapGetAndPost returns false if ChangeHTTPMethod is false. Otherwise, returns p.ChangeHTTPMethodType.SwapGetAndPost().
type Type ¶
type Type string
Type represents the type of profile.
func (Type) PassiveReq ¶
PassiveReq returns true if the profile type is passive request.
func (Type) PassiveRes ¶
PassiveRes returns true if the profile type is passive response.
type ZipProvider ¶
type ZipProvider struct {
// contains filtered or unexported fields
}
ZipProvider is a profile provider that reads profiles from a zip file.
func NewMultipartFromProvider ¶
NewMultipartFromProvider reads the profiles from a multipart form.
func NewZipProvider ¶
func NewZipProvider(ctx context.Context, contents []byte) (ZipProvider, error)
NewZipProvider creates a new ZipProvider from the given zip file contents.
func (ZipProvider) Actives ¶
func (zp ZipProvider) Actives() []*Active
Actives returns the active profiles loaded from the zip file.
func (ZipProvider) ActivesEnabled ¶
func (zp ZipProvider) ActivesEnabled() []*Active
ActivesEnabled returns the active profiles loaded from the zip file that are enabled.
func (ZipProvider) From ¶
func (zp ZipProvider) From() []string
From returns the locations of the profiles loaded from the zip file.
func (ZipProvider) PassiveReqs ¶
func (zp ZipProvider) PassiveReqs() []*Request
PassiveReqs returns the passive request profiles loaded from the zip file.
func (ZipProvider) PassiveReqsEnabled ¶
func (zp ZipProvider) PassiveReqsEnabled() []*Request
PassiveReqsEnabled returns the passive request profiles loaded from the zip file that are enabled.
func (ZipProvider) PassiveRes ¶
func (zp ZipProvider) PassiveRes() []*Response
PassiveRes returns the passive response profiles loaded from the zip file.
func (ZipProvider) PassiveResEnabled ¶
func (zp ZipProvider) PassiveResEnabled() []*Response
PassiveResEnabled returns the passive response profiles loaded from the zip file that are enabled.
func (ZipProvider) Tags ¶
func (zp ZipProvider) Tags() []string
Tags returns the tags of the profiles loaded from the zip file.