logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

public_key_serializer.rb (353B)


  1. # frozen_string_literal: true
  2. class ActivityPub::PublicKeySerializer < ActiveModel::Serializer
  3. attributes :id, :owner, :public_key_pem
  4. def id
  5. [ActivityPub::TagManager.instance.uri_for(object), '#main-key'].join
  6. end
  7. def owner
  8. ActivityPub::TagManager.instance.uri_for(object)
  9. end
  10. def public_key_pem
  11. object.public_key
  12. end
  13. end