summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <daniel@matrix.org>2015-08-25 16:23:06 +0100
committerDaniel Wagner-Hall <daniel@matrix.org>2015-08-25 16:23:06 +0100
commita0b181bd17cb7ec2a43ed2dbdeb1bb40f3f4373c (patch)
tree7f136968479fe90438c30e252d364fd4fd72fc01 /synapse/api
parentMerge pull request #244 from matrix-org/markjh/refresh_tokens (diff)
downloadsynapse-a0b181bd17cb7ec2a43ed2dbdeb1bb40f3f4373c.tar.xz
Remove completely unused concepts from codebase
Removes device_id and ClientInfo

device_id is never actually written, and the matrix.org DB has no
non-null entries for it. Right now, it's just cluttering up code.

This doesn't remove the columns from the database, because that's
fiddly.
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 3d9237ccc3..1496db7dff 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -20,7 +20,7 @@ from twisted.internet import defer
 from synapse.api.constants import EventTypes, Membership, JoinRules
 from synapse.api.errors import AuthError, Codes, SynapseError
 from synapse.util.logutils import log_function
-from synapse.types import UserID, ClientInfo
+from synapse.types import UserID
 
 import logging
 
@@ -322,9 +322,9 @@ class Auth(object):
         Args:
             request - An HTTP request with an access_token query parameter.
         Returns:
-            tuple : of UserID and device string:
-                User ID object of the user making the request
-                ClientInfo object of the client instance the user is using
+            tuple of:
+                UserID (str)
+                Access token ID (str)
         Raises:
             AuthError if no user by that token exists or the token is invalid.
         """
@@ -355,7 +355,7 @@ class Auth(object):
                 request.authenticated_entity = user_id
 
                 defer.returnValue(
-                    (UserID.from_string(user_id), ClientInfo("", ""))
+                    (UserID.from_string(user_id), "")
                 )
                 return
             except KeyError:
@@ -363,7 +363,6 @@ class Auth(object):
 
             user_info = yield self.get_user_by_access_token(access_token)
             user = user_info["user"]
-            device_id = user_info["device_id"]
             token_id = user_info["token_id"]
 
             ip_addr = self.hs.get_ip_from_request(request)
@@ -375,14 +374,13 @@ class Auth(object):
                 self.store.insert_client_ip(
                     user=user,
                     access_token=access_token,
-                    device_id=user_info["device_id"],
                     ip=ip_addr,
                     user_agent=user_agent
                 )
 
             request.authenticated_entity = user.to_string()
 
-            defer.returnValue((user, ClientInfo(device_id, token_id)))
+            defer.returnValue((user, token_id,))
         except KeyError:
             raise AuthError(
                 self.TOKEN_NOT_FOUND_HTTP_STATUS, "Missing access token.",
@@ -396,7 +394,7 @@ class Auth(object):
         Args:
             token (str): The access token to get the user by.
         Returns:
-            dict : dict that includes the user, device_id, and whether the
+            dict : dict that includes the user and whether the
                 user is a server admin.
         Raises:
             AuthError if no user by that token exists or the token is invalid.
@@ -409,7 +407,6 @@ class Auth(object):
             )
         user_info = {
             "admin": bool(ret.get("admin", False)),
-            "device_id": ret.get("device_id"),
             "user": UserID.from_string(ret.get("name")),
             "token_id": ret.get("token_id", None),
         }