2019-07-19 08:44:42 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-04-26 18:42:26 +09:00
|
|
|
class InstanceActorsController < ActivityPub::BaseController
|
|
|
|
vary_by ''
|
2019-07-19 08:44:42 +09:00
|
|
|
|
2023-04-26 18:42:26 +09:00
|
|
|
serialization_scope nil
|
|
|
|
|
|
|
|
before_action :set_account
|
2024-03-15 19:40:21 +09:00
|
|
|
|
|
|
|
skip_before_action :authenticate_user! # From `AccountOwnedConcern`
|
2023-04-26 18:42:26 +09:00
|
|
|
skip_before_action :require_functional!
|
|
|
|
skip_before_action :update_user_sign_in
|
2019-08-13 22:30:37 +09:00
|
|
|
|
2019-07-19 08:44:42 +09:00
|
|
|
def show
|
|
|
|
expires_in 10.minutes, public: true
|
|
|
|
render json: @account, content_type: 'application/activity+json', serializer: ActivityPub::ActorSerializer, adapter: ActivityPub::Adapter, fields: restrict_fields_to
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2024-03-15 19:40:21 +09:00
|
|
|
# Skips various `before_action` from `AccountOwnedConcern`
|
|
|
|
def account_required?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
2019-07-19 08:44:42 +09:00
|
|
|
def set_account
|
2021-02-10 02:12:54 +09:00
|
|
|
@account = Account.representative
|
2019-07-19 08:44:42 +09:00
|
|
|
end
|
|
|
|
|
|
|
|
def restrict_fields_to
|
2020-09-03 01:42:50 +09:00
|
|
|
%i(id type preferred_username inbox outbox public_key endpoints url manually_approves_followers)
|
2019-07-19 08:44:42 +09:00
|
|
|
end
|
|
|
|
end
|