mirror of
https://github.com/kikobar/mastodon.git
synced 2024-11-17 04:32:22 +00:00
34 lines
858 B
Ruby
34 lines
858 B
Ruby
# frozen_string_literal: true
|
|
|
|
class InstanceActorsController < ActivityPub::BaseController
|
|
vary_by ''
|
|
|
|
serialization_scope nil
|
|
|
|
before_action :set_account
|
|
|
|
skip_before_action :authenticate_user! # From `AccountOwnedConcern`
|
|
skip_before_action :require_functional!
|
|
skip_before_action :update_user_sign_in
|
|
|
|
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
|
|
|
|
# Skips various `before_action` from `AccountOwnedConcern`
|
|
def account_required?
|
|
false
|
|
end
|
|
|
|
def set_account
|
|
@account = Account.representative
|
|
end
|
|
|
|
def restrict_fields_to
|
|
%i(id type preferred_username inbox outbox public_key endpoints url manually_approves_followers)
|
|
end
|
|
end
|