~cytrogen/masto-fe

ref: 685270f3f7ea6d4a8a48ec641e8fdfd9fc2e2d7f masto-fe/app/serializers/activitypub/one_time_key_serializer.rb -rw-r--r-- 573 bytes
685270f3 — Claire [Glitch] Fix clicking “Explore” or “Live feeds” column headers to scroll in advanced mode 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
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true

class ActivityPub::OneTimeKeySerializer < ActivityPub::Serializer
  context :security

  context_extensions :olm

  class SignatureSerializer < ActivityPub::Serializer
    attributes :type, :signature_value

    def type
      'Ed25519Signature'
    end

    def signature_value
      object.signature
    end
  end

  attributes :key_id, :type, :public_key_base64

  has_one :signature, serializer: SignatureSerializer

  def type
    'Curve25519Key'
  end

  def public_key_base64
    object.key
  end

  def signature
    object
  end
end