Commit Graph

13 Commits

Author SHA1 Message Date
Tim Abbott c10cc24ee8 python: Sort webhooks imports with isort. 2020-01-14 13:07:47 -08:00
Eeshan Garg f6a601f09f webhooks/heroku: Improve message formatting and punctuation. 2019-04-14 22:20:02 -07:00
Eeshan Garg b79213d260 webhooks: Notify bot owner on invalid JSON.
There are only a handful of non-JSON webhooks that wouldn't
benefit from the notify_bot_owner_on_invalid_json feature.

Specifically, these are the webhooks where the third-party product
uses another format, whether it be HTML form-encoded, XML, or
something else.

Tweaked by tabbott to correc the list of excluded webhooks.
2018-11-20 15:59:09 -08:00
Lenny Jagielski b9393387e1 integrations: Fix heroku integration logging.
Now, every line in the commit log is properly quoted, but using a
Zulip markdown block quote (rather than just a single `>`).

Fixes: #9792
2018-07-01 12:43:31 -07:00
Aditya Bansal 64ddfc6ac0 zerver/webhooks: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
Eeshan Garg a4979410f9 webhooks: Migrate most integrations to use check_send_webhook_message.
This commit migrates all of our webhooks to use
check_send_webhook_message, except the following:

beeminder: Rishi wanted to wait on this one.
teamcity: This one is slightly more work.

yo: This one is PM-only. I am still trying to decide whether we
    should have a force_private argument or something in
    check_send_webhook_message.

facebook: No point in migrating this, will be removed as part of
          #8433.

slack: Slightly more work too with the `channel_to_topics` feature.
       Warrants a longer discussion.
2018-03-16 19:23:50 -02:30
Xavier Cooney 38e65570ae mypy: Use Python 3 syntax for typing in heroku/view.py. 2017-12-08 18:34:26 -08:00
Tim Abbott 73a668e7ae python: Sort imports in webhooks. 2017-11-15 15:43:10 -08:00
Eeshan Garg aaaed74c3d webhooks: Import REQ, has_request_variables from zerver.lib.request.
We now import REQ and has_request_variables from zerver.lib.request,
which is where these methods are defined.

Fixes #7195.
2017-11-02 14:40:55 -07:00
Eeshan Garg 86c2c7ad34 webhooks: Migrate to check_send_stream_message.
This commit migrates all webhooks to use check_send_stream_message
instead of check_send_message. The only two webhooks that still
use check_send_message are our yo and teamcity webhooks. They
both use check_send_message for private messages.
2017-09-30 17:48:55 -07:00
rht 7115a29bee zerver/webhooks: Remove absolute_import. 2017-09-27 10:00:39 -07:00
Eeshan Garg e87e246fcb zerver/decorator: Set request.client in api_key_only_webhook_view.
Previously, api_key_only_webhook_view passed 3 positional arguments
(request, user_profile, and client) into a function. However, most
of our other auth decorators only pass 2 positional arguments. For
the sake of consistency, we now make api_key_only_webhook_view set
request.client and pass only request and user_profile as positional
arguments.
2017-05-01 23:44:07 -07:00
Tomasz Kolek 7de45951e2 Make webhooks as separate modules with view and tests.
Create python packege for every webhook with view.py and tests.py
2017-01-25 23:14:19 -08:00