-
-
Notifications
You must be signed in to change notification settings - Fork 136
Merge web api testing development #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…eb-api-testing # Conflicts: # src/hackingBuddyGPT/usecases/web_api_testing/prompt_engineer.py # src/hackingBuddyGPT/usecases/web_api_testing/simple_openapi_documentation.py # src/hackingBuddyGPT/usecases/web_api_testing/simple_web_api_testing.py # src/hackingBuddyGPT/usecases/web_api_testing/utils/llm_handler.py
…eb-api-testing # Conflicts: # src/hackingBuddyGPT/usecases/web_api_testing/documentation/report_handler.py # src/hackingBuddyGPT/usecases/web_api_testing/prompt_generation/information/pentesting_information.py # src/hackingBuddyGPT/usecases/web_api_testing/prompt_generation/prompt_engineer.py # src/hackingBuddyGPT/usecases/web_api_testing/prompt_generation/prompt_generation_helper.py # src/hackingBuddyGPT/usecases/web_api_testing/prompt_generation/prompts/task_planning/chain_of_thought_prompt.py # src/hackingBuddyGPT/usecases/web_api_testing/response_processing/response_analyzer_with_llm.py # src/hackingBuddyGPT/usecases/web_api_testing/simple_web_api_testing.py # src/hackingBuddyGPT/usecases/web_api_testing/utils/llm_handler.py
config/best1050.txt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could those be moved into the test-directory or downloaded on startup? not sure if I want to include these in the github repo...
config/credentials.csv
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could those be moved into the test-directory or downloaded on startup? not sure if I want to include these in the github repo...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be parsed_information and please add a description (docstring) to the class what it is used for
| if self.host[-1] != "/": | ||
| if self.host[-1] != "/" and not path.startswith("/"): | ||
| path = "/" + path | ||
| resp = self._client.request( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused looking at the diff.. now we're not doing this outgoing call anymore? Was it superficial before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR merges the web API testing use case from development into the main branch, updating response processing, prompt generation, documentation reporting, OpenAPI parsing/conversion, and testing capabilities. Key changes include modifying function signatures and parameters in response analyzers, expanding the prompt engineering logic (chain-of-thought, tree-of-thought, in-context learning), and adding/enhancing modules for OpenAPI parsing, pattern matching, and report generation.
Reviewed Changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/hackingBuddyGPT/usecases/web_api_testing/response_processing/response_analyzer_with_llm.py | Updated init and analyze_response signature; added new parameters and recursive processing logic. |
| src/hackingBuddyGPT/usecases/web_api_testing/documentation/parsing/openapi_converter.py | Added new extract_openapi_info method and updated filename conversion logic. |
| Multiple prompt_generation files | Extensive refactoring to support additional prompt strategies and enriched documentation/pentesting steps. |
| Others (report_handler, pattern_matcher, etc.) | Enhancements to PDF report generation, OpenAPI spec handling, and unit test case capabilities. |
| if step != steps[0]: | ||
|
|
||
| current_step = step.get("step") | ||
| prompt_history, raw_response = self.process_step(current_step, prompt_history, "http_request") |
Copilot
AI
May 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The recursive call to analyse_response within the analyze_response method may lead to infinite recursion if a proper termination condition is not met. Consider refactoring or adding explicit base-case checks to prevent potential stack overflows.
| prompt_history, raw_response = self.process_step(current_step, prompt_history, "http_request") | |
| prompt_history, raw_response = self.process_step(current_step, prompt_history, "http_request") | |
| # Ensure termination condition to prevent infinite recursion | |
| if not step.get("step") or step == steps[-1]: # Check if it's the last step | |
| break |
src/hackingBuddyGPT/usecases/web_api_testing/documentation/parsing/openapi_converter.py
Outdated
Show resolved
Hide resolved
…sing/openapi_converter.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Merged Web API Testing use case in Development