diff --git a/.env b/.env index ae66b902..27018187 100644 --- a/.env +++ b/.env @@ -25,16 +25,22 @@ SHUFFLE_APP_HOTLOAD_FOLDER=./shuffle-apps SHUFFLE_APP_HOTLOAD_LOCATION=./shuffle-apps SHUFFLE_FILE_LOCATION=./shuffle-files +# Encryption modifier. This HAS to be set to encrypt any authentication being used in Shuffle. This is put together with other relevant values to ensure multiple parts are needed to decrypt. +# If this key is lost or changed, you will have to reauthenticate all apps. +SHUFFLE_ENCRYPTION_MODIFIER= + # Other configs BACKEND_HOSTNAME=shuffle-backend BACKEND_PORT=5001 FRONTEND_PORT=3001 FRONTEND_PORT_HTTPS=3443 + # CHANGE THIS IF YOU WANT GOOD LOCAL EXECUTIONS: OUTER_HOSTNAME=shuffle-backend DB_LOCATION=./shuffle-database DOCKER_API_VERSION=1.40 + # Proxy configurations. SHUFFLE_PASS_WORKER_PROXY must be FALSE to not pass the proxy information to sub-apps. # PS: It will skip proxy for HTTP_PROXY= diff --git a/backend/go-app/go.mod b/backend/go-app/go.mod index 870244e2..2fa79b57 100644 --- a/backend/go-app/go.mod +++ b/backend/go-app/go.mod @@ -22,7 +22,7 @@ require ( github.com/docker/go-units v0.4.0 // indirect github.com/elastic/go-elasticsearch/v7 v7.13.1 // indirect github.com/frikky/kin-openapi v0.39.0 - github.com/frikky/shuffle-shared v0.0.95 + github.com/frikky/shuffle-shared v0.0.97 github.com/fsouza/go-dockerclient v1.7.2 github.com/ghodss/yaml v1.0.0 github.com/go-git/go-billy/v5 v5.0.0 diff --git a/backend/go-app/walkoff.go b/backend/go-app/walkoff.go index 892e6031..4b9756cb 100644 --- a/backend/go-app/walkoff.go +++ b/backend/go-app/walkoff.go @@ -1540,6 +1540,33 @@ func handleExecution(id string, workflow shuffle.Workflow, request *http.Request return shuffle.WorkflowExecution{}, fmt.Sprintf("Auth ID %s doesn't exist", action.AuthenticationId), errors.New(fmt.Sprintf("Auth ID %s doesn't exist", action.AuthenticationId)) } + if curAuth.Encrypted { + setField := true + newFields := []shuffle.AuthenticationStore{} + for _, field := range curAuth.Fields { + parsedKey := fmt.Sprintf("%s_%d_%s_%s", curAuth.OrgId, curAuth.Created, curAuth.Label, field.Key) + newValue, err := shuffle.HandleKeyDecryption(field.Value, parsedKey) + if err != nil { + log.Printf("[WARNING] Failed decryption for %s: %s", field.Key, err) + setField = false + break + } + + field.Value = newValue + newFields = append(newFields, field) + } + + if setField { + curAuth.Fields = newFields + } + } else { + log.Printf("[INFO] AUTH IS NOT ENCRYPTED - attempting encrypting!") + err = shuffle.SetWorkflowAppAuthDatastore(ctx, curAuth, curAuth.Id) + if err != nil { + log.Printf("[WARNING] Failed running encryption during execution: %s", err) + } + } + newParams := []shuffle.WorkflowAppActionParameter{} if strings.ToLower(curAuth.Type) == "oauth2" { log.Printf("\n\nShould replace auth parameters!!!\n\n") @@ -3699,7 +3726,7 @@ func IterateAppGithubFolders(ctx context.Context, fs billy.Filesystem, dir []os. continue } else { workflowapp.Documentation = string(fileData) - log.Printf("[INFO] Found %s (README) file of length %d for %s:%s", readmePath, len(workflowapp.Documentation), newName, workflowapp.AppVersion) + //log.Printf("[INFO] Found %s (README) file of length %d for %s:%s", readmePath, len(workflowapp.Documentation), newName, workflowapp.AppVersion) break } } @@ -3719,7 +3746,7 @@ func IterateAppGithubFolders(ctx context.Context, fs billy.Filesystem, dir []os. continue } else { workflowapp.Documentation = string(fileData) - log.Printf("[INFO] Found %s (README) file of length %d for %s:%s", readmePath, len(workflowapp.Documentation), newName, workflowapp.AppVersion) + //log.Printf("[INFO] Found %s (README) file of length %d for %s:%s", readmePath, len(workflowapp.Documentation), newName, workflowapp.AppVersion) break } } diff --git a/frontend/src/components/ParsedAction.jsx b/frontend/src/components/ParsedAction.jsx index d8dffc18..ca14dc79 100644 --- a/frontend/src/components/ParsedAction.jsx +++ b/frontend/src/components/ParsedAction.jsx @@ -1488,7 +1488,7 @@ const ParsedAction = (props) => { - { + { setAuthenticationModalOpen(true) }}> diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 030a1da7..5f325d39 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -9123,18 +9123,22 @@ const AngularWorkflow = (props) => {
-
+
{authenticationType.type === "oauth2" ? : }
-
+
{selectedApp.documentation === undefined || selectedApp.documentation === null || selectedApp.documentation.length === 0 ? + + Description: {selectedApp.description} + + - There is currently no documentation for this app. + There is currently no extended documentation available for this app. Want help with this app? Join the Discord!