Add ActivityPub representation for identity proofs (#10414)
* Add ActivityPub representation for identity proofs * Add tests
This commit is contained in:
parent
8fb69f1366
commit
1714ea5978
5 changed files with 93 additions and 4 deletions
|
@ -6,7 +6,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
|
|||
context :security
|
||||
|
||||
context_extensions :manually_approves_followers, :featured, :also_known_as,
|
||||
:moved_to, :property_value, :hashtag, :emoji
|
||||
:moved_to, :property_value, :hashtag, :emoji, :identity_proof
|
||||
|
||||
attributes :id, :type, :following, :followers,
|
||||
:inbox, :outbox, :featured,
|
||||
|
@ -115,7 +115,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
|
|||
end
|
||||
|
||||
def virtual_attachments
|
||||
object.fields
|
||||
object.fields + object.identity_proofs.active
|
||||
end
|
||||
|
||||
def moved_to
|
||||
|
@ -158,4 +158,24 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
|
|||
Formatter.instance.format_field(object.account, object.value)
|
||||
end
|
||||
end
|
||||
|
||||
class AccountIdentityProofSerializer < ActivityPub::Serializer
|
||||
attributes :type, :name, :signature_algorithm, :signature_value
|
||||
|
||||
def type
|
||||
'IdentityProof'
|
||||
end
|
||||
|
||||
def name
|
||||
object.provider_username
|
||||
end
|
||||
|
||||
def signature_algorithm
|
||||
object.provider
|
||||
end
|
||||
|
||||
def signature_value
|
||||
object.token
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue