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)
| 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. |
| 180 | func (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. |
nothing calls this directly
no test coverage detected