Page MenuHomeDevCentral

Accept notifications in our native format
ClosedPublic

Authored by dereckson on Jan 27 2017, 23:40.

Details

Summary

Gate to receive notifications already in our format.

Fixes T979.

Test Plan

Fire a notification

Diff Detail

Repository
rNOTIF Notifications center
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dereckson created this revision.Jan 27 2017, 23:40
dereckson updated this revision to Diff 2270.Jan 30 2017, 20:06
dereckson edited edge metadata.

Controller draft

dereckson updated this revision to Diff 2274.Jan 31 2017, 01:36

getServiceName should currently be protected

dereckson updated this revision to Diff 2275.Jan 31 2017, 01:37

Rebased

dereckson retitled this revision from WIP: Notifications gate to Accept notifications in our native format.Jan 31 2017, 01:44
dereckson updated this revision to Diff 2278.Jan 31 2017, 02:06

Cast service as a string

dereckson updated this revision to Diff 2282.Jan 31 2017, 02:25

Rebased

dereckson edited the summary of this revision. (Show Details)Jan 31 2017, 02:27
dereckson planned changes to this revision.EditedJan 31 2017, 02:29

We need to add minimal checks, because {} payload currently produce a valid notification.

[01:50:16] <None/None> None


{ project: "Nasqueron" } payload produces:
[02:33:32] <Nasqueron/None> None
02:33:33 <Wearg> [DEBUG] Message for unknown group: Nasqueron null


An exception is thrown for Invalid JSON or when the raw payload is a string.

By the way, payloads MUST be protected, at least by an API key, or using the GitHub system.

If not, this a free party flood.

We need to add minimal checks, because {} payload currently produce a valid notification.

[01:50:16] <None/None> None


{ project: "Nasqueron" } payload produces:
[02:33:32] <Nasqueron/None> None
02:33:33 <Wearg> [DEBUG] Message for unknown group: Nasqueron null


An exception is thrown for Invalid JSON or when the raw payload is a string.

Done, will return a HTTP 400 Bad request code.

dereckson updated this revision to Diff 2287.Jan 31 2017, 21:24

Validation, whitespace

dereckson planned changes to this revision.Jan 31 2017, 22:43
dereckson added inline comments.
app/Http/Controllers/Gate/GateController.php
124 ↗(On Diff #2287)

Hu? This method seems an artefact left while preparing D897.

dereckson updated this revision to Diff 2288.Jan 31 2017, 22:45
dereckson marked an inline comment as done.

Remove GateController::getServiceName

dereckson accepted this revision.EditedJan 31 2017, 23:39

By the way, payloads MUST be protected, at least by an API key, or using the GitHub system.

If not, this a free party flood.

This is a more generic problem to solve, just filled as T1147.

This revision is now accepted and ready to land.Jan 31 2017, 23:39
This revision was automatically updated to reflect the committed changes.