Take Pireon's webhooks: a deactivation or a revocation counts at once
Until now, an account switched off or a token revoked at the identity server kept working here: bearer tokens until the introspection cache ran out, panel sessions until they ended, and machine tokens for good, as they only look at the local account. POST /api/v1/webhooks/pireon takes user.deactivated (the account goes inactive, which stops its machine tokens and the panel; its sessions end and its cached tokens are forgotten) and token.revoked (sessions and cached tokens go). Pireon signs each delivery with the secret of the client that registered the webhook, so either PIREON_WEBHOOK_SECRET (password client) or PIREON_REDIRECT_WEBHOOK_SECRET («Entrar con Pireon») verifies it; with neither, the endpoint refuses everything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,7 @@ use App\Http\Controllers\Api\V1\MediaController;
|
||||
use App\Http\Controllers\Api\V1\MemberController;
|
||||
use App\Http\Controllers\Api\V1\MissingUrlController;
|
||||
use App\Http\Controllers\Api\V1\PageController;
|
||||
use App\Http\Controllers\Api\V1\PireonWebhookController;
|
||||
use App\Http\Controllers\Api\V1\PreviewController;
|
||||
use App\Http\Controllers\Api\V1\ProjectController;
|
||||
use App\Http\Controllers\Api\V1\RedirectController;
|
||||
@@ -185,6 +186,11 @@ Route::prefix('v1')->name('api.v1.')->group(function () {
|
||||
->middleware('throttle:auth-token')
|
||||
->name('auth.token');
|
||||
|
||||
// Called by the identity server, signed with a client's webhook secret.
|
||||
Route::post('webhooks/pireon', PireonWebhookController::class)
|
||||
->middleware('throttle:60,1')
|
||||
->name('webhooks.pireon');
|
||||
|
||||
Route::middleware(['auth:api', 'throttle:api'])->group(function () {
|
||||
Route::get('me', MeController::class)->name('me');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user