summary refs log tree commit diff
path: root/synapse/storage/openid.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-21 12:56:42 +0100
committerErik Johnston <erik@matrix.org>2019-10-21 16:05:06 +0100
commitc66a06ac6b69b0a03f5c6284ded980399e9df94e (patch)
tree01dfd3b9098a9ace759403744d122c18efbd97ff /synapse/storage/openid.py
parentMerge branch 'master' into develop (diff)
downloadsynapse-c66a06ac6b69b0a03f5c6284ded980399e9df94e.tar.xz
Move storage classes into a main "data store".
This is in preparation for having multiple data stores that offer
different functionality, e.g. splitting out state or event storage.
Diffstat (limited to 'synapse/storage/openid.py')
-rw-r--r--synapse/storage/openid.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/synapse/storage/openid.py b/synapse/storage/openid.py
deleted file mode 100644
index b3318045ee..0000000000
--- a/synapse/storage/openid.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from ._base import SQLBaseStore
-
-
-class OpenIdStore(SQLBaseStore):
-    def insert_open_id_token(self, token, ts_valid_until_ms, user_id):
-        return self._simple_insert(
-            table="open_id_tokens",
-            values={
-                "token": token,
-                "ts_valid_until_ms": ts_valid_until_ms,
-                "user_id": user_id,
-            },
-            desc="insert_open_id_token",
-        )
-
-    def get_user_id_for_open_id_token(self, token, ts_now_ms):
-        def get_user_id_for_token_txn(txn):
-            sql = (
-                "SELECT user_id FROM open_id_tokens"
-                " WHERE token = ? AND ? <= ts_valid_until_ms"
-            )
-
-            txn.execute(sql, (token, ts_now_ms))
-
-            rows = txn.fetchall()
-            if not rows:
-                return None
-            else:
-                return rows[0][0]
-
-        return self.runInteraction("get_user_id_for_token", get_user_id_for_token_txn)