Commit Graph

163 Commits (57826d645bd62ab534dbcab8d66a98daec145459)

Author SHA1 Message Date
Daniel Wagner-Hall 6a4b650d8a Attempt to validate macaroons
A couple of weird caveats:
 * If we can't validate your macaroon, we fall back to checking that
   your access token is in the DB, and ignoring the failure
 * Even if we can validate your macaroon, we still have to hit the DB to
   get the access token ID, which we pretend is a device ID all over the
   codebase.

This mostly adds the interesting code, and points out the two pieces we
need to delete (and necessary conditions) in order to fix the above
caveats.
2015-08-26 13:22:23 +01:00
Daniel Wagner-Hall a9d8bd95e7 Stop looking up "admin", which we never read 2015-08-25 16:29:39 +01:00
Daniel Wagner-Hall a0b181bd17 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.
2015-08-25 16:23:06 +01:00
Daniel Wagner-Hall e8cf77fa49 Merge branch 'develop' into refresh
Conflicts:
	synapse/rest/client/v1/login.py
2015-08-20 16:25:40 +01:00
Daniel Wagner-Hall 13a6517d89 s/by_token/by_access_token/g
We're about to have two kinds of token, access and refresh
2015-08-20 16:01:29 +01:00
David Baker 07ad03d5df Fix tests 2015-08-04 15:18:40 +01:00
Kegan Dougal 11b0a34074 Use the same reg paths as register v1 for ASes.
Namely this means using registration_handler.appservice_register.
2015-07-29 10:00:54 +01:00
Kegan Dougal a4d62ba36a Fix v2_alpha registration. Add unit tests.
V2 Registration forced everyone (including ASes) to create a password for a
user, when ASes should be able to omit passwords. Also unbreak AS registration
in general which checked too early if the given username was claimed by an AS;
it was checked before knowing if the AS was the one doing the registration! Add
unit tests for AS reg, user reg and disabled_registration flag.
2015-07-28 17:34:12 +01:00
Erik Johnston f0dd6d4cbd Fix test. 2015-07-07 16:18:36 +01:00
Erik Johnston ddf7979531 Add receipts_key to StreamToken 2015-07-02 11:45:44 +01:00
Mark Haines 17167898c8 Fix the presence tests 2015-05-22 16:22:54 +01:00
Mark Haines 49a2c10279 Merge pull request #157 from matrix-org/markjh/presence_performance
Improve presence performance in loadtest
2015-05-22 16:04:40 +01:00
Mark Haines 88f1ea36ce Oops, get_rooms_for_user returns a namedtuple, not a room_id 2015-05-21 15:23:58 +01:00
Mark Haines 8eca5bd50a Fix the presence tests 2015-05-20 13:22:18 +01:00
Mark Haines f1b83d88a3 Discard unused NotifierUserStreams 2015-05-13 16:54:02 +01:00
Mark Haines 63878c0379 Don't bother checking for updates if the stream token hasn't advanced for a user 2015-05-13 13:42:21 +01:00
Erik Johnston 327ca883ec Merge branch 'develop' of github.com:matrix-org/synapse into postgres 2015-04-28 13:39:42 +01:00
David Baker cb03fafdf1 Merge branch 'develop' into csauth 2015-04-17 13:51:10 +01:00
Erik Johnston 6ba2e3df4e Merge branch 'develop' of github.com:matrix-org/synapse into postgres 2015-04-17 11:22:31 +01:00
Paul "LeoNerd" Evans 04c7f3576e Various minor fixes to unit-test structure around typing notifications 2015-04-15 23:32:11 +01:00
Paul "LeoNerd" Evans 0268d40281 Have TypingNotificationEventSource.get_new_events_for_user() return a deferred, for consistency and extensibility 2015-04-15 23:09:35 +01:00
Erik Johnston 9236136f3a Make work in both Maria and SQLite. Fix tests 2015-04-01 14:12:33 +01:00
David Baker ce2766d19c Fix tests 2015-03-24 18:56:51 +00:00
Erik Johnston 6d74e46621 Fix tests 2015-03-09 17:01:11 +00:00
Kegan Dougal 0ebd632d39 Fix unit tests 2015-02-27 09:46:38 +00:00
Erik Johnston 5f4c28d313 Update tests 2015-02-19 14:34:32 +00:00
Kegan Dougal f2fdcb7c4b Merge branch 'develop' into application-services 2015-02-11 16:43:26 +00:00
Mark Haines 896253e085 Factor out some of the common homeserver setup code into a
setup_test_homeserver function in utils.
2015-02-11 11:37:30 +00:00
Kegan Dougal 5a7dd05818 Modify auth.get_user_by_req for authing appservices directly.
Add logic to map the appservice token to the autogenned appservice user ID.
Add unit tests for all forms of get_user_by_req (user/appservice,
valid/bad/missing tokens)
2015-02-09 14:14:15 +00:00
Mark Haines 33391db5f8 Merge in auth changes from develop 2015-01-29 15:54:54 +00:00
Mark Haines 9d8f798a3f Merge changes from develop 2015-01-29 14:55:27 +00:00
Mark Haines 26c8fff19e Merge pull request #36 from matrix-org/device_id_from_access_token
Extract the device id and token id from the access token when autheniticating users
2015-01-28 17:19:28 +00:00
Mark Haines 388581e087 Extract the id token of the token when authing users, include the token and device_id in the internal meta data for the event along with the transaction id when sending events 2015-01-28 16:58:23 +00:00
Mark Haines c59bcabf0b Return the device_id from get_auth_by_req 2015-01-28 15:43:41 +00:00
Paul "LeoNerd" Evans 0c14a699bb More unit-testing of REST errors 2015-01-27 18:07:21 +00:00
Paul "LeoNerd" Evans 54e513b4e6 Move storage of user filters into real datastore layer; now have to mock it out in the REST-level tests 2015-01-27 17:48:13 +00:00
Paul "LeoNerd" Evans f9958f3404 Use new V2AlphaRestTestCase 2015-01-27 13:17:25 +00:00
Paul "LeoNerd" Evans 0484d7f6e9 Merge branch 'develop' into client_v2_filter 2015-01-27 13:11:03 +00:00
Paul "LeoNerd" Evans 57d2bfca3f Initial cut of a shared base class for REST unit tests 2015-01-27 13:09:57 +00:00
Paul "LeoNerd" Evans 39c1892b22 Minor changes to v2_alpha filter REST test to allow the setUp method to be shareable 2015-01-27 13:03:31 +00:00
Paul "LeoNerd" Evans 37b8a71f10 Initial trivial REST test of v2_alpha filter API 2015-01-26 15:27:40 +00:00
Paul "LeoNerd" Evans d07dfe5392 Create (empty) v2_alpha REST tests directory 2015-01-26 14:32:17 +00:00
Mark Haines 5759bec43c Replace hs.parse_userid with UserID.from_string 2015-01-23 11:47:15 +00:00
Mark Haines 7256def8e4 Merge rest servlets into the client json resource object 2015-01-23 10:37:38 +00:00
Mark Haines 53584420a5 Move client rest tests back under rest 2015-01-22 16:13:27 +00:00
Mark Haines 1d2016b4a8 Move client v1 api rest servlets into a "client/v1" directory 2015-01-22 14:59:08 +00:00
Paul "LeoNerd" Evans 9c804bc3fd Check that setting typing notification still works after explicit timeout at REST layer - SYN-230 2015-01-12 18:31:48 +00:00
Kegan Dougal a09882de83 Update tests 2015-01-07 16:12:14 +00:00
Erik Johnston 57e0e619f3 Merge branch 'develop' of github.com:matrix-org/synapse into events_refactor
Conflicts:
	tests/handlers/test_room.py
2014-12-15 14:45:59 +00:00
Erik Johnston 41ff21c907 Fix test. 2014-12-12 14:10:32 +00:00
Paul "LeoNerd" Evans b0bb1756a9 Send list of typing user IDs as 'user_ids' list within 'content', so that m.typing stream events have a toplevel content, for consistency with others 2014-12-12 11:59:46 +00:00
Erik Johnston fa4b610ae3 Fix stream test. Make sure we add join to auth_events for invitiations 2014-12-12 10:42:27 +00:00
Paul "LeoNerd" Evans 6e1531682b Move typing-notification REST tests into their own .py file 2014-12-11 17:54:42 +00:00
Paul "LeoNerd" Evans 1f26e56de0 Actually unit-test the event stream around REST typing tests 2014-12-11 17:54:42 +00:00
Paul "LeoNerd" Evans 3b2cc26053 Initial hack at unit tests of room typing REST API 2014-12-11 16:03:12 +00:00
Erik Johnston 493055731e Fix tests from prev commit 2014-11-19 18:00:07 +00:00
Paul "LeoNerd" Evans 33d328d967 Include room members' presence in room initialSync 2014-11-18 15:28:58 +00:00
Paul "LeoNerd" Evans 17f977a9de Include 'messages' snapshot in room initialSync 2014-11-18 14:07:51 +00:00
Paul "LeoNerd" Evans 31a049eb69 Merge branch 'develop' into room-initial-sync
Conflicts:
	synapse/handlers/message.py
2014-11-17 16:59:24 +00:00
Erik Johnston 37900a92db Only allow people in a room to look up room state. 2014-11-11 17:55:32 +00:00
Erik Johnston 339c11dd86 Fix rest.test_rooms 2014-11-11 08:09:42 +00:00
Paul "LeoNerd" Evans c23afed39a Include room membership in room initialSync 2014-11-10 19:34:47 +00:00
Paul "LeoNerd" Evans 1fd8139138 Put room state in room initialSync output - I guess this is right; I really can't find any other tests similar... 2014-11-10 19:29:58 +00:00
Paul "LeoNerd" Evans 269f80bf8e Have room initialSync return the room's room_id 2014-11-10 19:02:19 +00:00
Paul "LeoNerd" Evans 50c8e3fcda Initial (empty) test that room initialSync at least returns 200 OK 2014-11-10 18:07:55 +00:00
Erik Johnston ec824927c1 Fix rest.test_events. Convert to use SQLiteMemoryDbPool 2014-11-10 15:37:53 +00:00
Erik Johnston 416ab4ebf0 Don't execute empty tests. Formatting. 2014-11-05 11:12:47 +00:00
Mark Haines 66104da10c Sign outgoing PDUs. 2014-10-16 00:09:48 +01:00
Mark Haines 9605593d11 Merge branch 'develop' into server2server_signing
Conflicts:
	synapse/storage/__init__.py
	tests/rest/test_presence.py
2014-09-30 17:55:06 +01:00
Erik Johnston d96cb61f26 Unbreak tests after changing storage API 2014-09-29 15:35:57 +01:00
Erik Johnston 0fdf308874 Track the IP users connect with. Add an admin column to users table. 2014-09-26 16:36:24 +01:00
Mark Haines 52ca867670 Sign federation transactions 2014-09-24 17:25:41 +01:00
Kegan Dougal 2c00e1ecd9 Be consistent when associating keys with login types for registration/login. 2014-09-15 15:38:29 +01:00
Kegan Dougal c04caff55c Fix unit tests. 2014-09-15 15:14:19 +01:00
Paul "LeoNerd" Evans cd62ee3f29 Have all unit tests import from our own subclass of trial's unittest TestCase; set up logging in ONE PLACE ONLY 2014-09-12 18:46:13 +01:00
Kegan Dougal 027f51763e Unit tests do not need captchas. 2014-09-05 23:41:18 -07:00
Matthew Hodgson 8a7c1d6a00 fix the copyright holder from matrix.org to OpenMarket Ltd, as matrix.org hasn't been incorporated in time for launch. 2014-09-03 17:31:57 +01:00
Paul "LeoNerd" Evans cda31fb755 Kill the state
... key from all the Presence messages
2014-09-03 15:37:10 +01:00
Paul "LeoNerd" Evans da31b96b55 Implement presence state visibilty limiting when polling eventsource for stream 2014-09-03 13:46:52 +01:00
Mark Haines cdd8602e74 Fix tests to support ratelimiting 2014-09-03 09:15:22 +01:00
Paul "LeoNerd" Evans fd696f1243 Perform room unit tests with 'local' users actually in the right domain ;) 2014-09-01 15:58:30 +01:00
Paul "LeoNerd" Evans 468d94c920 Rename API-visible 'mtime' presence field to 'last_active'; slightly different semantics 2014-09-01 15:39:50 +01:00
Paul "LeoNerd" Evans 02f4e3b3ff Rename 'state' presence key to the much more obvious 'presence'; maintain a legacy 'state' copy for now 2014-09-01 14:45:41 +01:00
Matthew Hodgson 8fe912d95c change the world: make the default matrix API URL prefix /_matrix rather than /matrix to make it easier for existing websites to mount a HS in their namespace without collisions.
perl -pi -e 's#/matrix#/_matrix#g' ./cmdclient/console.py ./docs/client-server/howto.rst ./docs/client-server/specification.rst ./docs/client-server/swagger_matrix/directory ./docs/client-server/swagger_matrix/events ./docs/client-server/swagger_matrix/login ./docs/client-server/swagger_matrix/presence ./docs/client-server/swagger_matrix/profile ./docs/client-server/swagger_matrix/registration ./docs/client-server/swagger_matrix/rooms ./docs/server-server/specification.rst ./graph/graph.py ./jsfiddles/create_room_send_msg/demo.js ./jsfiddles/event_stream/demo.js ./jsfiddles/example_app/demo.js ./jsfiddles/register_login/demo.js ./jsfiddles/room_memberships/demo.js ./synapse/api/urls.py ./tests/federation/test_federation.py ./tests/handlers/test_presence.py ./tests/handlers/test_typing.py ./tests/rest/test_events.py ./tests/rest/test_presence.py ./tests/rest/test_profile.py ./tests/rest/test_rooms.py ./webclient/components/fileUpload/file-upload-service.js ./webclient/components/matrix/matrix-service.js
2014-08-31 14:51:37 +01:00
Paul "LeoNerd" Evans 56424eca5c Bugfix for rest presence test - datastore needs to implement profile methods 2014-08-29 19:12:22 +01:00
Paul "LeoNerd" Evans 6dd50da54e Define a new event stream data source for typing notifications (currently null) 2014-08-29 17:39:33 +01:00
Paul "LeoNerd" Evans 20d0db6cfb Move the *EventSource classes into the handlers they relate to, so it's easier to find the code 2014-08-29 17:10:28 +01:00
Paul "LeoNerd" Evans c46c806126 Re-enable presence, un-skip presence tests 2014-08-28 16:00:14 +01:00
Paul "LeoNerd" Evans d027e859cd Fix up the various presence-related tests so that if they're not skipped, they still PASS 2014-08-27 18:30:09 +01:00
Mark Haines 1d95e78759 Merge branch 'develop' into storage_transactions 2014-08-27 16:54:12 +01:00
Kegan Dougal 135a1aa229 Final url modifications: renamed /presence_list to /presence/list to keep the top-level namespace clean. Updated tests. 2014-08-27 11:37:53 +01:00
Kegan Dougal dd661769e1 Renamed /rooms to /createRoom. Removed ability to PUT raw room IDs, and removed tests which tested that. Updated cmdclient and webclient. 2014-08-27 11:33:56 +01:00
Mark Haines bf05218c4b Merge branch 'develop' into storage_transactions 2014-08-27 11:19:37 +01:00
Mark Haines d2798de660 Fold federation/handler into handlers/federation 2014-08-26 19:49:42 +01:00
Kegan Dougal 5a93bfe1f0 Removed MessageRestServlet, use RoomSendEventRestServlet instead. Updated cmdclient, tests and webclient. All appears to work. 2014-08-26 17:21:48 +01:00
Kegan Dougal 2e70de09b9 Renaming: /im/sync >> /initialSync. /rooms/$roomid/members/list >> /rooms/$roomid/members. /rooms$roomid/messages/list >> /room/$roomid/messages. Updated cmdclient, tests and webclient. 2014-08-26 16:19:17 +01:00
Kegan Dougal 8bd55cfdcb Fix ALL THE UNIT TESTS 2014-08-26 15:54:25 +01:00
Mark Haines 104808107a skip presence tests which broke when presence polling was disabled 2014-08-22 18:40:31 +01:00
Erik Johnston 849627b82e Don't generate room membership messages. Include previous state of in membership messages. 2014-08-20 11:53:57 +01:00
Erik Johnston cc48e920d6 Don't expect a reflection from events stream 2014-08-19 15:54:07 +01:00