Class AlertWebhookService

java.lang.Object
dev.dokimos.server.service.AlertWebhookService

@Service public class AlertWebhookService extends Object
Manages a project's regression-alert webhooks. Responses never carry the signing secret; only whether one is configured is exposed. All operations are scoped to a project so a webhook can only be read or mutated through its owning project.
  • Constructor Details

  • Method Details

    • create

      @Transactional public AlertWebhookView create(UUID projectId, CreateAlertWebhookRequest request)
      Registers a webhook for a project.
      Parameters:
      projectId - the project to attach the webhook to
      request - the webhook definition
      Returns:
      the public view of the saved webhook
      Throws:
      IllegalArgumentException - if the project does not exist (mapped to 404)
    • list

      @Transactional(readOnly=true) public List<AlertWebhookView> list(UUID projectId)
      Lists a project's webhooks in creation order.
      Throws:
      IllegalArgumentException - if the project does not exist (mapped to 404)
    • get

      @Transactional(readOnly=true) public AlertWebhookView get(UUID projectId, UUID webhookId)
      Returns one of a project's webhooks.
      Throws:
      IllegalArgumentException - if the project or webhook does not exist, or the webhook belongs to another project (mapped to 404)
    • update

      @Transactional public AlertWebhookView update(UUID projectId, UUID webhookId, UpdateAlertWebhookRequest request)
      Replaces a webhook's url and enabled flag, and optionally its secret. A blank secret keeps the existing secret so a receiver never loses a configured secret by accident.
      Throws:
      IllegalArgumentException - if the project or webhook does not exist, or the webhook belongs to another project (mapped to 404)
    • delete

      @Transactional public void delete(UUID projectId, UUID webhookId)
      Deletes one of a project's webhooks.
      Throws:
      IllegalArgumentException - if the project or webhook does not exist, or the webhook belongs to another project (mapped to 404)