about summary refs log tree commit diff
path: root/app/lib/proof_provider/keybase/serializer.rb
blob: d29283600ef35bf2f29501a3f23b7963f1589590 (plain) (blame)
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
# frozen_string_literal: true

class ProofProvider::Keybase::Serializer < ActiveModel::Serializer
  include RoutingHelper

  attribute :avatar

  has_many :identity_proofs, key: :signatures

  def avatar
    full_asset_url(object.avatar_original_url)
  end

  class AccountIdentityProofSerializer < ActiveModel::Serializer
    attributes :sig_hash, :kb_username

    def sig_hash
      object.token
    end

    def kb_username
      object.provider_username
    end
  end
end