Merge remote-tracking branch 'parent/main' into upstream-20241101
This commit is contained in:
commit
1c1f76697b
200 changed files with 1931 additions and 741 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
class OauthMetadataSerializer < ActiveModel::Serializer
|
||||
attributes :issuer, :authorization_endpoint, :token_endpoint,
|
||||
:revocation_endpoint, :scopes_supported,
|
||||
:revocation_endpoint, :userinfo_endpoint, :scopes_supported,
|
||||
:response_types_supported, :response_modes_supported,
|
||||
:grant_types_supported, :token_endpoint_auth_methods_supported,
|
||||
:code_challenge_methods_supported,
|
||||
|
|
31
app/serializers/oauth_userinfo_serializer.rb
Normal file
31
app/serializers/oauth_userinfo_serializer.rb
Normal file
|
@ -0,0 +1,31 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class OauthUserinfoSerializer < ActiveModel::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :iss, :sub, :name, :preferred_username, :profile, :picture
|
||||
|
||||
def iss
|
||||
root_url
|
||||
end
|
||||
|
||||
def sub
|
||||
ActivityPub::TagManager.instance.uri_for(object)
|
||||
end
|
||||
|
||||
def name
|
||||
object.display_name
|
||||
end
|
||||
|
||||
def preferred_username
|
||||
object.username
|
||||
end
|
||||
|
||||
def profile
|
||||
ActivityPub::TagManager.instance.url_for(object)
|
||||
end
|
||||
|
||||
def picture
|
||||
full_asset_url(object.avatar_original_url)
|
||||
end
|
||||
end
|
|
@ -127,11 +127,11 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def reblogs_count
|
||||
relationships&.attributes_map&.dig(object.id, :reblogs_count) || object.reblogs_count
|
||||
object.untrusted_reblogs_count || relationships&.attributes_map&.dig(object.id, :reblogs_count) || object.reblogs_count
|
||||
end
|
||||
|
||||
def favourites_count
|
||||
relationships&.attributes_map&.dig(object.id, :favourites_count) || object.favourites_count
|
||||
object.untrusted_favourites_count || relationships&.attributes_map&.dig(object.id, :favourites_count) || object.favourites_count
|
||||
end
|
||||
|
||||
def favourited
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue