Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

GET /devices endpoint #939

Merged
merged 3 commits into from Jul 21, 2016

Conversation

Projects
None yet
2 participants
Member

richvdh commented Jul 20, 2016

implement a GET /devices endpoint which lists all of the user's devices.

This needs #938 to be useful, but is harmless enough without it.

It also returns the last IP where we saw that device, so there is some dancing
to fish that out of the user_ips table.

richvdh added some commits Jul 20, 2016

GET /devices endpoint
implement a GET /devices endpoint which lists all of the user's devices.

It also returns the last IP where we saw that device, so there is some dancing
to fish that out of the user_ips table.
Merge branch 'develop' into rav/get_devices_api
(pick up PR #938 in the hope of fixing the UTs)

@dbkr dbkr commented on the diff Jul 21, 2016

synapse/storage/client_ips.py
+ "user_id",
+ "access_token",
+ "ip",
+ "user_agent",
+ "device_id",
+ "last_seen",
+ ),
+ devices=devices
+ )
+
+ ret = {(d["user_id"], d["device_id"]): d for d in res}
+ defer.returnValue(ret)
+
+ @classmethod
+ def _get_last_client_ip_by_device_txn(cls, txn, devices, retcols):
+ def where_clause_for_device(d):
@dbkr

dbkr Jul 21, 2016

Member

Was this meant to be here?

@dbkr dbkr merged commit 44adde4 into develop Jul 21, 2016

8 of 10 checks passed

Sytest Dendron (Commit) Build #307 origin/rav/get_devices_api failed in 1 min 28 sec
Details
Sytest Dendron (Merged PR) Build finished.
Details
Flake8 + Packaging (Commit) Build #1193 origin/rav/get_devices_api succeeded in 33 sec
Details
Flake8 + Packaging (Merged PR) Build finished.
Details
Sytest Postgres (Commit) Build #1144 origin/rav/get_devices_api succeeded in 6 min 42 sec
Details
Sytest Postgres (Merged PR) Build finished.
Details
Sytest SQLite (Commit) Build #1167 origin/rav/get_devices_api succeeded in 6 min 3 sec
Details
Sytest SQLite (Merged PR) Build finished.
Details
Unit Tests (Commit) Build #1232 origin/rav/get_devices_api succeeded in 2 min 19 sec
Details
Unit Tests (Merged PR) Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment