0
0
Fork 0

Add authorized_fetch server setting in addition to env var (#25798)

This commit is contained in:
Claire 2023-09-01 15:41:10 +02:00 committed by GitHub
parent 6c4c72497a
commit 9e26cd5503
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 43 additions and 8 deletions

View file

@ -0,0 +1,11 @@
# frozen_string_literal: true
module AuthorizedFetchHelper
def authorized_fetch_mode?
ENV.fetch('AUTHORIZED_FETCH') { Setting.authorized_fetch } == 'true' || Rails.configuration.x.limited_federation_mode
end
def authorized_fetch_overridden?
ENV.key?('AUTHORIZED_FETCH') || Rails.configuration.x.limited_federation_mode
end
end