Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix functional user requirements in whitelist mode #14093

Merged
merged 1 commit into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AccountsController < ApplicationController
before_action :set_body_classes

skip_around_action :set_locale, if: -> { [:json, :rss].include?(request.format&.to_sym) }
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?

def show
respond_to do |format|
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Api::BaseController < ApplicationController
include RateLimitHeaders

skip_before_action :store_current_location
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?

before_action :require_authenticated_user!, if: :disallow_unauthenticated_api_access?
before_action :set_cache_headers
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/directories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class DirectoriesController < ApplicationController
before_action :set_tag, only: :show
before_action :set_accounts

skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?

def index
render :index
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/follower_accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FollowerAccountsController < ApplicationController
before_action :set_cache_headers

skip_around_action :set_locale, if: -> { request.format == :json }
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?

def index
respond_to do |format|
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/following_accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FollowingAccountsController < ApplicationController
before_action :set_cache_headers

skip_around_action :set_locale, if: -> { request.format == :json }
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?

def index
respond_to do |format|
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/media_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class MediaController < ApplicationController
include Authorization

skip_before_action :store_current_location
skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?

before_action :authenticate_user!, if: :whitelist_mode?
before_action :set_media_attachment
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/remote_interaction_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RemoteInteractionController < ApplicationController
before_action :set_status
before_action :set_body_classes

skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?

def new
@remote_follow = RemoteFollow.new(session_params)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/statuses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class StatusesController < ApplicationController
before_action :set_autoplay, only: :embed

skip_around_action :set_locale, if: -> { request.format == :json }
skip_before_action :require_functional!, only: [:show, :embed]
skip_before_action :require_functional!, only: [:show, :embed], unless: :whitelist_mode?

content_security_policy only: :embed do |p|
p.frame_ancestors(false)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TagsController < ApplicationController
before_action :set_body_classes
before_action :set_instance_presenter

skip_before_action :require_functional!
skip_before_action :require_functional!, unless: :whitelist_mode?

def show
respond_to do |format|
Expand Down