1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Slack: moves to \S+ check instead of \w+-\w+ (#863)

* Moves to \S+ check instead of \w+-\w+

* Adds changelog fragment

* Update changelogs/fragments/892-slack-token-validation.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Josh VanDeraa <josh.vanderaa@networktocode.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Josh VanDeraa 2020-09-07 15:09:31 -05:00 committed by GitHub
parent e20eb64c6e
commit 1eb3ab3b27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,3 @@
---
bugfixes:
- slack - fix ``xox[abp]`` token identification to capture everything after ``xox[abp]``, as the token is the only thing that should be in this argument (https://github.com/ansible-collections/community.general/issues/862).

View file

@ -314,7 +314,7 @@ def do_notify_slack(module, domain, token, payload):
if token.count('/') >= 2:
# New style webhook token
slack_uri = SLACK_INCOMING_WEBHOOK % (token)
elif re.match(r'^xox[abp]-\w+-\w+$', token):
elif re.match(r'^xox[abp]-\S+$', token):
slack_uri = SLACK_POSTMESSAGE_WEBAPI
use_webapi = True
else: