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

Method AddWebhook

internal/grpcsrv/handlers/admin.go:180–192  ·  view source on GitHub ↗

AddWebhook delegates to service.AddWebhook. Headers arrive as the shared AppData struct and unwrap to a free-form map. Requires super-admin auth.

(ctx context.Context, req *authorizerv1.AddWebhookRequest)

Source from the content-addressed store, hash-verified

178// AddWebhook delegates to service.AddWebhook. Headers arrive as the shared
179// AppData struct and unwrap to a free-form map. Requires super-admin auth.
180func (h *AdminHandler) AddWebhook(ctx context.Context, req *authorizerv1.AddWebhookRequest) (*authorizerv1.AddWebhookResponse, error) {
181 res, _, err := h.Service.AddWebhook(ctx, transport.MetaFromGRPC(ctx), &model.AddWebhookRequest{
182 EventName: req.GetEventName(),
183 EventDescription: req.EventDescription,
184 Endpoint: req.GetEndpoint(),
185 Enabled: req.GetEnabled(),
186 Headers: appDataToMap(req.GetHeaders()),
187 })
188 if err != nil {
189 return nil, err
190 }
191 return &authorizerv1.AddWebhookResponse{Message: res.Message}, nil
192}
193
194// UpdateWebhook delegates to service.UpdateWebhook. Optional proto fields map
195// 1:1 onto the model's nullable pointers. Requires super-admin auth.

Callers

nothing calls this directly

Calls 7

MetaFromGRPCFunction · 0.92
appDataToMapFunction · 0.85
AddWebhookMethod · 0.65
GetEventNameMethod · 0.45
GetEndpointMethod · 0.45
GetEnabledMethod · 0.45
GetHeadersMethod · 0.45

Tested by

no test coverage detected