Skip to content

Commit 7331560

Browse files
committed
Remove legacy docs
There wasn't much here, but we don't really want to document them at all.
1 parent ba82c1d commit 7331560

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

docs/make-api-docs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ def endpoint_sort_key(rule):
111111
handler = app.view_functions[ep]
112112

113113
doc = handler.__doc__
114+
if ep.startswith('legacy'):
115+
# We deliberately omit legacy endpoint documentation
116+
if doc is not None:
117+
app.logger.warning(f"Legacy endpoint {ep} has docstring but it will be omitted");
118+
continue
114119
if doc is None:
115120
app.logger.warning(f"Endpoint {ep} has no docstring!")
116121
doc = '*(undocumented)*'

sogs/routes/legacy.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def legacy_check_user_room(
9494

9595
@legacy.get("/rooms")
9696
def get_rooms():
97-
"""serve public room list for user"""
97+
# serve public room list for user
9898

9999
return jsonify(
100100
{
@@ -107,7 +107,8 @@ def get_rooms():
107107

108108
@legacy.get("/rooms/<Room:room>")
109109
def get_room_info(room):
110-
"""serve room metadata"""
110+
# serve room metadata
111+
111112
# This really should be authenticated but legacy Session just doesn't pass along auth info.
112113
# legacy_check_user_room(room=room, update_activity=False, accessible=True)
113114

@@ -120,7 +121,8 @@ def get_room_info(room):
120121

121122
@legacy.get("/rooms/<Room:room>/image")
122123
def legacy_serve_room_image(room):
123-
"""serve room icon"""
124+
# serve room icon
125+
124126
# This really should be authenticated but legacy Session just doesn't pass along auth info.
125127
# legacy_check_user_room(room=room, update_activity=False, accessible=True)
126128

@@ -142,16 +144,15 @@ def legacy_member_count():
142144

143145
@legacy.post("/claim_auth_token")
144146
def legacy_claim_auth():
145-
"""this does nothing but needs to exist for backwards compat"""
147+
# this does nothing but needs to exist for backwards compat
148+
146149
return jsonify({'status_code': http.OK})
147150

148151

149152
@legacy.get("/auth_token_challenge")
150153
def legacy_auth_token_challenge():
151-
"""
152-
legacy endpoint to give back an encrypted auth token bundle for the client to use to
153-
authenticate.
154-
"""
154+
# legacy endpoint to give back an encrypted auth token bundle for the client to use to
155+
# authenticate.
155156

156157
user, room = legacy_check_user_room(request.args.get("public_key", ""), read=False)
157158

0 commit comments

Comments
 (0)