-
-
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
Merged
Merged
Changes from 88 commits
Commits
Show all changes
89 commits
Select commit
Hold shift + click to select a range
856a402
Uploaded changes in branch
1d1d777
Merge remote-tracking branch 'refs/remotes/origin/development' into w…
DianaStrauss 923d6ec
fixed shortening of prompt
DianaStrauss 234e6ef
Merge remote-tracking branch 'refs/remotes/origin/development' into w…
DianaStrauss 629489a
Merged development into web_api_testing
DianaStrauss 64699e3
Fixed shorten prompt bug from merge
DianaStrauss c141954
Updated Tree of thought so that documentation works like chain of tho…
DianaStrauss 3dc2c4b
Implemented in-context learning for documentation
DianaStrauss 53e5c42
refined openapi generation
DianaStrauss ea8795b
Updated Tree of thought so that documentation works like chain of tho…
DianaStrauss 4409f4b
Updated Tree of thought so that documentation works like chain of tho…
DianaStrauss 8ef5f8b
Adjusted to only record valid information of rest api
DianaStrauss 8eb5048
optimized prompt generation
DianaStrauss 294ca7c
Added configs for documentation and testing
DianaStrauss 98b510f
Added way of retrieving spotify token
DianaStrauss 975ae85
Refactored code to work with spotify benchmark
DianaStrauss c70a23b
Refined test cases
DianaStrauss 1fbb37b
Added new security endpoint for testing
DianaStrauss 6fa891d
Added new security endpoint for testing
DianaStrauss 86f8b06
Added more testing information for documentation testing and pentesting
DianaStrauss cee0726
Added evaluations
DianaStrauss e210104
Refactored code to be more understandable
DianaStrauss e228cd8
Added evaluation to documentation
DianaStrauss 3b4b4c4
Refactored code
DianaStrauss 2908860
Restructured testing
DianaStrauss b1f01dc
Refactored code
DianaStrauss 22e64ff
Refactored code so that more endpoints are found
DianaStrauss b103831
Refactored code to be clearer
DianaStrauss e4bbdfa
Added owasp config file and owas openapi sepc
DianaStrauss f5ef612
Fixed some small bgs
DianaStrauss c6d33fe
Adjusted test cases to get better analysis
DianaStrauss 96a400d
Added setup for automatic testing
DianaStrauss b0162fc
refactored test cases
DianaStrauss 3e50596
refactored test cases
DianaStrauss 9306dc6
refactored test cases
DianaStrauss 0f8f445
Refactored tree of thought prompt
DianaStrauss b62bb01
adjusted gitignore
DianaStrauss dd0c17e
Refactored classification of endpoints
DianaStrauss 1af2564
Adjusted test cases for better testing
DianaStrauss 340280e
made continuous testing easier
DianaStrauss 04ebcfa
Adjusted prompts to be more tailored
DianaStrauss 1ff5fa2
Refactored and adjusted code to work also for crapi benchmark
DianaStrauss 4dca56d
Cleaned up code
DianaStrauss 5535eb0
Refactored test cases for better vulnerability coverage
DianaStrauss 4ea54fc
Refactored code
DianaStrauss bf3395b
Added test case
DianaStrauss 1aba1b7
adjusted report
b4e683b
Refactored code
DianaStrauss 285ca9e
Anonymized readme
90f4028
Cleaned up code from prints and unnecessary code
DianaStrauss f9e09b5
Merge remote-tracking branch 'origin/web-api-testing' into web-api-te…
DianaStrauss b0c2b8b
Merge remote-tracking branch 'origin/development' into merge_web_api_…
DianaStrauss 01ee69e
Adjusted code to work with web_api_testing
DianaStrauss 32b73ab
Refactored code for better readability and testing
DianaStrauss 303baf6
added configuration handler to better test
DianaStrauss 4276f0f
Adjusted test of prompt engineer
DianaStrauss 40f4ff1
Adjusted code for test
DianaStrauss c6b7ecd
Adjusted code and tests
44710f3
Adjusted tests and refactored code for better readability
a695971
Added test cases for pentesting information and test handler + refact…
DianaStrauss 6f05e75
Removed unnecessary prints and added documentation
DianaStrauss ac58b5a
Removed unnecessary comments
DianaStrauss 02c861f
Fixed Linter issue
DianaStrauss 3a22053
Fixed test imports for pipeline
DianaStrauss 0d34191
Added needed dependencies to pyproject.toml
DianaStrauss 970b72d
Added needed dependencies to pyproject.toml
DianaStrauss 4366132
Added needed dependencies to pyproject.toml
DianaStrauss 9d16710
Removed test case that breaks pipeline
DianaStrauss 9b78c6c
Adjusted init for test_handler
DianaStrauss 9ea050b
Added needed dependencies to pyproject.toml
DianaStrauss 424c989
Merge branch 'development' into merge_web_api_testing_development
DianaStrauss dbfef99
Added missing dependency
DianaStrauss 696e395
Added missing dependency
DianaStrauss 5e3b112
Added imports in __init__
DianaStrauss a6653ad
Added files
DianaStrauss ca17dd0
Moved config files to proper locatin
DianaStrauss e1b70ab
Merge branch 'development' into merge_web_api_testing_development
DianaStrauss 78b681d
fixed syntax error in .toml
DianaStrauss 8ae94fb
Fix linting
DianaStrauss 9c4842f
Fix linting
DianaStrauss 4d5122f
Fixed wrong import
DianaStrauss 600ed43
Fixed import in testing
DianaStrauss f33c154
Fixed input variables
DianaStrauss e1c8cb4
Fixed input variables
DianaStrauss be0ff19
Fixed input variables
DianaStrauss 985d740
Removed helper files
DianaStrauss 19afc59
Fixed typo in parsed_information.py name
DianaStrauss b5f5688
Fixed typo in parsed_information.py name
DianaStrauss f748d5f
Update src/hackingBuddyGPT/usecases/web_api_testing/documentation/par…
DianaStrauss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,18 +45,11 @@ def __call__( | |
| body_is_base64: Optional[bool] = False, | ||
| headers: Optional[Dict[str, str]] = None, | ||
| ) -> str: | ||
|
|
||
| if body is not None and body_is_base64: | ||
| body = base64.b64decode(body).decode() | ||
| if self.host[-1] != "/": | ||
| if self.host[-1] != "/" and not path.startswith("/"): | ||
| path = "/" + path | ||
| resp = self._client.request( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
| method, | ||
| self.host + path, | ||
| params=query, | ||
| data=body, | ||
| headers=headers, | ||
| allow_redirects=self.follow_redirects, | ||
| ) | ||
| try: | ||
| resp = self._client.request( | ||
| method, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| from dataclasses import dataclass, field | ||
| from typing import Dict, Any, List, Tuple | ||
| from hackingBuddyGPT.capabilities import Capability | ||
|
|
||
|
|
||
| from dataclasses import dataclass, field | ||
| from typing import Any, Dict, List, Tuple | ||
|
|
||
| @dataclass | ||
| class ParsedInformation(Capability): | ||
| status_code: str | ||
| reason_phrase: Dict[str, Any] = field(default_factory=dict) | ||
| headers: Dict[str, Any] = field(default_factory=dict) | ||
| response_body: Dict[str, Any] = field(default_factory=dict) | ||
| registry: List[Tuple[str, str, str, str]] = field(default_factory=list) | ||
|
|
||
| def describe(self) -> str: | ||
| """ | ||
| Returns a description of the test case. | ||
| """ | ||
| return f"Parsed information for {self.status_code}, reason_phrase: {self.reason_phrase}, headers: {self.headers}, response_body: {self.response_body} " | ||
| def __call__(self, status_code: str, reason_phrase: str, headers: str, response_body:str) -> dict: | ||
| self.registry.append((status_code, response_body, headers,response_body)) | ||
|
|
||
| return {"status_code": status_code, "reason_phrase": reason_phrase, "headers": headers, "response_body": response_body} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
|
|
||
| from hackingBuddyGPT.capabilities import Capability | ||
|
|
||
|
|
||
| from dataclasses import dataclass, field | ||
| from typing import Any, Dict, List, Tuple | ||
|
|
||
| @dataclass | ||
| class PythonTestCase(Capability): | ||
| description: str | ||
| input: Dict[str, Any] = field(default_factory=dict) | ||
| expected_output: Dict[str, Any] = field(default_factory=dict) | ||
| registry: List[Tuple[str, dict, dict]] = field(default_factory=list) | ||
|
|
||
| def describe(self) -> str: | ||
| """ | ||
| Returns a description of the test case. | ||
| """ | ||
| return f"Test Case: {self.description}\nInput: {self.input}\nExpected Output: {self.expected_output}" | ||
| def __call__(self, description: str, input: dict, expected_output: dict) -> dict: | ||
| self.registry.append((description, input, expected_output)) | ||
| return {"description": description, "input": input, "expected_output": expected_output} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,6 @@ | ||
| from .simple_openapi_documentation import SimpleWebAPIDocumentation | ||
| from .simple_web_api_testing import SimpleWebAPITesting | ||
| from . import response_processing | ||
| from . import documentation | ||
| from . import prompt_generation | ||
| from . import testing |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.