Add administrative webhooks (#18510)
* Add administrative webhooks * Fix error when webhook is deleted before delivery worker runs
This commit is contained in:
parent
17ba5e1e61
commit
a2871cd747
33 changed files with 530 additions and 8 deletions
19
app/controllers/admin/webhooks/secrets_controller.rb
Normal file
19
app/controllers/admin/webhooks/secrets_controller.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class Webhooks::SecretsController < BaseController
|
||||
before_action :set_webhook
|
||||
|
||||
def rotate
|
||||
authorize @webhook, :rotate_secret?
|
||||
@webhook.rotate_secret!
|
||||
redirect_to admin_webhook_path(@webhook)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_webhook
|
||||
@webhook = Webhook.find(params[:webhook_id])
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue