Skip to content

Commit

Permalink
Merge branch 'master' into enhancement/custom-incident-description
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 authored Jun 14, 2024
2 parents 704f28e + ad5ec87 commit b969b5b
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 55 deletions.
14 changes: 7 additions & 7 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ frozenlist==1.4.1
# aiosignal
google-api-core==2.15.0
# via google-api-python-client
google-api-python-client==2.132.0
google-api-python-client==2.133.0
# via -r requirements-base.in
google-auth==2.26.1
# via
Expand Down Expand Up @@ -214,7 +214,7 @@ markupsafe==2.1.3
# jinja2
# mako
# werkzeug
msal==1.28.0
msal==1.28.1
# via -r requirements-base.in
multidict==6.0.4
# via
Expand Down Expand Up @@ -242,7 +242,7 @@ oauthlib[signedtoken]==3.2.2
# atlassian-python-api
# jira
# requests-oauthlib
openai==1.32.0
openai==1.34.0
# via -r requirements-base.in
packaging==23.2
# via
Expand Down Expand Up @@ -396,7 +396,7 @@ six==1.16.0
# validators
slack-bolt==1.18.1
# via -r requirements-base.in
slack-sdk==3.27.2
slack-sdk==3.29.0
# via
# -r requirements-base.in
# slack-bolt
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ executing==2.0.1
# stack-data
factory-boy==3.3.0
# via -r requirements-dev.in
faker==25.6.0
faker==25.8.0
# via
# -r requirements-dev.in
# factory-boy
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/incident/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ def send_participant_announcement_message(
f"*Name:* {participant_name_mrkdwn}\n"
f"*Team*: {participant_team}, {participant_department}\n"
f"*Location*: {participant_location}\n"
f"*Incident Role(s)*: {(', ').join(participant_roles)}\n"
f"*{subject_type} Role(s)*: {(', ').join(participant_roles)}\n"
),
},
},
Expand Down
43 changes: 27 additions & 16 deletions src/dispatch/plugins/dispatch_duo/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,33 @@ def send_push_notification(
For more information, see https://duo.com/docs/authapi#/auth
"""
duo_client = duo_service.create_duo_auth_client(self.configuration)
try:
response = duo_client.auth(factor="push", username=username, device=device, type=type)
except RuntimeError as e:
if "Invalid request parameters (username)" in str(e):
username, _ = username.split("@")

try:
response = duo_client.auth(
factor="push", username=username, device=device, type=type
)
except RuntimeError as e:
if "Invalid request parameters (username)" in str(e):
log.warning(
f"Sending push notification failed. Unable to find {username} in Duo"
)
return PushResponseResult.user_not_found
userstatus = duo_client.preauth(username=username)
response = {}

if userstatus["result"] == "enroll" and "@" in username:
username, domain = username.split("@")
userstatus = duo_client.preauth(username=username)

if userstatus["result"] == "enroll":
log.warning(f"Sending push notification failed. Unable to find {username} in Duo")
return PushResponseResult.user_not_found
elif userstatus["result"] == "deny":
return PushResponseResult.deny
elif userstatus["result"] == "allow":
return PushResponseResult.allow
elif userstatus["result"] == "auth":
push_devs = [row.get("device") for row in userstatus.get("devices") if "push" in row.get("capabilities")]
if len(push_devs) < 1:
log.error(f"ERROR: Duo account found for {username}, but no devices support Push")
return PushResponseResult.deny
try:
response = duo_client.auth(factor="push", username=username, device=device, type=type)
except RuntimeError as e:
log.error(f"ERROR: Runtime Error during Duo Push: {e}")
return PushResponseResult.deny
else:
log.error(f"ERROR: Unexpected user status from Duo during push: {userstatus}")
return PushResponseResult.deny

if response.get("result") == PushResponseResult.allow:
return PushResponseResult.allow
Expand Down
7 changes: 6 additions & 1 deletion src/dispatch/plugins/dispatch_google/groups/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ def add_member(client: Any, group_key: str, email: str, role: str):

def remove_member(client: Any, group_key: str, email: str):
"""Removes member from google group."""
return make_call(client.members(), "delete", groupKey=group_key, memberKey=email)
try:
return make_call(client.members(), "delete", groupKey=group_key, memberKey=email)
except HttpError as e:
if e.resp.status in [409]:
log.debug(f"Member does not exist in google group. GroupKey={group_key} MemberKey={email}")
return


def list_members(client: Any, group_key: str, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/plugins/dispatch_slack/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def unarchive_conversation(client: WebClient, conversation_id: str) -> SlackResp
def rename_conversation(client: WebClient, conversation_id: str, name: str) -> SlackResponse:
"""Renames an existing conversation."""
return make_call(
client, SlackAPIPostEndpoints.conversations_rename, channel=conversation_id, name=name
client, SlackAPIPostEndpoints.conversations_rename, channel=conversation_id, name=name.lower()
)


Expand Down
46 changes: 23 additions & 23 deletions src/dispatch/static/dispatch/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/dispatch/static/dispatch/src/case/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const headers = [
{ title: "Severity", value: "case_severity.name", sortable: true },
{ title: "Priority", value: "case_priority.name", sortable: true },
{ title: "Project", value: "project.name", sortable: true },
{ title: "Assignee", value: "assignee", sortable: true },
{ title: "Assignee", value: "assignee.email", sortable: false },
{ title: "Reported At", value: "reported_at", sortable: true },
{ title: "Closed At", value: "closed_at", sortable: true },
{ title: "", key: "data-table-actions", sortable: false, align: "end" },
Expand Down

0 comments on commit b969b5b

Please sign in to comment.