MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / Webhooks

Method Webhooks

internal/service/admin_webhooks.go:240–260  ·  view source on GitHub ↗

Webhooks returns a paginated list of webhooks. Requires super-admin auth. Logic migrated from internal/graphql/webhooks.go.

(ctx context.Context, meta RequestMetadata, params *model.PaginatedRequest)

Source from the content-addressed store, hash-verified

238// Webhooks returns a paginated list of webhooks. Requires super-admin auth.
239// Logic migrated from internal/graphql/webhooks.go.
240func (p *provider) Webhooks(ctx context.Context, meta RequestMetadata, params *model.PaginatedRequest) (*model.Webhooks, *ResponseSideEffects, error) {
241 log := p.Log.With().Str("func", "Webhooks").Logger()
242 if err := p.requireSuperAdmin(ctx, meta); err != nil {
243 return nil, nil, err
244 }
245
246 pagination := utils.GetPagination(params)
247 webhooks, pagination, err := p.StorageProvider.ListWebhook(ctx, pagination)
248 if err != nil {
249 log.Debug().Err(err).Msg("failed ListWebhook")
250 return nil, nil, err
251 }
252 res := make([]*model.Webhook, len(webhooks))
253 for i, webhook := range webhooks {
254 res[i] = webhook.AsAPIWebhook()
255 }
256 return &model.Webhooks{
257 Pagination: pagination,
258 Webhooks: res,
259 }, nil, nil
260}
261
262// WebhookLogs returns a paginated list of webhook delivery logs, optionally
263// filtered by webhook id. Requires super-admin auth. Logic migrated from

Callers

nothing calls this directly

Calls 4

requireSuperAdminMethod · 0.95
GetPaginationFunction · 0.92
AsAPIWebhookMethod · 0.80
ListWebhookMethod · 0.65

Tested by

no test coverage detected