Skip to content

Commit

Permalink
Added dict merging to branches for shuffle tools
Browse files Browse the repository at this point in the history
  • Loading branch information
frikky committed May 5, 2024
1 parent 655302f commit 8112147
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shuffle-tools/1.2.0/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ actions:
required: false
multiline: false
example: "domains,urls,email_addresses,ipv4s,ipv4_cidrs,ipv6s,md5s,sha256s,sha1s,cves"
value: "domains,urls,ipv4s,md5s,sha1s"
value: "domains,urls,ipv4s,md5s,sha1s,email_addresses"
multiselect: true
schema:
type: string
Expand Down Expand Up @@ -1106,6 +1106,7 @@ actions:
example: 'list'
options:
- list
- dict
schema:
type: string
- name: run_ssh_command
Expand Down
9 changes: 9 additions & 0 deletions shuffle-tools/1.2.0/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2642,6 +2642,15 @@ def merge_incoming_branches(self, input_type="list"):
#newlist.append(item)

results = newlist
elif input_type == "dict":
new_dict = {}
for item in results:
if not isinstance(item, dict):
continue

new_dict = self.merge_lists(new_dict, item)

results = json.dumps(new_dict)
else:
return {
"success": False,
Expand Down

0 comments on commit 8112147

Please sign in to comment.