Feature: Receptor de webhooks interno para debug
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m3s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m3s
- Endpoint POST /api/debug/webhook-receiver para recibir webhooks - Almacenamiento en memoria de ultimos 100 eventos - Endpoint GET/DELETE para consultar/limpiar eventos - Nueva tab Webhooks en seccion Debug con polling cada 5s
This commit is contained in:
23
server/api/debug/webhook-events.get.ts
Normal file
23
server/api/debug/webhook-events.get.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* GET /api/debug/webhook-events
|
||||
* Get stored debug webhook events
|
||||
*/
|
||||
import { debugWebhookStore } from '../../services/debug/webhook-store'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const username = getHeader(event, 'x-authentik-username')
|
||||
if (!username) {
|
||||
throw createError({ statusCode: 401, message: 'Unauthorized' })
|
||||
}
|
||||
|
||||
const query = getQuery(event)
|
||||
const limit = parseInt(query.limit as string) || 50
|
||||
|
||||
const events = debugWebhookStore.getEvents(limit)
|
||||
|
||||
return {
|
||||
success: true,
|
||||
count: events.length,
|
||||
events
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user