Add whitelist mode (#11291)
This commit is contained in:
parent
85b7b565de
commit
24552b5160
44 changed files with 302 additions and 53 deletions
|
@ -14,6 +14,6 @@ module Payloadable
|
|||
end
|
||||
|
||||
def signing_enabled?
|
||||
ENV['AUTHORIZED_FETCH'] != 'true'
|
||||
ENV['AUTHORIZED_FETCH'] != 'true' && !Rails.configuration.x.whitelist_mode
|
||||
end
|
||||
end
|
||||
|
|
11
app/services/unallow_domain_service.rb
Normal file
11
app/services/unallow_domain_service.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class UnallowDomainService < BaseService
|
||||
def call(domain_allow)
|
||||
Account.where(domain: domain_allow.domain).find_each do |account|
|
||||
SuspendAccountService.new.call(account, destroy: true)
|
||||
end
|
||||
|
||||
domain_allow.destroy
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue