Browse Source

Eliminate Slack webhook token restrictions (#219)

pull/220/head
Chris Caron 5 years ago committed by GitHub
parent
commit
3895ad9b58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      apprise/plugins/NotifySlack.py
  2. 6
      test/test_rest_plugins.py

6
apprise/plugins/NotifySlack.py

@ -176,7 +176,7 @@ class NotifySlack(NotifyBase):
'type': 'string',
'private': True,
'required': True,
'regex': (r'^[A-Z0-9]{9}$', 'i'),
'regex': (r'^[A-Z0-9]+$', 'i'),
},
# Token required as part of the Webhook request
# /........./BBBBBBBBB/........................
@ -185,7 +185,7 @@ class NotifySlack(NotifyBase):
'type': 'string',
'private': True,
'required': True,
'regex': (r'^[A-Z0-9]{9}$', 'i'),
'regex': (r'^[A-Z0-9]+$', 'i'),
},
# Token required as part of the Webhook request
# /........./........./CCCCCCCCCCCCCCCCCCCCCCCC
@ -194,7 +194,7 @@ class NotifySlack(NotifyBase):
'type': 'string',
'private': True,
'required': True,
'regex': (r'^[A-Za-z0-9]{24}$', 'i'),
'regex': (r'^[A-Za-z0-9]+$', 'i'),
},
'target_encoded_id': {
'name': _('Target Encoded ID'),

6
test/test_rest_plugins.py

@ -3213,15 +3213,15 @@ TEST_URLS = (
'message': '',
},
}),
('slack://username@INVALID/A1BRTD4JD/TIiajkdnlazkcOXrIdevi7FQ/#cool', {
('slack://username@-INVALID-/A1BRTD4JD/TIiajkdnlazkcOXrIdevi7FQ/#cool', {
# invalid 1st Token
'instance': TypeError,
}),
('slack://username@T1JJ3T3L2/INVALID/TIiajkdnlazkcOXrIdevi7FQ/#great', {
('slack://username@T1JJ3T3L2/-INVALID-/TIiajkdnlazkcOXrIdevi7FQ/#great', {
# invalid 2rd Token
'instance': TypeError,
}),
('slack://username@T1JJ3T3L2/A1BRTD4JD/INVALID/#channel', {
('slack://username@T1JJ3T3L2/A1BRTD4JD/-INVALID-/#channel', {
# invalid 3rd Token
'instance': TypeError,
}),

Loading…
Cancel
Save