Skip to content

Refactoring and adding tests#9

Open
dukebarman wants to merge 1 commit into
mainfrom
feedback-refactor
Open

Refactoring and adding tests#9
dukebarman wants to merge 1 commit into
mainfrom
feedback-refactor

Conversation

@dukebarman
Copy link
Copy Markdown
Member

  • Fixed response validation to use actual response bodies and response headers.
  • Fixed OpenAPI server/base path handling, including empty servers[].url values when -url is
    provided.
  • Added HTTP timeouts for fuzzing and authentication requests.
  • Fixed request validation error reporting and reset request bodies after validation.
  • Improved report file generation to avoid filename collisions and prevent JSON reports from leaking
    to stderr.
  • Hardened random input generation against invalid or unbounded lengths.
  • Made the Petstore demo Docker script idempotent and explicit about platform.
  • Added unit tests for URL building, OpenAPI server normalization, response validation, report file
    creation, and bounded input generation.

Comment thread logging/logging.go

// defer file.Close()
timestamp := time.Now().Format("20060102_150405")
file, err := os.CreateTemp(outputDir, sanitizedBase+"_"+timestamp+"_*.json")
Comment thread logging/logging.go
Comment on lines +81 to +94
entry := reportLog.WithFields(logrus.Fields{
"raw_path": response.Request.URL.RawPath,
"method": response.Request.Method,
"status": response.Status,
"path": response.Request.URL.Path,
"query": response.Request.URL.RawQuery,
"headers": response.Request.Header,
"response_headers": response.Header,
"cookies": response.Request.Cookies(),
"body_payload": string(requestBody),
"request_validation": requestValidationError,
"response_body": string(responseBody),
"response_validation": errval,
}).Info("Test")
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants