diff --git a/backend/go-app/go.mod b/backend/go-app/go.mod index e282df2e..f2fa937f 100644 --- a/backend/go-app/go.mod +++ b/backend/go-app/go.mod @@ -2,7 +2,7 @@ module main go 1.19 -//replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared +replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared require ( cloud.google.com/go/datastore v1.10.0 @@ -19,7 +19,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/h2non/filetype v1.1.3 github.com/satori/go.uuid v1.2.0 - github.com/shuffle/shuffle-shared v0.3.51 + github.com/shuffle/shuffle-shared v0.3.52 golang.org/x/crypto v0.3.0 google.golang.org/api v0.103.0 google.golang.org/appengine v1.6.7 diff --git a/backend/go-app/main.go b/backend/go-app/main.go index 7ec48118..53c9697e 100644 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -2336,7 +2336,7 @@ func handleWebhookCallback(resp http.ResponseWriter, request *http.Request) { } // OrgId: activeOrgs[0].Id, - workflowExecution, executionResp, err := handleExecution(ctx, item, workflow, newRequest) + workflowExecution, executionResp, err := handleExecution(item, workflow, newRequest, hook.OrgId) if err == nil { if hook.Version == "v2" { @@ -2378,6 +2378,7 @@ func handleWebhookCallback(resp http.ResponseWriter, request *http.Request) { resp.WriteHeader(500) resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "%s"}`, executionResp))) } + } func executeCloudAction(action shuffle.CloudSyncJob, apikey string) error { diff --git a/frontend/src/views/AppCreator.jsx b/frontend/src/views/AppCreator.jsx index 16087936..44b2f271 100644 --- a/frontend/src/views/AppCreator.jsx +++ b/frontend/src/views/AppCreator.jsx @@ -222,6 +222,14 @@ const parseCurl = (s) => { return out; }; +export const base64_decode = (str) => { + return decodeURIComponent( + atob(str).split("").map(function (c) { + return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2); + }).join("") + ); +}; + // Should be different if logged in :| const AppCreator = (defaultprops) => { const { globalUrl, isLoaded } = defaultprops; @@ -527,16 +535,7 @@ const AppCreator = (defaultprops) => { return newitem; }; - const base64_decode = (str) => { - return decodeURIComponent( - atob(str) - .split("") - .map(function (c) { - return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2); - }) - .join("") - ); - }; + // Sets the data up as it should be at later points // This is the data FROM the database, not what's being saved @@ -1889,7 +1888,9 @@ const AppCreator = (defaultprops) => { queryitem.name.toLowerCase() == "ssl_verify" || queryitem.name.toLowerCase() == "queries" || queryitem.name.toLowerCase() == "headers" || - queryitem.name.toLowerCase() == "access_token" || + queryitem.name.toLowerCase() == "access_token") { + /* + queryitem.name.includes("[") || queryitem.name.includes("]") || queryitem.name.includes("{") || @@ -1910,10 +1911,11 @@ const AppCreator = (defaultprops) => { queryitem.name.includes('"') || queryitem.name.includes("'") ) { - console.log( - item.name + " error: uses a bad query - not adding: ", - queryitem.name - ) + */ + console.log(item.name + " error: uses a bad query - not adding: ",queryitem.name) + + + // Find a replacement for the invalid ones first. continue; } @@ -3922,11 +3924,15 @@ const AppCreator = (defaultprops) => { //console.log("Actions: ", actions) if (baseUrl.length === 0 && parsedurl.includes("http")) { - const newurl = new URL(encodeURI(parsedurl)) - newurl.searchParams.delete(parameterName) - console.log("New url: ", newurl) - parsedurl = newurl.pathname - setBaseUrl(newurl.origin) + try { + const newurl = new URL(encodeURI(parsedurl)) + newurl.searchParams.delete(parameterName) + console.log("New url: ", newurl) + parsedurl = newurl.pathname + setBaseUrl(newurl.origin) + } catch (e) { + console.log("Failed to parse URL: ", e) + } } if (event.target.value !== parsedurl) {