forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove rabl dependency (mastodon#5894)
* Remove rabl dependency * Replicate old Oj configuration
- Loading branch information
Showing
9 changed files
with
45 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
class WebfingerSerializer < ActiveModel::Serializer | ||
include RoutingHelper | ||
|
||
attributes :subject, :aliases, :links | ||
|
||
def subject | ||
object.to_webfinger_s | ||
end | ||
|
||
def aliases | ||
[short_account_url(object), account_url(object)] | ||
end | ||
|
||
def links | ||
[ | ||
{ rel: 'http://webfinger.net/rel/profile-page', type: 'text/html', href: short_account_url(object) }, | ||
{ rel: 'http://schemas.google.com/g/2010#updates-from', type: 'application/atom+xml', href: account_url(object, format: 'atom') }, | ||
{ rel: 'self', type: 'application/activity+json', href: account_url(object) }, | ||
{ rel: 'salmon', href: api_salmon_url(object.id) }, | ||
{ rel: 'magic-public-key', href: "data:application/magic-public-key,#{object.magic_key}" }, | ||
{ rel: 'http://ostatus.org/schema/1.0/subscribe', template: "#{authorize_follow_url}?acct={uri}" }, | ||
] | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
Nokogiri::XML::Builder.new do |xml| | ||
xml.XRD(xmlns: 'http://docs.oasis-open.org/ns/xri/xrd-1.0') do | ||
xml.Subject @canonical_account_uri | ||
xml.Subject @account.to_webfinger_s | ||
xml.Alias short_account_url(@account) | ||
xml.Alias account_url(@account) | ||
xml.Link(rel: 'http://webfinger.net/rel/profile-page', type: 'text/html', href: short_account_url(@account)) | ||
xml.Link(rel: 'http://schemas.google.com/g/2010#updates-from', type: 'application/atom+xml', href: account_url(@account, format: 'atom')) | ||
xml.Link(rel: 'self', type: 'application/activity+json', href: account_url(@account)) | ||
xml.Link(rel: 'salmon', href: api_salmon_url(@account.id)) | ||
xml.Link(rel: 'magic-public-key', href: "data:application/magic-public-key,#{@magic_key}") | ||
xml.Link(rel: 'magic-public-key', href: "data:application/magic-public-key,#{@account.magic_key}") | ||
xml.Link(rel: 'http://ostatus.org/schema/1.0/subscribe', template: "#{authorize_follow_url}?acct={uri}") | ||
end | ||
end.to_xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Oj.default_options = { mode: :compat, time_format: :ruby, use_to_json: true } |
This file was deleted.
Oops, something went wrong.