Skip to content

Commit d8a4114

Browse files
committed
Fixed user attributes error handling by dumping to json before return
1 parent a4d7b1c commit d8a4114

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

active-directory/1.0.0/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Get-ADDomain
2323
3. Find the response from "UsersContainer" and use this for Base DN and Search Base
2424

2525
## Typical issues
26-
- InvalidCredentials: This happens when the credentials are wrong.
26+
- InvalidCredentials: This happens when the credentials are wrong. See #authentication to understand if your format for your username/password is correct.
2727

2828
## Features
2929
get user attributes -- done

active-directory/1.0.0/src/app.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,17 @@ def user_attributes(
133133

134134
result = json.loads(c.response_to_json())
135135
if len(result["entries"]) == 0:
136-
return {
136+
return json.dumps({
137137
"success": False,
138138
"result": result,
139139
"reason": "No user found for %s" % samaccountname,
140-
}
140+
})
141+
141142
except Exception as e:
142-
return {
143+
return json.dumps({
143144
"success": False,
144145
"reason": "Failed to get users in user attributes: %s" % e,
145-
}
146+
})
146147

147148

148149
result = result["entries"][0]

email/1.2.0/api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ actions:
183183
description: Include raw body in email export
184184
multiline: false
185185
options:
186-
- "false"
187186
- "true"
187+
- "false"
188188
required: true
189189
schema:
190190
type: bool

shuffle-tools/1.2.0/src/app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,10 +565,14 @@ def execute_bash(self, code, shuffle_input):
565565
def filter_list(self, input_list, field, check, value, opposite):
566566
self.logger.info(f"\nRunning function with list {input_list}")
567567

568+
# Remove hashtags on the fly
569+
# E.g. #.fieldname or .#.fieldname
570+
568571
flip = False
569572
if str(opposite).lower() == "true":
570573
flip = True
571574

575+
572576
try:
573577
#input_list = eval(input_list) # nosec
574578
input_list = json.loads(input_list)
@@ -590,6 +594,9 @@ def filter_list(self, input_list, field, check, value, opposite):
590594

591595
input_list = [input_list]
592596

597+
if str(value).lower() == "null":
598+
value = "none"
599+
593600
self.logger.info(f"\nRunning with check \"%s\" on list of length %d\n" % (check, len(input_list)))
594601
found_items = []
595602
new_list = []

0 commit comments

Comments
 (0)