@garanews: Fixed path issue in OpenAPI parser
This commit is contained in:
@@ -396,10 +396,11 @@ func makePythoncode(swagger *openapi3.Swagger, name, url, method string, paramet
|
|||||||
bodyAddin,
|
bodyAddin,
|
||||||
verifyAddin,
|
verifyAddin,
|
||||||
)
|
)
|
||||||
//if strings.Contains(functionname, "get_returns_the_vuln") {
|
|
||||||
// log.Println(data)
|
if strings.Contains(functionname, "api_dumps_delete") {
|
||||||
// log.Printf("Queries: %s", queryString)
|
log.Println(data)
|
||||||
//}
|
log.Printf("Queries: %s", queryString)
|
||||||
|
}
|
||||||
|
|
||||||
//log.Printf(data)
|
//log.Printf(data)
|
||||||
return functionname, data
|
return functionname, data
|
||||||
|
|||||||
@@ -720,6 +720,30 @@ const AppCreator = (props) => {
|
|||||||
newitem.description = queryitem.description
|
newitem.description = queryitem.description
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data.paths[item.url][item.method.toLowerCase()].parameters.push(newitem)
|
||||||
|
//console.log(queryitem)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Always goes here if they didn't click anything :/
|
||||||
|
const values = getCurrentPaths(item.url)
|
||||||
|
const paths = values[0]
|
||||||
|
|
||||||
|
for (querykey in paths) {
|
||||||
|
const queryitem = paths[querykey]
|
||||||
|
newitem = {
|
||||||
|
"in": "path",
|
||||||
|
"name": queryitem,
|
||||||
|
"description": "Generated by shuffler.io OpenAPI",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if (queryitem.description !== undefined) {
|
||||||
|
newitem.description = queryitem.description
|
||||||
|
}
|
||||||
|
|
||||||
data.paths[item.url][item.method.toLowerCase()].parameters.push(newitem)
|
data.paths[item.url][item.method.toLowerCase()].parameters.push(newitem)
|
||||||
//console.log(queryitem)
|
//console.log(queryitem)
|
||||||
}
|
}
|
||||||
@@ -1220,7 +1244,7 @@ const AppCreator = (props) => {
|
|||||||
return errormessage
|
return errormessage
|
||||||
}
|
}
|
||||||
|
|
||||||
const UrlPathParameters = () => {
|
const getCurrentPaths = (urlPath) => {
|
||||||
var paths = []
|
var paths = []
|
||||||
var queries = []
|
var queries = []
|
||||||
|
|
||||||
@@ -1296,7 +1320,16 @@ const AppCreator = (props) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return [paths, queries]
|
||||||
|
}
|
||||||
|
|
||||||
|
const UrlPathParameters = () => {
|
||||||
|
const values = getCurrentPaths(urlPath)
|
||||||
|
const paths = values[0]
|
||||||
|
const queries = values[1]
|
||||||
|
|
||||||
if (currentAction.paths !== paths && urlPath.length > 0) {
|
if (currentAction.paths !== paths && urlPath.length > 0) {
|
||||||
|
console.log("IN PATHS SETTER: !", paths)
|
||||||
setActionField("paths", paths)
|
setActionField("paths", paths)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1563,6 +1596,8 @@ const AppCreator = (props) => {
|
|||||||
</Button>
|
</Button>
|
||||||
<Button color="primary" variant="outlined" style={{borderRadius: "0px"}} onClick={() => {
|
<Button color="primary" variant="outlined" style={{borderRadius: "0px"}} onClick={() => {
|
||||||
console.log(urlPathQueries)
|
console.log(urlPathQueries)
|
||||||
|
console.log(urlPath)
|
||||||
|
// value={urlPath}
|
||||||
const errors = getActionErrors()
|
const errors = getActionErrors()
|
||||||
addActionToView(errors)
|
addActionToView(errors)
|
||||||
setActionsModalOpen(false)
|
setActionsModalOpen(false)
|
||||||
@@ -1653,7 +1688,7 @@ const AppCreator = (props) => {
|
|||||||
<div style={{color: "white"}}>
|
<div style={{color: "white"}}>
|
||||||
<h2>Test</h2>
|
<h2>Test</h2>
|
||||||
Test an action to see whether it performs in an expected way.
|
Test an action to see whether it performs in an expected way.
|
||||||
<Link target="_blank" to="https://shuffler.io/docs/apps#testing" style={{textDecoration: "none", color: "#f85a3e"}}> TBD: Click here to learn more about testing</Link>.
|
<a target="_blank" href="https://shuffler.io/docs/apps#testing" style={{textDecoration: "none", color: "#f85a3e"}}> TBD: Click here to learn more about testing</a>.
|
||||||
<div>
|
<div>
|
||||||
Test :)
|
Test :)
|
||||||
</div>
|
</div>
|
||||||
@@ -1722,7 +1757,7 @@ const AppCreator = (props) => {
|
|||||||
</Breadcrumbs>
|
</Breadcrumbs>
|
||||||
<Paper style={boxStyle}>
|
<Paper style={boxStyle}>
|
||||||
<h2 style={{marginBottom: "10px", color: "white"}}>General information</h2>
|
<h2 style={{marginBottom: "10px", color: "white"}}>General information</h2>
|
||||||
<Link target="_blank" to="https://shuffler.io/docs/apps#create_openapi_app" style={{textDecoration: "none", color: "#f85a3e"}}>Click here to learn more about app creation</Link>
|
<a target="_blank" href="https://shuffler.io/docs/apps#create_openapi_app" style={{textDecoration: "none", color: "#f85a3e"}}>Click here to learn more about app creation</a>
|
||||||
<div style={{color: "white", flex: "1", display: "flex", flexDirection: "row"}}>
|
<div style={{color: "white", flex: "1", display: "flex", flexDirection: "row"}}>
|
||||||
<Tooltip title="Click to edit the app's image" placement="bottom">
|
<Tooltip title="Click to edit the app's image" placement="bottom">
|
||||||
<div style={{flex: "1", margin: 10, border: "1px solid #f85a3e", cursor: "pointer", backgroundColor: inputColor, maxWidth: 174, maxHeight: 174}} onClick={() => {upload.click()}}>
|
<div style={{flex: "1", margin: 10, border: "1px solid #f85a3e", cursor: "pointer", backgroundColor: inputColor, maxWidth: 174, maxHeight: 174}} onClick={() => {upload.click()}}>
|
||||||
|
|||||||
Reference in New Issue
Block a user