2019-07-18 16:44:42 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-04-26 02:42:26 -07:00
|
|
|
class InstanceActorsController < ActivityPub::BaseController
|
|
|
|
vary_by ''
|
2019-07-18 16:44:42 -07:00
|
|
|
|
2023-04-26 02:42:26 -07:00
|
|
|
serialization_scope nil
|
|
|
|
|
|
|
|
before_action :set_account
|
2024-03-15 03:40:21 -07:00
|
|
|
|
|
|
|
skip_before_action :authenticate_user! # From `AccountOwnedConcern`
|
2023-04-26 02:42:26 -07:00
|
|
|
skip_before_action :require_functional!
|
|
|
|
skip_before_action :update_user_sign_in
|
2019-08-13 06:30:37 -07:00
|
|
|
|
2019-07-18 16:44:42 -07: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 03:40:21 -07:00
|
|
|
# Skips various `before_action` from `AccountOwnedConcern`
|
|
|
|
def account_required?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
2019-07-18 16:44:42 -07:00
|
|
|
def set_account
|
2021-02-09 09:12:54 -08:00
|
|
|
@account = Account.representative
|
2019-07-18 16:44:42 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
def restrict_fields_to
|
2020-09-02 09:42:50 -07:00
|
|
|
%i(id type preferred_username inbox outbox public_key endpoints url manually_approves_followers)
|
2019-07-18 16:44:42 -07:00
|
|
|
end
|
|
|
|
end
|