diff options
Diffstat (limited to 'app/serializers/activity_pub/user_entity.rb')
-rw-r--r-- | app/serializers/activity_pub/user_entity.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/serializers/activity_pub/user_entity.rb b/app/serializers/activity_pub/user_entity.rb new file mode 100644 index 00000000000..bd0886db5b2 --- /dev/null +++ b/app/serializers/activity_pub/user_entity.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module ActivityPub + class UserEntity < Grape::Entity + include RequestAwareEntity + + expose :id do |user| + user_url(user) + end + + expose :type do |*| + 'Person' + end + + expose :name + expose :username, as: :preferredUsername + + expose :url do |user| + user_url(user) + end + end +end |