Skip to content

Commit e210104

Browse files
committed
Refactored code to be more understandable
1 parent cee0726 commit e210104

21 files changed

+11912
-177
lines changed

‎src/hackingBuddyGPT/usecases/web_api_testing/configs/hard/oas/openbrewerydb_oas.json‎

Lines changed: 1998 additions & 0 deletions
Large diffs are not rendered by default.

‎src/hackingBuddyGPT/usecases/web_api_testing/configs/hard/oas/reqres_oas.json‎

Lines changed: 2772 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"token": "your_api_token_here",
3+
"host": "https://api.openbrewerydb.org",
4+
"description": "**Disclaimer** - This *OpenAPI* specification is generated with the tool *RESTSpecIT*, which leverages *GPT* Large Language Models. Even though the tool verifies as much as possible the model responses, mistakes and/or inaccuracies may be found in the generated specification. Thus, data such as the license or the e-mail of the API should still be manually verified. Moreover, invalid API parameters are often ignored in *nearly* valid requests, as RESTful APIs tend to apply the **robustness principle**. This principle states that *programs receiving messages should accept non-conformant input as long as the meaning is clear*. As the validity of such parameters is complicated to verify, some described parameters may result in false positives. Query parameters that were found but did not specify a value have their type set to **x-null**.<br><br>**Be Reassured** - The tool *RESTSpecIT* has been thouroughly tested on various APIs, demonstrating an average route and parameter discovery rate of over x%. Additionally, the tool is capable of discovering undocumented features of APIs, which was verified with x of the tested APIs.<br><br>**API Description** - The Open Brewery DB API is an open-source database that provides information about breweries worldwide.",
5+
"correct_endpoints": [
6+
"/breweries",
7+
"/breweries/random",
8+
"/breweries/search",
9+
"/breweries/autocomplete"
10+
],
11+
"query_params": {
12+
"/breweries": [
13+
"by_city",
14+
"by_state",
15+
"per_page",
16+
"by_name",
17+
"by_tag",
18+
"by_type",
19+
"by_postal",
20+
"sort",
21+
"page",
22+
"query",
23+
"by_tagged"
24+
],
25+
"/breweries/random": [
26+
"by_city",
27+
"by_state",
28+
"by_name",
29+
"by_tag",
30+
"by_type"
31+
],
32+
"/breweries/search": [
33+
"by_city",
34+
"by_state",
35+
"query",
36+
"by_name",
37+
"by_tag",
38+
"by_postal",
39+
"by_distance",
40+
"by_tags",
41+
"per_page",
42+
"sort",
43+
"page",
44+
"q",
45+
"by_type",
46+
"by_country",
47+
"by_tagged",
48+
"by_street",
49+
"by_phone",
50+
"by_website",
51+
"name",
52+
"city",
53+
"state",
54+
"country",
55+
"type",
56+
"tag",
57+
"phone",
58+
"postal",
59+
"website"
60+
],
61+
"/breweries/autocomplete": [
62+
"by_city",
63+
"by_state",
64+
"by_name",
65+
"by_type",
66+
"by_tag",
67+
"by_postal",
68+
"by_country",
69+
"by_phone",
70+
"by_website",
71+
"per_page",
72+
"by_tags",
73+
"page",
74+
"sort"
75+
]
76+
}
77+
}
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
{
2+
"token": "your_api_token_here",
3+
"host": "https://reqres.in",
4+
"description": "**Disclaimer** - This *OpenAPI* specification is generated with the tool *RESTSpecIT*, which leverages *GPT* Large Language Models. Even though the tool verifies as much as possible the model responses, mistakes and/or inaccuracies may be found in the generated specification. Thus, data such as the license or the e-mail of the API should still be manually verified. Moreover, invalid API parameters are often ignored in *nearly* valid requests, as RESTful APIs tend to apply the **robustness principle**. This principle states that *programs receiving messages should accept non-conformant input as long as the meaning is clear*. As the validity of such parameters is complicated to verify, some described parameters may result in false positives. Query parameters that were found but did not specify a value have their type set to **x-null**.<br><br>**Be Reassured** - The tool *RESTSpecIT* has been thouroughly tested on various APIs, demonstrating an average route and parameter discovery rate of over x%. Additionally, the tool is capable of discovering undocumented features of APIs, which was verified with x of the tested APIs.<br><br>**API Description** - ReqRes API is a testing API that allows developers to simulate RESTful interactions.",
5+
"correct_endpoints": [
6+
"/api/users",
7+
"/api/users/{id}",
8+
"/api/products",
9+
"/api/login",
10+
"/api/register",
11+
"/api/comments",
12+
"/api/categories",
13+
"/api/photos",
14+
"/api/events",
15+
"/api/invoices",
16+
"/api/jobs",
17+
"/api/{id}",
18+
"/api/orders",
19+
"/api/dashboard",
20+
"/api/products/{id}",
21+
"/api/settings",
22+
"/api/messages",
23+
"/api/todos",
24+
"/api/posts",
25+
"/api/resources",
26+
"/api/teams"
27+
],
28+
"query_params": {
29+
"/api/users": [
30+
"page",
31+
"per_page",
32+
"price"
33+
],
34+
"/api/users/{id}": [
35+
"page",
36+
"name",
37+
"delay",
38+
"sort",
39+
"per_page",
40+
"filter",
41+
"search",
42+
"order",
43+
"role",
44+
"status",
45+
"limit"
46+
],
47+
"/api/products": [
48+
"page",
49+
"category",
50+
"per_page",
51+
"sort",
52+
"price",
53+
"color",
54+
"size",
55+
"brand"
56+
],
57+
"/api/login": [
58+
"page",
59+
"username",
60+
"password",
61+
"id",
62+
"name",
63+
"email",
64+
"job",
65+
"age",
66+
"gender",
67+
"city",
68+
"country",
69+
"role",
70+
"price"
71+
],
72+
"/api/register": [
73+
"page",
74+
"email",
75+
"password",
76+
"username",
77+
"price"
78+
],
79+
"/api/comments": [
80+
"page",
81+
"price"
82+
],
83+
"/api/categories": [
84+
"page"
85+
],
86+
"/api/photos": [
87+
"page",
88+
"price"
89+
],
90+
"/api/events": [
91+
"page",
92+
"price"
93+
],
94+
"/api/invoices": [
95+
"page",
96+
"price"
97+
],
98+
"/api/jobs": [
99+
"page",
100+
"price"
101+
],
102+
"/api/{id}": [
103+
"page",
104+
"price"
105+
],
106+
"/api/orders": [
107+
"page"
108+
],
109+
"/api/dashboard": [
110+
"page"
111+
],
112+
"/api/products/{id}": [
113+
"category",
114+
"color",
115+
"param1",
116+
"param2"
117+
],
118+
"/api/settings": [
119+
"price"
120+
],
121+
"/api/messages": [
122+
"price"
123+
],
124+
"/api/todos": [
125+
"page",
126+
"price"
127+
],
128+
"/api/posts": [
129+
"page"
130+
],
131+
"/api/resources": [
132+
"page"
133+
],
134+
"/api/teams": [
135+
"price"
136+
]
137+
}
138+
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"token": "your_api_token_here",
3+
"host": "https://www.balldontlie.io/api",
4+
"description": "**Disclaimer** - This *OpenAPI* specification is generated with the tool *RESTSpecIT*, which leverages *GPT* Large Language Models. Even though the tool verifies as much as possible the model responses, mistakes and/or inaccuracies may be found in the generated specification. Thus, data such as the license or the e-mail of the API should still be manually verified. Moreover, invalid API parameters are often ignored in *nearly* valid requests, as RESTful APIs tend to apply the **robustness principle**. This principle states that *programs receiving messages should accept non-conformant input as long as the meaning is clear*. As the validity of such parameters is complicated to verify, some described parameters may result in false positives. Query parameters that were found but did not specify a value have their type set to **x-null**.<br><br>**Be Reassured** - The tool *RESTSpecIT* has been thouroughly tested on various APIs, demonstrating an average route and parameter discovery rate of over x%. Additionally, the tool is capable of discovering undocumented features of APIs, which was verified with x of the tested APIs.<br><br>**API Description** - The Balldontlie API is a basketball statistics API that provides data on players, teams, games, and more.",
5+
"correct_endpoints": [
6+
"/v1/players",
7+
"/v1/players/{id}",
8+
"/v1/teams",
9+
"/v1/games",
10+
"/v1/stats",
11+
"/v1/season_averages",
12+
"/v1/teams/{id}",
13+
"/v1/games/{id}"
14+
],
15+
"query_params": {
16+
"/v1/players": [
17+
"search",
18+
"per_page",
19+
"sort",
20+
"team_ids[]",
21+
"team_ids"
22+
],
23+
"/v1/players/{id}": [
24+
"search",
25+
"per_page",
26+
"page",
27+
"seasons[]",
28+
"team_ids[]",
29+
"sort",
30+
"fields[]"
31+
],
32+
"/v1/teams": [
33+
"search",
34+
"per_page",
35+
"page",
36+
"sort",
37+
"conference",
38+
"division",
39+
"city",
40+
"abbreviation",
41+
"full_name",
42+
"name",
43+
"year_founded",
44+
"venue",
45+
"team_ids[]",
46+
"team_ids"
47+
],
48+
"/v1/games": [
49+
"search",
50+
"team_ids[]",
51+
"seasons[]",
52+
"start_date",
53+
"end_date",
54+
"seasons",
55+
"dates",
56+
"teams[]",
57+
"players[]",
58+
"per_page",
59+
"page",
60+
"sort",
61+
"team_ids",
62+
"player_ids",
63+
"postseason",
64+
"venue"
65+
],
66+
"/v1/stats": [
67+
"search",
68+
"sort",
69+
"seasons",
70+
"per_page",
71+
"page",
72+
"player_ids",
73+
"team_ids",
74+
"start_date",
75+
"end_date",
76+
"game_ids",
77+
"post_season",
78+
"start_time",
79+
"team_ids[]"
80+
],
81+
"/v1/season_averages": [
82+
"search",
83+
"per_page",
84+
"page",
85+
"season",
86+
"player_ids[]",
87+
"team_ids[]",
88+
"start_date",
89+
"end_date",
90+
"sort",
91+
"order",
92+
"post_season",
93+
"team_ids"
94+
],
95+
"/v1/teams/{id}": [
96+
"search",
97+
"sort"
98+
],
99+
"/v1/games/{id}": [
100+
"search",
101+
"sort"
102+
]
103+
}
104+
}

‎src/hackingBuddyGPT/usecases/web_api_testing/configs/simple/bored_config.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"token": "your_api_token_here",
2+
"token": "",
3+
"strategy": "COT",
34
"host": "https://www.boredapi.com",
45
"description": "**Disclaimer** - This *OpenAPI* specification is generated with the tool *RESTSpecIT*, which leverages *GPT* Large Language Models. Even though the tool verifies as much as possible the model responses, mistakes and/or inaccuracies may be found in the generated specification. Thus, data such as the license or the e-mail of the API should still be manually verified. Moreover, invalid API parameters are often ignored in *nearly* valid requests, as RESTful APIs tend to apply the **robustness principle**. This principle states that *programs receiving messages should accept non-conformant input as long as the meaning is clear*. As the validity of such parameters is complicated to verify, some described parameters may result in false positives. Query parameters that were found but did not specify a value have their type set to **x-null**.<br><br>**Be Reassured** - The tool *RESTSpecIT* has been thouroughly tested on various APIs, demonstrating an average route and parameter discovery rate of over x%. Additionally, the tool is capable of discovering undocumented features of APIs, which was verified with x of the tested APIs.<br><br>**API Description** - The Bored API provides random activities to overcome boredom.",
56
"correct_endpoints": [

0 commit comments

Comments
 (0)