public_key_serializer.rb 353 B

1234567891011121314151617
  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