Feature: Implement FEP-2677 allowing discovery of the instance application actor

This commit is contained in:
Emelia Smith 2024-01-03 22:17:59 +01:00
parent 195b89d336
commit 731164d005
No known key found for this signature in database
3 changed files with 20 additions and 1 deletions

View file

@ -6,6 +6,9 @@ class NodeInfo::DiscoverySerializer < ActiveModel::Serializer
attribute :links
def links
[{ rel: 'http://nodeinfo.diaspora.software/ns/schema/2.0', href: nodeinfo_schema_url }]
[
{ rel: 'http://nodeinfo.diaspora.software/ns/schema/2.0', href: nodeinfo_schema_url },
{ rel: 'https://www.w3.org/ns/activitystreams#Application', href: instance_actor_url },
]
end
end

View file

@ -19,6 +19,10 @@ describe 'The well-known node-info endpoints' do
include(
rel: 'http://nodeinfo.diaspora.software/ns/schema/2.0',
href: include('nodeinfo/2.0')
),
include(
rel: 'https://www.w3.org/ns/activitystreams#Application',
href: end_with('/actor')
)
)
)

View file

@ -16,4 +16,16 @@ describe 'Well Known routes' do
.to route_to('well_known/webfinger#show')
end
end
describe 'the nodeinfo routes' do
it 'routes to discovery (index) route' do
expect(get('/.well-known/nodeinfo'))
.to route_to('well_known/node_info#index', format: 'json')
end
it 'routes to the show route' do
expect(get('/nodeinfo/2.0'))
.to route_to('well_known/node_info#show')
end
end
end