diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index 83661657..dd48b174 100644 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -441,6 +441,9 @@ class AppBase: "Authorization": "Bearer %s" % self.authorization } + if not isinstance(infiles, list): + infiles = [infiles] + create_path = "/api/v1/files/create?execution_id=%s" % full_execution["execution_id"] file_ids = [] for curfile in infiles: diff --git a/backend/go-app/main.go b/backend/go-app/main.go index ed03640b..cad49aa4 100644 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -6582,6 +6582,9 @@ func verifySwagger(resp http.ResponseWriter, request *http.Request) { log.Printf("Failed to increase success execution stats: %s", err) } + cacheKey := fmt.Sprintf("workflowapps-sorted") + requestCache.Delete(cacheKey) + resp.WriteHeader(200) resp.Write([]byte(fmt.Sprintf(`{"success": true, "id": "%s"}`, api.ID))) } diff --git a/backend/go-app/walkoff.go b/backend/go-app/walkoff.go index ea064ca2..66555157 100644 --- a/backend/go-app/walkoff.go +++ b/backend/go-app/walkoff.go @@ -4332,6 +4332,7 @@ func getApp(ctx context.Context, id string) (*WorkflowApp, error) { workflowApp := &WorkflowApp{} if err := dbclient.Get(ctx, key, workflowApp); err != nil { return &WorkflowApp{}, err + } return workflowApp, nil @@ -4918,12 +4919,34 @@ func addAppAuthentication(resp http.ResponseWriter, request *http.Request) { return } + // FIXME: Doens't validate Org app, err := getApp(ctx, appAuth.App.ID) if err != nil { - log.Printf("Failed finding app %s while setting auth.", appAuth.App.ID) - resp.WriteHeader(409) - resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "%s"}`, err))) - return + log.Printf("[WARNING] Failed finding app %s while setting auth. Finding it by looping apps.", appAuth.App.ID) + workflowapps, err := getAllWorkflowApps(ctx, 100) + if err != nil { + resp.WriteHeader(409) + resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "%s"}`, err))) + return + } + + foundIndex := -1 + for i, workflowapp := range workflowapps { + if workflowapp.Name == appAuth.App.Name { + foundIndex = i + break + } + } + + if foundIndex >= 0 { + log.Printf("[INFO] Found app %s by looping auth", appAuth.App.ID) + app = &workflowapps[foundIndex] + } else { + log.Printf("[ERROR] Failed finding app %s which has auth after looping", appAuth.App.ID) + resp.WriteHeader(409) + resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "%s"}`, err))) + return + } } // Check if the items are correct diff --git a/frontend/src/views/AdminSetup.jsx b/frontend/src/views/AdminSetup.jsx index d79c01f6..275cd5b3 100644 --- a/frontend/src/views/AdminSetup.jsx +++ b/frontend/src/views/AdminSetup.jsx @@ -6,11 +6,6 @@ import TextField from '@material-ui/core/TextField'; import Button from '@material-ui/core/Button'; import Paper from '@material-ui/core/Paper'; -const hrefStyle = { - color: "white", - textDecoration: "none" -} - const bodyDivStyle = { margin: "auto", marginTop: "100px", @@ -35,7 +30,7 @@ const useStyles = makeStyles({ }); const AdminAccount = props => { - const { globalUrl, isLoaded, isLoggedIn, setIsLoggedIn, setCookie, } = props; + const { globalUrl, isLoaded, isLoggedIn, } = props; const [username, setUsername] = useState(""); const [password, setPassword] = useState(""); diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index a9c45275..36c07f4e 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -2860,7 +2860,7 @@ const AngularWorkflow = (props) => { // PARAM FIX - Gonna use the ID field, even though it's a hack const paramcheck = selectedAction.parameters.find(param => param.name === "body") if (paramcheck !== undefined) { - if (paramcheck["value_replace"] === undefined) { + if (paramcheck["value_replace"] === undefined || paramcheck["value_replace"] === null) { paramcheck["value_replace"] = [{ "key": data.name, "value": event.target.value, @@ -3079,7 +3079,7 @@ const AngularWorkflow = (props) => { multiline = true } - if (data.value !== undefined && data.value.startsWith("{") && data.value.endsWith("}")) { + if (data.value !== undefined && data.value !== null && data.value.startsWith("{") && data.value.endsWith("}")) { multiline = true } @@ -3090,8 +3090,8 @@ const AngularWorkflow = (props) => { if (data.name.startsWith("${") && data.name.endsWith("}")) { const paramcheck = selectedAction.parameters.find(param => param.name === "body") - if (paramcheck !== undefined) { - if (paramcheck["value_replace"] !== undefined) { + if (paramcheck !== undefined && paramcheck !== null) { + if (paramcheck["value_replace"] !== undefined && paramcheck["value_replace"] !== null) { //console.log("IN THE VALUE REPLACE: ", paramcheck["value_replace"]) const subparamindex = paramcheck["value_replace"].findIndex(param => param.key === data.name) if (subparamindex !== -1) { @@ -6604,7 +6604,7 @@ const AngularWorkflow = (props) => { } : -