Commit graph

6 commits

Author SHA1 Message Date
Anna Buianova
c07eb8d9cd Define Doorkeeper::Application association (#4065) [ci skip] 2019-09-19 10:28:55 -04:00
Anna Buianova
0a16bf934a Added association between webhook_endpoints and oauth apps (#4060)
* Added association between webhook_endpoints and oauth apps

* Limit webhooks access by oauth_app_id when authorized by doorkeeper

* Use rails route helpers in webhooks api test
2019-09-18 13:25:40 -07:00
rhymes
b6c27f34fa Use a sortable unique ID for the event_id (#3972) 2019-09-09 10:15:12 -04:00
Anna Buianova
4c9a40be41 Dispatch events to the webhook endpoints #3715 (#3872)
* Start with webhooks: table and model

* Start with webhooks api

* Start with webhooks api

* Webhook::Event class and events list

* Remove commented callbacks

* Start with sending events to webhook endpoints

* A couple of tests for Articles::Creator

* Send event to webhook endpoint on article destroy

* Dispatch event on article update

* Dispatch event when an article updated from admin

* Spec for the webhook job

* One more test for the dispatch event job

* Integration-like spec for event dispatching to webhook endpoints when creating an article

* Use Addressable::URI to parse endpoint url

* Add oj as a faster fast_jsonapi backend

* Renamed serializers

* Move article serialization out of a model

* Don't allow to create a webhook event with invalid type

* Add fields for ArticleSerializer

* Fix webhook event job specs

* Specify timeout when dispatching events

* Fix webhook job spec

* Change webhook events queue name

* Change serialized article fields for the dispatchable events

* Include user data when serializing an article for webhook event

* Moved decorating out of Webhook::DispatchEvent, fixed most specs

* Fix route in ArticleSerializer

* Move Article decoration to Webhook::PayloadAdapter

* Refactor image url helpers to avoid including helpers into serializer

* Fix specs

* Default url options for production
2019-09-07 13:17:45 -04:00
rhymes
676cf002bd Webhooks: API fixes and docs (#3901)
* Fix webhook API and add POST /api/webhooks docs

* Document GET /api/webhooks/:id

* Fix DELETE /api/webhooks/{id} and document it

* Add proper 404 specs
2019-09-03 10:41:23 -04:00
Anna Buianova
bfdf636dcf Implement webhook & API endpoints #3715 (#3783) 2019-08-29 10:23:41 -04:00