闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
573 B

  1. # frozen_string_literal: true
  2. class ActivityPub::OneTimeKeySerializer < ActivityPub::Serializer
  3. context :security
  4. context_extensions :olm
  5. class SignatureSerializer < ActivityPub::Serializer
  6. attributes :type, :signature_value
  7. def type
  8. 'Ed25519Signature'
  9. end
  10. def signature_value
  11. object.signature
  12. end
  13. end
  14. attributes :key_id, :type, :public_key_base64
  15. has_one :signature, serializer: SignatureSerializer
  16. def type
  17. 'Curve25519Key'
  18. end
  19. def public_key_base64
  20. object.key
  21. end
  22. def signature
  23. object
  24. end
  25. end