Commit Graph

211 Commits (c517a19c2ddc042e5a87dfaaecc55a790f62ed71)

Author SHA1 Message Date
Daniel Wagner-Hall 617501dd2a Move token generation to auth handler
I prefer the auth handler to worry about all auth, and register to call
into it as needed, than to smatter auth logic between the two.
2015-08-20 11:35:56 +01:00
Daniel Wagner-Hall 70e265e695 Re-add whitespace around caveat operators 2015-08-19 14:30:31 +01:00
Daniel Wagner-Hall ce832c38d4 Remove padding space around caveat operators 2015-08-18 17:39:26 +01:00
Daniel Wagner-Hall 42e858daeb Fix units in test
I made the non-test seconds instead of ms, but not the test
2015-08-18 17:38:37 +01:00
Daniel Wagner-Hall 3e6fdfda00 Fix some formatting to use tuples 2015-08-18 15:18:50 +01:00
Daniel Wagner-Hall 2d3462714e Issue macaroons as opaque auth tokens
This just replaces random bytes with macaroons. The macaroons are not
inspected by the client or server.

In particular, they claim to have an expiry time, but nothing verifies
that they have not expired.

Follow-up commits will actually enforce the expiration, and allow for
token refresh.

See https://bit.ly/matrix-auth for more information
2015-08-18 14:22:02 +01:00
Erik Johnston bd1236c0ee Consolidate duplicate code in notifier 2015-07-02 11:46:05 +01:00
Kegan Dougal d88e20cdb9 Fix bug where synapse was sending AS user queries incorrectly.
Bug introduced in 92b20713d7
which reversed the comparison when checking if a user existed
in the users table. Added UTs to prevent this happening again.
2015-06-17 17:26:03 +01:00
Erik Johnston 3bbd0d0e09 Merge pull request #180 from matrix-org/erikj/prev_state_context
Don't needlessly compute prev_state
2015-06-03 17:20:56 +01:00
Erik Johnston 55bf90b9e4 Don't needlessly compute prev_state 2015-06-03 16:44:24 +01:00
Erik Johnston 1c3d844e73 Don't needlessly compute context 2015-06-03 16:41:51 +01:00
Mark Haines 17167898c8 Fix the presence tests 2015-05-22 16:22:54 +01:00
Mark Haines 8eca5bd50a Fix the presence tests 2015-05-20 13:22:18 +01:00
Mark Haines 0b0033c40b Merge branch 'develop' into notifier_performance 2015-05-18 13:50:01 +01:00
Mark Haines c5d1b4986b Remove unused arguments and doc PresenceHandler.push_update_to_clients 2015-05-14 14:59:31 +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 6f8e2d517e Merge branch 'develop' of github.com:matrix-org/synapse into postgres 2015-04-27 14:41:40 +01:00
Paul "LeoNerd" Evans e1e5e53127 Remove users from the remote_offline_serials list (and clean up empty elements) when they go online again 2015-04-23 19:01:37 +01:00
Paul "LeoNerd" Evans 8a785c3006 Store a list of the presence serial number at which remote users went offline, so that when we delete them from the cachemap, we can still synthesize OFFLINE events for them (SYN-261) 2015-04-23 18:40:19 +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 4fe95094d1 Merge branch 'develop' of github.com:matrix-org/synapse into mysql 2015-04-07 18:05:39 +01:00
Erik Johnston 9236136f3a Make work in both Maria and SQLite. Fix tests 2015-04-01 14:12:33 +01:00
Kegan Dougal f9232c7917 Merge branch 'develop' into application-services-txn-reliability
Conflicts:
	synapse/storage/appservice.py
2015-03-16 10:09:15 +00:00
Kegan Dougal 21fd84dcb8 Use seconds; start gluing in the AS scheduler into the AS handler. 2015-03-09 17:01:19 +00:00
Erik Johnston 6d74e46621 Fix tests 2015-03-09 17:01:11 +00:00
Erik Johnston 852816befe Fix presence tests 2015-02-23 15:14:09 +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 11e6b3d18b Dependency inject ApplicationServiceApi when creating ApplicationServicesHandler. 2015-02-05 17:04:59 +00:00
Kegan Dougal 951690e54d Merge branch 'develop' into application-services 2015-02-05 14:28:03 +00:00
Kegan Dougal 131e036402 Fix unit tests. 2015-02-05 13:22:20 +00:00
Kegan Dougal bc658907f0 Add unit test for appservice_handler.query_room_alias_exists 2015-02-05 11:54:36 +00:00
Kegan Dougal f0c730252f Add unknown user ID check. Use store.get_aliases_for_room(room_id) when searching for services by alias. 2015-02-05 11:25:32 +00:00
Kegan Dougal 89f2e8fbdf Fix bug in store defer. Add more unit tests. 2015-02-04 15:21:03 +00:00
Kegan Dougal 525a218b2b Begin to add unit tests for appservice glue and regex testing. 2015-02-04 12:24:20 +00:00
Erik Johnston e7ca813dd4 Try to ensure we don't persist an event we have already persisted. In persist_event check if we already have the event, if so then update instead of replacing so that we don't cause a bump of the stream_ordering. 2015-02-03 10:39:41 +00:00
Erik Johnston 78015948a7 Initial implementation of auth conflict resolution 2015-01-29 16:52:33 +00:00
Mark Haines ada711504e Replace hs.parse_roomalias with RoomAlias.from_string 2015-01-23 13:21:58 +00:00
Mark Haines 5759bec43c Replace hs.parse_userid with UserID.from_string 2015-01-23 11:47:15 +00:00
Paul "LeoNerd" Evans 3a243c53f4 Rename MockedDatastoreTestCase to MockedDatastorePresenceTestCase since it is still presence-specific 2015-01-22 20:06:28 +00:00
Paul "LeoNerd" Evans cbb10879cb Much merging of test case setUp() methods to make them much more
shareable
2015-01-22 20:06:28 +00:00
Paul "LeoNerd" Evans 73315ce9de Abstract out the room ID from presence tests, so it's stored in self 2015-01-21 20:01:57 +00:00
Paul "LeoNerd" Evans dbe71e670c Use common base class for two Presence unit-tests, avoiding boilerplate copypasta 2015-01-21 16:58:16 +00:00
Mark Haines 5fed042640 Finish renaming "context" to "room_id" in federation codebase 2015-01-16 19:01:03 +00:00
Paul "LeoNerd" Evans 968dc988f9 Check that setting typing notification still works after explicit timeout - SYN-230 2015-01-12 18:01:49 +00:00
Kegan Dougal 4640239d34 Mock ratelimiter to make tests pass. 2014-12-19 17:49:47 +00:00
Mark Haines c3eae8a88c Construct the EventContext in the state handler rather than constructing one and then immediately calling state_handler.annotate_context_with_state 2014-12-16 15:59:17 +00:00
Erik Johnston 3c77d13aa5 Kill off synapse.api.events.* 2014-12-16 11:29:05 +00:00
Erik Johnston cf6e5f1dbf Rename MessageHandler.handle_event. Add a few comments. 2014-12-15 17:01:12 +00:00
Erik Johnston 65cdf4e724 Get current member state from current_state snapshot. Fix leave test. 2014-12-15 15:03:27 +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 ebf2ec3ce6 Fix membership handler test 2014-12-12 14:32:44 +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
Paul "LeoNerd" Evans f25764943c Add a 'user_left_room' distributor signal analogous to 'user_joined_room' 2014-12-11 18:27:01 +00:00
Paul "LeoNerd" Evans 5ebc994f84 Actually auth-check to ensure people can only send typing notifications for rooms they're actually in 2014-12-11 18:11:43 +00:00
Erik Johnston d3eb12c7b8 Fix federation test 2014-12-11 17:01:27 +00:00
Erik Johnston c161b6cf96 Fix room creation test 2014-12-11 16:43:30 +00:00
Paul "LeoNerd" Evans 1a75ff5c23 Hook up the event stream to typing notifications 2014-12-10 21:01:49 +00:00
Paul "LeoNerd" Evans 4006d58335 Store serial numbers per room for typing event stream purposes 2014-12-10 20:48:25 +00:00
Paul "LeoNerd" Evans 9eb819e828 First hack at implementing timeouts in typing notification handler 2014-12-10 19:39:01 +00:00
Erik Johnston 4d6af0dde3 Fix some tests 2014-12-10 18:00:57 +00:00
Erik Johnston 08aceea82e Add newline back in 2014-12-10 10:26:12 +00:00
Erik Johnston f26ec14b21 Remove whitespace 2014-12-10 10:25:21 +00:00
Matthew Hodgson 8ada2d2018 fix UTs by telling all the mock stores about the new methods for tracking retries 2014-12-09 23:53:07 +00:00
Erik Johnston 027542e2e5 Fix bugs when joining a remote room that has dodgy event graphs. This should also fix the number of times a HS will trigger a GET /event/ 2014-11-27 16:02:26 +00:00
Erik Johnston 822b15ea43 Fix tests. 2014-11-26 10:45:37 +00:00
Erik Johnston 64fc859dac Fix bugs in invite/join dances.
We now do more implement more of the auth on the events so that we
don't reject valid events.
2014-11-25 17:59:49 +00:00
Paul "LeoNerd" Evans 03dc63f6c8 Initialise UserPresenceCache instances to always contain a 'presence' key 2014-11-19 17:31:46 +00:00
Mark Haines c5eabe3143 replace user_id with sender 2014-11-19 16:38:40 +00:00
Mark Haines cb4b6c844a Merge PDUs and Events into one object 2014-11-14 21:25:02 +00:00
Mark Haines de1ec90133 Validate signatures on incoming events 2014-11-14 19:11:04 +00:00
Mark Haines 8d8a133c89 SYN-103: Remove "origin" and "destination" keys from edus 2014-11-13 15:49:03 +00:00
Erik Johnston 6fea478d2e Fix bugs with invites/joins across federatiom.
Both in terms of auth and not trying to fetch missing PDUs for invites,
joins etc.
2014-11-12 11:24:11 +00:00
Erik Johnston 3db2c0d43e Rename annotate_state_groups to annotate_event_with_state 2014-11-11 16:58:53 +00:00
Erik Johnston b01159f234 Fix room handler test 2014-11-10 14:58:33 +00:00
Erik Johnston 1616df2f61 Fix typing tests 2014-11-05 11:15:56 +00:00
Erik Johnston c670ce416b Fix room tests 2014-11-05 11:15:15 +00:00
Erik Johnston f48fce8bd3 Fix profile tests 2014-11-05 11:13:58 +00:00
Erik Johnston 24e2da4557 Fix presencelike test 2014-11-05 11:13:01 +00:00
Erik Johnston 34c4614682 Fix presence test 2014-11-05 11:10:54 +00:00
Erik Johnston 9e429239ab Fix Federation test 2014-11-05 11:10:36 +00:00
Erik Johnston 4a5e95511e PEP8 2014-11-04 17:13:21 +00:00
Erik Johnston dfb3d21a6d Fix room handler tests 2014-11-04 17:12:39 +00:00
Erik Johnston b0554682ed Fix federation handler tests. I've removed the invite/join dance ones as they are completely out of date. 2014-11-04 16:51:59 +00:00
Erik Johnston 7f4c7fe4e8 PEP8 2014-11-04 16:35:38 +00:00
Erik Johnston dd3711bdbd Fix tests.handlers.test_directory 2014-11-04 16:33:52 +00:00
Paul "LeoNerd" Evans b1ee6fd7ed Fix an off-by-one bug in presence event stream pagination; this might be responsible for any number of bug reports 2014-10-29 16:16:01 +00:00
Mark Haines f5cf7ac25b SPEC-7: Rename 'ts' to 'origin_server_ts' 2014-10-17 17:12:25 +01:00
Mark Haines 9aed791fc3 SYN-103: Ignore the 'origin' key in received EDUs. Instead take the origin from the transaction itself 2014-10-14 16:44:27 +01:00
Mark Haines 10ef8e6e4b SYN-75 sign at the request level rather than the transaction level 2014-10-13 11:49:55 +01:00
Mark Haines 984e207b59 Merge branch develop into server2server_signing
Conflicts:
	synapse/app/homeserver.py
2014-10-13 10:58:50 +01:00
Mark Haines 574377636e Add a keyword argument to get_json to avoid retrying on DNS failures. Rather than passing MatrixHttpClient.RETRY_DNS_LOOKUP_FAILURES as a fake query string parameter 2014-10-02 14:26:13 +01:00
Mark Haines 4f11518934 Split PlainHttpClient into separate clients for talking to Identity servers and talking to Capatcha servers 2014-10-02 14:03:26 +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
Mark Haines b95a178584 SYN-75 Verify signatures on server to server transactions 2014-09-30 15:15:10 +01:00
Erik Johnston 59f2bef187 Fix test where we changed arguments used to call the notifier 2014-09-25 13:04:33 +01:00
Mark Haines 52ca867670 Sign federation transactions 2014-09-24 17:25:41 +01:00
Erik Johnston 335e5d131c Merge branch 'test-sqlite-memory' of github.com:matrix-org/synapse into develop
Conflicts:
	tests/handlers/test_profile.py
2014-09-18 14:31:47 +01:00