Example #1
0
def nodeinfo_well_known_view(request):
    """Generate .well-known/nodeinfo."""
    wellknown = get_nodeinfo_well_known_document(settings.SOCIALHOME_URL)
    return JsonResponse(wellknown)
Example #2
0
 def test_nodeinfo_wellknown_document(self):
     wellknown = get_nodeinfo_well_known_document("https://example.com")
     assert wellknown["links"][0][
         "rel"] == "http://nodeinfo.diaspora.software/ns/schema/1.0"
     assert wellknown["links"][0][
         "href"] == "https://example.com/nodeinfo/1.0"
Example #3
0
def nodeinfo_wellknown():
    nodeinfo = get_nodeinfo_well_known_document(app.config.get("SERVER_HOST"))
    return Response(json.dumps(nodeinfo),
                    status=200,
                    mimetype="application/json")
 def test_nodeinfo_wellknown_document(self):
     wellknown = get_nodeinfo_well_known_document("https://example.com")
     assert wellknown["links"][0]["rel"] == "http://nodeinfo.diaspora.software/ns/schema/1.0"
     assert wellknown["links"][0]["href"] == "https://example.com/nodeinfo/1.0"