Clean up & Add support to update objects in feed API
[mediagoblin.git] / mediagoblin / federation / routing.py
CommitLineData
d7b3805f
JT
1# GNU MediaGoblin -- federated, autonomous media hosting
2# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
3#
4# This program is free software: you can redistribute it and/or modify
5# it under the terms of the GNU Affero General Public License as published by
6# the Free Software Foundation, either version 3 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Affero General Public License for more details.
13#
14# You should have received a copy of the GNU Affero General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17from mediagoblin.tools.routing import add_route
18
19# Add user profile
20add_route(
21 "mediagoblin.federation.user",
22 "/api/user/<string:username>/",
23 "mediagoblin.federation.views:user"
24 )
25
26add_route(
a5682e89 27 "mediagoblin.federation.user.profile",
d7b3805f 28 "/api/user/<string:username>/profile",
a5682e89 29 "mediagoblin.federation.views:profile"
d7b3805f
JT
30 )
31
32# Inbox and Outbox (feed)
33add_route(
34 "mediagoblin.federation.feed",
35 "/api/user/<string:username>/feed",
36 "mediagoblin.federation.views:feed"
37 )
38
d4a21d7e 39add_route(
40 "mediagoblin.federation.user.uploads",
41 "/api/user/<string:username>/uploads",
42 "mediagoblin.federation.views:uploads"
43 )
44
d7b3805f
JT
45add_route(
46 "mediagoblin.federation.inbox",
47 "/api/user/<string:username>/inbox",
c894b424 48 "mediagoblin.federation.views:feed"
d7b3805f 49 )
5a2056f7
JT
50
51# object endpoints
52add_route(
53 "mediagoblin.federation.object",
54 "/api/<string:objectType>/<string:uuid>",
55 "mediagoblin.federation.views:object"
56 )
98596dd0 57add_route(
58 "mediagoblin.federation.object.comments",
59 "/api/<string:objectType>/<string:uuid>/comments",
60 "mediagoblin.federation.views:object_comments"
61 )
a5682e89 62
63add_route(
64 "mediagoblin.webfinger.well-known.host-meta",
65 "/.well-known/host-meta",
66 "mediagoblin.federation.views:host_meta"
67 )
68
18297655 69add_route(
70 "mediagoblin.webfinger.well-known.host-meta.json",
71 "/.well-known/host-meta.json",
72 "mediagoblin.federation.views:host_meta"
73 )
74
a5682e89 75add_route(
76 "mediagoblin.webfinger.whoami",
77 "/api/whoami",
78 "mediagoblin.federation.views:whoami"
79 )