Documentation ¶
Index ¶
- Variables
- func EnforceSingleContentType(newContentType string)
- func ExtractSpecFromJS(bodyBytes []byte) []byte
- func GenerateRequests(input OpenapiParseInput) ([]string, error)
- func HandleSchemaReference(schema *openapi3.SchemaRef)
- func PrintSpecInfo(i openapi3.Info)
- func SetScheme(swaggerURL string) (scheme string)
- func TrimHostScheme(apiTarget, fullUrlHost string) (host string)
- type CheckSecDefsInput
- type CheckSecDefsOutput
- type Format
- type OpenapiParseInput
- type SchemaReference
- type SecuritySchemeDetails
- type SwaggerRequest
- func (s SwaggerRequest) AddParametersToRequest(op *openapi3.Operation) SwaggerRequest
- func (s SwaggerRequest) BuildDefinedRequests(method string, pathItem *openapi3.PathItem, op *openapi3.Operation) SwaggerRequest
- func (s SwaggerRequest) GetBasePath() string
- func (s SwaggerRequest) IterateOverPaths() SwaggerRequest
- func (s SwaggerRequest) SetParametersFromSchema(param *openapi3.ParameterRef, location, schemaRef string, ...) SwaggerRequest
- type VerboseResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidFormat = errors.New("invalid format specified") ErrFormatDetection = errors.New("unable to detect format") ErrEmptyContent = errors.New("empty content provided") ErrMissingURL = errors.New("URL is required") )
View Source
var DefaultCredentials = struct { BasicAuthUser string BasicAuthPass string BearerToken string ApiKey string }{ BasicAuthUser: "admin", BasicAuthPass: "admin", BearerToken: "default-bearer-token", ApiKey: "default-api-key", }
View Source
var Headers []string
Functions ¶
func EnforceSingleContentType ¶
func EnforceSingleContentType(newContentType string)
func ExtractSpecFromJS ¶
func GenerateRequests ¶
func GenerateRequests(input OpenapiParseInput) ([]string, error)
func HandleSchemaReference ¶
func PrintSpecInfo ¶
func TrimHostScheme ¶
TrimHostScheme trims the scheme from the provided URL if the '-T' flag is supplied to sj.
Types ¶
type CheckSecDefsInput ¶
type CheckSecDefsOutput ¶
type CheckSecDefsOutput struct { ApiInQuery bool `json:"api_in_query"` ApiKey string `json:"api_key,omitempty"` ApiKeyName string `json:"api_key_name,omitempty"` Headers map[string][]string `json:"headers"` SecuritySchemes map[string]SecuritySchemeDetails `json:"security_schemes"` FoundBasicAuth bool `json:"found_basic_auth"` FoundBearerToken bool `json:"found_bearer_token"` FoundApiKey bool `json:"found_api_key"` BasicAuthString string `json:"basic_auth_string,omitempty"` HumanReadableSummary string `json:"human_readable_summary"` Examples map[string]string `json:"examples"` UsedCredentials map[string]string `json:"used_credentials"` }
func CheckSecDefs ¶
func CheckSecDefs(input CheckSecDefsInput) CheckSecDefsOutput
type Format ¶
type Format string
func DetectFormat ¶
func DetectFormatFromContent ¶
func DetectFormatFromHeader ¶
func DetectFormatFromURL ¶
func ValidateFormat ¶
type OpenapiParseInput ¶
type SchemaReference ¶
type SecuritySchemeDetails ¶
type SwaggerRequest ¶
type SwaggerRequest struct { ApiKey string ApiKeyName string ApiInQuery bool BasePath string Body map[string]any BodyData []byte Def *openapi3.T `json:"-"` Path string Paths []string Query url.Values RawQuery string ResultsJSON []string URL url.URL }
func (SwaggerRequest) AddParametersToRequest ¶
func (s SwaggerRequest) AddParametersToRequest(op *openapi3.Operation) SwaggerRequest
This whole function needs to be refactored/cleaned up a bit
func (SwaggerRequest) BuildDefinedRequests ¶
func (s SwaggerRequest) BuildDefinedRequests(method string, pathItem *openapi3.PathItem, op *openapi3.Operation) SwaggerRequest
func (SwaggerRequest) GetBasePath ¶
func (s SwaggerRequest) GetBasePath() string
func (SwaggerRequest) IterateOverPaths ¶
func (s SwaggerRequest) IterateOverPaths() SwaggerRequest
func (SwaggerRequest) SetParametersFromSchema ¶
func (s SwaggerRequest) SetParametersFromSchema(param *openapi3.ParameterRef, location, schemaRef string, req *openapi3.RequestBodyRef, counter int) SwaggerRequest
Click to show internal directories.
Click to hide internal directories.