1 # frozen_string_literal: true
4 class RelaysController
< BaseController
5 before_action
:set_relay, except
: [:index, :new, :create]
6 before_action
:require_signatures_enabled!
, only
: [:new, :create, :enable]
9 authorize
:relay, :update?
14 authorize
:relay, :update?
19 authorize
:relay, :update?
21 @relay = Relay
.new(resource_params
)
25 redirect_to admin_relays_path
32 authorize
:relay, :update?
34 redirect_to admin_relays_path
38 authorize
:relay, :update?
40 redirect_to admin_relays_path
44 authorize
:relay, :update?
46 redirect_to admin_relays_path
52 @relay = Relay
.find(params
[:id])
56 params
.require(:relay).permit(:inbox_url)
59 def require_signatures_enabled!
60 redirect_to admin_relays_path
, alert
: I18n
.t('admin.relays.signatures_not_enabled') if authorized_fetch_mode
?