Skip to content

Commit

Permalink
Update for upload
Browse files Browse the repository at this point in the history
  • Loading branch information
frikky committed Apr 7, 2021
1 parent 6ae5645 commit 44df461
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
23 changes: 22 additions & 1 deletion shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,27 @@ func GetWorkflowExecutions(resp http.ResponseWriter, request *http.Request) {
return
}

for index, execution := range workflowExecutions {
newResults := []ActionResult{}
for _, result := range execution.Results {
newParams := []WorkflowAppActionParameter{}
for _, param := range result.Action.Parameters {
//log.Printf("PARAM: %#v", param)
if param.Configuration || strings.Contains(strings.ToLower(param.Name), "user") || strings.Contains(strings.ToLower(param.Name), "key") || strings.Contains(strings.ToLower(param.Name), "pass") {
param.Value = ""
//log.Printf("FOUND CONFIG: %s!!", param.Name)
}

newParams = append(newParams, param)
}

result.Action.Parameters = newParams
newResults = append(newResults, result)
}

workflowExecutions[index].Results = newResults
}

newjson, err := json.Marshal(workflowExecutions)
if err != nil {
resp.WriteHeader(401)
Expand Down Expand Up @@ -4896,7 +4917,7 @@ func GetWorkflowAppConfig(resp http.ResponseWriter, request *http.Request) {
if openapiok && len(openapi) > 0 && strings.ToLower(openapi[0]) == "false" {
//log.Printf("Should return WITHOUT openapi")
} else {
log.Printf("CAN SHARE APP!")
//log.Printf("CAN SHARE APP!")
parsedApi, err := GetOpenApiDatastore(ctx, fileId)
if err != nil {
log.Printf("[WARNING] OpenApi doesn't exist for (0): %s - err: %s. Returning basic app", fileId, err)
Expand Down
3 changes: 3 additions & 0 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ type WorkflowAppAction struct {
Environment string `json:"environment" datastore:"environment"`
Sharing bool `json:"sharing" datastore:"sharing"`
PrivateID string `json:"private_id" datastore:"private_id"`
PublicID string `json:"public_id" datastore:"public_id"`
AppID string `json:"app_id" datastore:"app_id"`
Tags []string `json:"tags" datastore:"tags" yaml:"tags"`
Authentication []AuthenticationStore `json:"authentication" datastore:"authentication,noindex" yaml:"authentication,omitempty"`
Expand Down Expand Up @@ -606,6 +607,8 @@ type Action struct {
PrivateID string `json:"private_id,omitempty" datastore:"private_id"`
Label string `json:"label,omitempty" datastore:"label"`
SmallImage string `json:"small_image,omitempty" datastore:"small_image,noindex" required:false yaml:"small_image"`
Public bool `json:"public" datastore:"public"`
Generated bool `json:"generated" yaml:"generated" required:false datastore:"generated"`
LargeImage string `json:"large_image,omitempty" datastore:"large_image,noindex" yaml:"large_image" required:false`
Environment string `json:"environment,omitempty" datastore:"environment"`
Name string `json:"name" datastore:"name"`
Expand Down

0 comments on commit 44df461

Please sign in to comment.