Skip to content

Commit

Permalink
↪️ Merge pull request #325 from dryoni/yoni-fixes
Browse files Browse the repository at this point in the history
Slack Plugin bug fixes
  • Loading branch information
KevinHock committed Aug 9, 2020
2 parents cd8b399 + aa1e52b commit e65371f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions detect_secrets/plugins/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ class SlackDetector(RegexBasedDetector):
re.compile(r'xox(?:a|b|p|o|s|r)-(?:\d+-)+[a-z0-9]+', flags=re.IGNORECASE),
# Slack Webhooks
re.compile(
r"""
https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}
""",
r'https://hooks.slack.com/services/T[a-zA-Z0-9_]+/B[a-zA-Z0-9_]+/[a-zA-Z0-9_]+',
flags=re.IGNORECASE | re.VERBOSE,
),
)
Expand All @@ -33,7 +31,7 @@ def verify(self, token, **kwargs): # pragma: no cover
'text': '',
},
)
valid = response.text == 'missing_text_or_fallback_or_attachments'
valid = response.text in ['missing_text_or_fallback_or_attachments', 'no_text']
else:
response = requests.post(
'https://slack.com/api/auth.test',
Expand Down

0 comments on commit e65371f

Please sign in to comment.