~cytrogen/masto-fe

ref: 3ca94f6d4a99cdf7f99eefd7d26a18a82c3c6f78 masto-fe/app/controllers/instance_actors_controller.rb -rw-r--r-- 685 bytes
3ca94f6d — Claire Merge commit '93d051e47d27b5bd10be922a81d4d4eb6c306330' into glitch-soc/merge-upstream 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

class InstanceActorsController < ActivityPub::BaseController
  vary_by ''

  serialization_scope nil

  before_action :set_account
  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

  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