Changeset View
Changeset View
Standalone View
Standalone View
src/routes/api.php
Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | |||||
Route::group( | Route::group( | ||||
[ | [ | ||||
'domain' => \config('app.website_domain'), | 'domain' => \config('app.website_domain'), | ||||
'prefix' => 'webhooks' | 'prefix' => 'webhooks' | ||||
], | ], | ||||
function () { | function () { | ||||
Route::post('payment/{provider}', [API\V4\PaymentsController::class, 'webhook']); | Route::post('payment/{provider}', [API\V4\PaymentsController::class, 'webhook']); | ||||
Route::post('meet', [API\V4\MeetController::class, 'webhook']); | Route::post('meet', [API\V4\MeetController::class, 'webhook']); | ||||
// FIXME: This end-point should probably be authenticated with a passport client token | |||||
// and moved to /api/v4/ instead of /api/webhooks/. Then maybe {client} part is not needed? | |||||
Route::get('sse/{client}', [\App\Http\Controllers\SSEController::class, 'notify']); | |||||
mollekopf: We can get the user from the guard, but if we want device/client specific notifications I think… | |||||
} | } | ||||
); | ); | ||||
if (\config('app.with_services')) { | if (\config('app.with_services')) { | ||||
Route::group( | Route::group( | ||||
[ | [ | ||||
'middleware' => ['allowedHosts'], | 'middleware' => ['allowedHosts'], | ||||
'prefix' => 'webhooks' | 'prefix' => 'webhooks' | ||||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |
We can get the user from the guard, but if we want device/client specific notifications I think we need an id (The companion app code uses device_id rather than client_id, and until we have multiple clients on the same device they are probably going to be the same). I don't think we initially have device specific notifications, but one could foresee the need based different purposes.
I suppose we could map this to oauth scopes, but then again, we already have the companion app entry with some config, so I suggest to leave the id in there.