summary refs log tree commit diff
path: root/synapse/api/auth.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit '98a64b7f7' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-3/+4
|\
| * Kill off `HomeServer.get_ip_from_request()` (#9080)Richard van der Hoff2021-01-121-2/+2
| | | | | | Homeserver.get_ip_from_request() used to be a bit more complicated, but now it is totally redundant. Let's get rid of it.
| * Remove SynapseRequest.get_user_agent (#9069)Richard van der Hoff2021-01-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | SynapseRequest is in danger of becoming a bit of a dumping-ground for "useful stuff relating to Requests", which isn't really its intention (its purpose is to override render, finished and connectionLost to set up the LoggingContext and write the right entries to the request log). Putting utility functions inside SynapseRequest means that lots of our code ends up requiring a SynapseRequest when there is nothing synapse-specific about the Request at all, and any old twisted.web.iweb.IRequest will do. This increases code coupling and makes testing more difficult. In short: move get_user_agent out to a utility function.
* | Merge commit 'bd30cfe86' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-161-2/+3
|\|
| * Do not assume that the contents dictionary includes history_visibility. (#8945)Patrick Cloke2020-12-161-2/+3
| |
* | Merge commit 'f14428b25' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-161-1/+3
|\|
| * Honour AS ratelimit settings for /login requests (#8920)Erik Johnston2020-12-111-1/+3
| | | | | | | | Fixes #8846.
* | Merge commit 'ef2d62701' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-311-67/+46
|\|
| * Add ability for access tokens to belong to one user but grant access to ↵Erik Johnston2020-10-291-67/+46
| | | | | | | | | | | | | | | | | | | | another user. (#8616) We do it this way round so that only the "owner" can delete the access token (i.e. `/logout/all` by the "owner" also deletes that token, but `/logout/all` by the "target user" doesn't). A future PR will add an API for creating such a token. When the target user and authenticated entity are different the `Processed request` log line will be logged with a: `{@admin:server as @bob:server} ...`. I'm not convinced by that format (especially since it adds spaces in there, making it harder to use `cut -d ' '` to chop off the start of log lines). Suggestions welcome.
* | Merge commit '2b7c18087' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-311-3/+1
|\|
| * Fix handling of User-Agent headers with bad utf-8. (#8632)Erik Johnston2020-10-231-3/+1
| |
* | Merge commit '97647b33c' into dinsicAndrew Morgan2020-12-311-1/+3
|\|
| * type annotations for LruCacheRichard van der Hoff2020-10-161-1/+3
| |
* | Merge commit '3ee17585c' into dinsicAndrew Morgan2020-12-311-3/+1
|\|
| * Make LruCache register its own metrics (#8561)Richard van der Hoff2020-10-161-3/+1
| | | | | | | | | | rather than have everything that instantiates an LruCache manage metrics separately, have LruCache do it itself.
* | Allow users to click account renewal links multiple times without hitting an ↵Andrew Morgan2020-12-301-2/+2
| | | | | | | | 'Invalid Token' page (#74)
* | Merge commit '2983049a7' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-211-5/+1
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '2983049a7': Factor out `_send_dummy_event_for_room` (#8370) Improve logging of state resolution (#8371) Fix bug which caused failure on join with malformed membership events (#8385) Use `async with` for ID gens (#8383) Don't push if an user account has expired (#8353) Do not check lint/test dependencies at runtime. (#8377) Add note to reverse_proxy.md about disabling Apache's mod_security2 (#8375) Changelog
| * Don't push if an user account has expired (#8353)Mathieu Velten2020-09-231-5/+1
| |
* | Merge commit '17fa4c7ca' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-201-1/+1
|\| | | | | | | | | | | | | | | * commit '17fa4c7ca': Catch up after Federation Outage (split, 2): Track last successful stream ordering after transmission (#8247) Catch-up after Federation Outage (split, 1) (#8230) Fix type signature in simple_select_one_onecol and friends (#8241) Stop sub-classing object (#8249)
| * Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
| |
* | Merge commit 'e04e465b4' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-191-1/+11
|\| | | | | | | | | | | | | | | | | | | * commit 'e04e465b4': Use the default templates when a custom template file cannot be found (#8037) Changelog changes Convert stream database to async/await. (#8074) Add a shadow-banned flag to users. (#8092) Convert pusher databases to async/await. (#8075) Convert receipts and events databases to async/await. (#8076)
| * Add a shadow-banned flag to users. (#8092)Patrick Cloke2020-08-141-1/+11
| |
* | Merge commit 'd4a7829b1' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-191-68/+58
|\| | | | | | | | | * commit 'd4a7829b1': Convert synapse.api to async/await (#8031)
| * Convert synapse.api to async/await (#8031)Patrick Cloke2020-08-061-67/+56
| |
* | Merge commit '3950ae51e' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-161-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '3950ae51e': Ensure that remove_pusher is always async (#7981) Ensure the msg property of HttpResponseException is a string. (#7979) Remove from the event_relations table when purging historical events. (#7978) Add additional logging for SAML sessions. (#7971) Add MSC reference to changelog for #7736 Re-implement unread counts (#7736) Various improvements to the docs (#7899) Convert storage layer to async/await. (#7963) Add an option to disable purge in delete room admin API (#7964) Move some log lines from default logger to sql/transaction loggers (#7952) Use the JSON module from the std library instead of simplejson. (#7936) Fix exit code for `check_line_terminators.sh` (#7970) Option to allow server admins to join complex rooms (#7902) Fix typo in metrics docs (#7966) Add script for finding files with unix line terminators (#7965) Convert the remaining media repo code to async / await. (#7947) Convert a synapse.events to async/await. (#7949) Convert groups and visibility code to async / await. (#7951) Convert push to async/await. (#7948)
| * Convert a synapse.events to async/await. (#7949)Patrick Cloke2020-07-271-1/+1
| |
* | Don't push if an user account has expired (#58)Mathieu Velten2020-09-181-5/+4
| |
* | Merge commit 'f88c48f3b' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-031-4/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f88c48f3b': 1.18.0rc1 Fix error reporting when using `opentracing.trace` (#7961) Fix typing replication not being handled on master (#7959) Remove hacky error handling for inlineDeferreds. (#7950) Convert tests/rest/admin/test_room.py to unix file endings (#7953) Support oEmbed for media previews. (#7920) Convert state resolution to async/await (#7942) Fix up types and comments that refer to Deferreds. (#7945) Do not convert async functions to Deferreds in the interactive_auth_handler (#7944) Convert more of the media code to async/await (#7873) Return an empty body for OPTIONS requests. (#7886) Downgrade warning on client disconnect to INFO (#7928) Convert presence handler helpers to async/await. (#7939) Update the auth providers to be async. (#7935) Put a cache on `/state_ids` (#7931)
| * Convert state resolution to async/await (#7942)Patrick Cloke2020-07-241-4/+8
| |
* | Merge commit '43726783e' into dinsicAndrew Morgan2020-08-031-3/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '43726783e': (22 commits) 1.17.0rc1 Fix some spelling mistakes / typos. (#7811) `update_membership` declaration: now always returns an event id. (#7809) Improve stacktraces from exceptions in background processes (#7808) Fix `can only concatenate list (not "tuple") to list` exception (#7810) Pass original request headers from workers to the main process. (#7797) Generate real events when we reject invites (#7804) Add `HomeServer.signing_key` property (#7805) Revert "Update the installation docs on apt-transport-https (#7801)" Do not use simplejson in Synapse. (#7800) Stop passing bytes when dumping JSON (#7799) Update the installation docs on apt-transport-https (#7801) shuffle changelog slightly Change Caddy links (old is deprecated) (#7789) Stop populating unused table `local_invites`. (#7793) Refactor getting replication updates from database v2. (#7740) Add libwebp dependency to Dockerfile (#7791) Add documentation for JWT login type and improve sample config. (#7776) Convert the appservice handler to async/await. (#7775) Don't ignore `set_tweak` actions with no explicit `value`. (#7766) ...
| * Fix some spelling mistakes / typos. (#7811)Patrick Cloke2020-07-091-1/+1
| |
| * isort 5 compatibility (#7786)Will Hunt2020-07-051-2/+1
| | | | | | The CI appears to use the latest version of isort, which is a problem when isort gets a major version bump. Rather than try to pin the version, I've done the necessary to make isort5 happy with synapse.
* | Merge commit '03619324f' into dinsicAndrew Morgan2020-08-031-3/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '03619324f': Create a ListenerConfig object (#7681) Fix changelog wording 1.15.1 Wrap register_device coroutine in an ensureDeferred (#7684) Ensure the body is a string before comparing push rules. (#7701) Ensure etag is a string for GET room_keys/version response (#7691) Update m.id.phone to use 'phone' instead of 'number' (#7687) Fix "There was no active span when trying to log." error (#7698) Enable 3PID add/bind/unbind endpoints on r0 routes Discard RDATA from already seen positions. (#7648) Replace iteritems/itervalues/iterkeys with native versions. (#7692) Fix warnings about losing log context during UI auth. (#7688) Fix a typo when comparing the URI & method during UI Auth. (#7689) Remove "user_id" from GET /presence. (#7606) Increase the default SAML session expirary time to 15 minutes. (#7664) fix typo in sample_config.yaml (#7652) Take out a lock before modifying _CACHES (#7663) Add option to enable encryption by default for new rooms (#7639) Clean-up the fallback login code. (#7657)
| * Replace iteritems/itervalues/iterkeys with native versions. (#7692)Patrick Cloke2020-06-151-3/+1
| |
* | Merge branch 'release-v1.15.0' of github.com:matrix-org/synapse into ↵Andrew Morgan2020-06-241-4/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dinsic-release-v1.15.x * 'release-v1.15.0' of github.com:matrix-org/synapse: (55 commits) 1.15.0 Fix some attributions Update CHANGES.md 1.15.0rc1 Revert "1.15.0rc1" 1.15.0rc1 Fix bug in account data replication stream. (#7656) Convert the registration handler to async/await. (#7649) Accept device information at the login fallback endpoint. (#7629) Convert user directory handler and related classes to async/await. (#7640) Add an option to disable autojoin for guest accounts (#6637) Clarifications to the admin api documentation (#7647) Update to the stable SSO prefix for UI Auth. (#7630) Fix type information on `assert_*_is_admin` methods (#7645) Remove some unused constants. (#7644) Typo fixes. Allow new users to be registered via the admin API even if the monthly active user limit has been reached (#7263) Add device management to admin API (#7481) Attempt to fix PhoneHomeStatsTestCase.test_performance_100 being flaky. (#7634) Support CS API v0.6.0 (#6585) ...
| * Fix type information on `assert_*_is_admin` methods (#7645)Richard van der Hoff2020-06-051-4/+4
| | | | | | These things don't return Deferreds.
* | Merge branch 'release-v1.14.0' of github.com:matrix-org/synapse into ↵Andrew Morgan2020-06-101-19/+35
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dinsic-release-v1.14.x * 'release-v1.14.0' of github.com:matrix-org/synapse: (108 commits) Fix typo in PR link Update debian changelog 1.14.0 Improve changelog wording 1.14.0rc2 Fix sample config docs error (#7581) Fix up comments Fix specifying cache factors via env vars with * in name. (#7580) Don't apply cache factor to event cache. (#7578) Ensure ReplicationStreamer is always started when replication enabled. (#7579) Remove the changes to the debian changelog Not full release yet, this is rc1 Merge event persistence move changelog entries More changelog fix Changelog fixes 1.14.0 Replace device_27_unique_idx bg update with a fg one (#7562) Fix incorrect exception handling in KeyUploadServlet.on_POST (#7563) Fix recording of federation stream token (#7564) Simplify reap_monthly_active_users (#7558) ...
| * Allow expired accounts to logout (#7443)Andrew Morgan2020-05-141-17/+33
| |
| * Allow configuration of Synapse's cache without using synctl or environment ↵Amber Brown2020-05-111-2/+2
| | | | | | | | variables (#6391)
* | Merge branch 'release-v1.13.0' of github.com:matrix-org/synapse into ↵Andrew Morgan2020-06-101-78/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dinsic-release-v1.14.x * 'release-v1.13.0' of github.com:matrix-org/synapse: (257 commits) Update changelog based on feedback. Move warnings in the changelog and re-iterate changes to branches. 1.13.0 update dh-virtualenv (#7526) 1.13.0rc3 Hash passwords earlier in the registration process (#7523) 1.13.0rc2 1.13.0rc2 Stop `get_joined_users` corruption from custom statuses (#7376) Do not validate that the client dict is stable during UI Auth. (#7483) Fix new flake8 errors (#7489) Don't UPGRADE database rows RST indenting Put rollback instructions in upgrade notes Fix changelog typo Oh yeah, RST Absolute URL it is then Fix upgrade notes link Provide summary of upgrade issues in changelog. Fix ) Move next version notes from changelog to upgrade notes ...
| * Stop Auth methods from polling the config on every req. (#7420)Andrew Morgan2020-05-061-73/+10
| |
| * async/await is_server_admin (#7363)Andrew Morgan2020-05-011-5/+4
| |
* | Allow deleting an alias if the user has sufficient power level (#6986)Andrew Morgan2020-03-241-7/+2
|\| | | | | | | | | * commit '13892776e': Allow deleting an alias if the user has sufficient power level (#6986)
| * Allow deleting an alias if the user has sufficient power level (#6986)Patrick Cloke2020-03-041-7/+2
| |
* | Stop returning aliases as part of the room list. (#6970)Andrew Morgan2020-03-241-5/+5
|\| | | | | | | | | | | * commit 'fcf459948': Stop returning aliases as part of the room list. (#6970) Publishing/removing from the directory requires a power level greater than canonical aliases.
| * Publishing/removing from the directory requires a power level greater than ↵Patrick Cloke2020-02-211-5/+5
| | | | | | | | canonical aliases.
* | Merge pull request #6949 from matrix-org/rav/list_room_aliases_peekableAndrew Morgan2020-03-241-45/+49
|\| | | | | | | | | | | | | | | * commit '2fb7794e6': changelog Make room alias lists peekable Add `allow_departed_users` param to `check_in_room_or_world_readable` Refactor the membership check methods in Auth
| * Add `allow_departed_users` param to `check_in_room_or_world_readable`Richard van der Hoff2020-02-191-3/+13
| | | | | | | | | | | | | | ... and set it everywhere it's called. while we're here, rename it for consistency with `check_user_in_room` (and to help check that I haven't missed any instances)
| * Refactor the membership check methods in AuthRichard van der Hoff2020-02-181-43/+37
| | | | | | | | | | these were getting a bit unwieldy, so let's combine `check_joined_room` and `check_user_was_in_room` into a single `check_user_in_room`.
* | Pass room version object into event_auth.check and check_redaction (#6788)Andrew Morgan2020-03-231-2/+5
|\| | | | | | | | | * commit 'a8ce7aeb4': Pass room version object into event_auth.check and check_redaction (#6788)
| * Pass room version object into event_auth.check and check_redaction (#6788)Richard van der Hoff2020-01-281-2/+5
| | | | | | | | | | | | | | These are easier to work with than the strings and we normally have one around. This fixes `FederationHander._persist_auth_tree` which was passing a RoomVersion object into event_auth.check instead of a string.
* | Add StateMap type alias (#6715)Andrew Morgan2020-03-231-6/+2
|\| | | | | | | | | * commit 'd386f2f33': Add StateMap type alias (#6715)
| * Add StateMap type alias (#6715)Erik Johnston2020-01-161-6/+2
| |
* | Change EventContext to use the Storage class (#6564)Andrew Morgan2020-03-201-1/+1
|\| | | | | | | | | * commit 'fa780e972': Change EventContext to use the Storage class (#6564)
| * Change EventContext to use the Storage class (#6564)Erik Johnston2019-12-201-1/+1
| |
* | Add auth events as per spec. (#6556)Andrew Morgan2020-03-191-67/+34
|\| | | | | | | | | * commit '3fbe5b7ec': Add auth events as per spec. (#6556)
| * Add auth events as per spec. (#6556)Erik Johnston2019-12-161-67/+34
| | | | | | | | | | Previously we tried to be clever and filter out some unnecessary event IDs to keep the auth chain small, but that had some annoying interactions with state res v2 so we stop doing that for now.
* | Remove usage of deprecated logger.warn method from codebase (#6271)Andrew Morgan2020-03-161-1/+1
|\|
| * Remove usage of deprecated logger.warn method from codebase (#6271)Andrew Morgan2019-10-311-1/+1
| | | | | | Replace every instance of `logger.warn` with `logger.warning` as the former is deprecated.
* | Option to suppress resource exceeded alerting (#6173)Andrew Morgan2020-03-161-3/+9
|\| | | | | | | | | * commit '2794b7905': Option to suppress resource exceeded alerting (#6173)
| * Option to suppress resource exceeded alerting (#6173)Neil Johnson2019-10-241-3/+9
| | | | | | | | The expected use case is to suppress MAU limiting on small instances
* | Remove Auth.check method (#6217)Andrew Morgan2020-03-161-18/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '93eaeec75': Remove Auth.check method (#6217) add note about database upgrade use the right function for when we're already in runInteraction add user signature stream change cache to slaved device store black use stream ID generator instead of timestamp make isort happy apply PR review suggestions fix formatting add changelog make changes from PR review don't need to return the hidden column any more really fix queries to work with Postgres PostgreSQL, Y U no like? remove extra SQL query param add changelog file apply changes from PR review allow uploading keys for cross-signing allow devices to be marked as "hidden"
| * Remove Auth.check method (#6217)Richard van der Hoff2019-10-181-18/+1
| | | | | | This method was somewhat redundant, and confusing.
* | Merge pull request #6108 from matrix-org/erikj/remove_get_user_by_req-spanAndrew Morgan2020-02-251-1/+3
|\|
| * Add device and appservice tagsErik Johnston2019-09-251-0/+3
| |
| * Don't create new span for get_user_by_reqErik Johnston2019-09-251-1/+0
| | | | | | | | | | | | We don't actually care about what happens in `get_user_by_req` and having it as a separate span means that the entity tag isn't added to the servlet spans, making it harder to search.
* | Merge pull request #6020 from matrix-org/jaywink/allow-support-users-to-registerAndrew Morgan2020-02-251-2/+9
|\|
| * Ensure support users can be registered even if MAU limit is reachedJason Robinson2019-09-111-2/+9
| | | | | | | | | | | | | | | | | | This allows support users to be created even on MAU limits via the admin API. Support users are excluded from MAU after creation, so it makes sense to exclude them in creation - except if the whole host is in disabled state. Signed-off-by: Jason Robinson <jasonr@matrix.org>
* | Remove double return statements (#5962)Andrew Morgan2020-02-251-1/+0
|\|
| * Remove double return statements (#5962)Andrew Morgan2019-09-031-1/+0
| | | | | | | | | | | | | | | | | | | | Remove all the "double return" statements which were a result of us removing all the instances of ``` defer.returnValue(...) return ``` statements when we switched to python3 fully.
* | Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2020-02-241-7/+7
|\|
| * Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2019-08-301-7/+7
| | | | | | | | | | Python will return a tuple whether there are parentheses around the returned values or not. I'm just sick of my editor complaining about this all over the place :)
* | Opentracing misc (#5856)Andrew Morgan2020-02-201-0/+4
|\|
| * Opentracing misc (#5856)Jorik Schellekens2019-08-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | Add authenticated_entity and servlet_names tags. Functionally: - Add a tag for authenticated_entity - Add a tag for servlet_names Stylistically: Moved to importing methods directly from opentracing.
* | Remove non-functional 'expire_access_token' setting (#5782)Andrew Morgan2020-02-201-23/+5
|\|
| * Remove non-functional 'expire_access_token' setting (#5782)Richard van der Hoff2019-07-301-23/+5
| | | | | | | | | | | | | | | | The `expire_access_token` didn't do what it sounded like it should do. What it actually did was make Synapse enforce the 'time' caveat on macaroons used as access tokens, but since our access token macaroons never contained such a caveat, it was always a no-op. (The code to add 'time' caveats was removed back in v0.18.5, in #1656)
* | Replace returnValue with return (#5736)Andrew Morgan2020-02-191-19/+15
|\|
| * Replace returnValue with return (#5736)Amber Brown2019-07-231-24/+20
| |
* | Ignore redactions of m.room.create events (#5701)Andrew Morgan2020-02-191-15/+0
|\|
| * Ignore redactions of m.room.create events (#5701)Richard van der Hoff2019-07-171-15/+0
| |
* | Implement access token expiry (#5660)Andrew Morgan2020-02-171-0/+12
|\|
| * Implement access token expiry (#5660)Richard van der Hoff2019-07-121-0/+12
| | | | | | | | Record how long an access token is valid for, and raise a soft-logout once it expires.
* | Clean up exception handling for access_tokens (#5656)Andrew Morgan2020-02-171-81/+39
|\|
| * Clean up exception handling for access_tokens (#5656)Richard van der Hoff2019-07-111-88/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First of all, let's get rid of `TOKEN_NOT_FOUND_HTTP_STATUS`. It was a hack we did at one point when it was possible to return either a 403 or a 401 if the creds were missing. We always return a 401 in these cases now (thankfully), so it's not needed. Let's also stop abusing `AuthError` for these cases. Honestly they have nothing that relates them to the other places that `AuthError` is used, other than the fact that they are loosely under the 'Auth' banner. It makes no sense for them to share exception classes. Instead, let's add a couple of new exception classes: `InvalidClientTokenError` and `MissingClientTokenError`, for the `M_UNKNOWN_TOKEN` and `M_MISSING_TOKEN` cases respectively - and an `InvalidClientCredentialsError` base class for the two of them.
| * Run Black. (#5482)Amber Brown2019-06-201-86/+73
| |
* | Dinsic Blacking with black==18.6b2Andrew Morgan2020-02-111-83/+75
| |
* | Merge branch 'babolivier/account_validity_send_mail_auth' into dinsic dinsic_2019-06-10Brendan Abolivier2019-06-101-2/+13
|\|
| * Better wordingBrendan Abolivier2019-06-101-1/+1
| |
| * DocBrendan Abolivier2019-06-101-0/+5
| |
| * Don't check whether the user's account is expired on /send_mail requestsBrendan Abolivier2019-06-051-2/+8
| |
* | Merge branch 'release-v0.99.4' into dinsic dinsic_2019-05-14Brendan Abolivier2019-05-141-3/+4
|\|
| * Factor out an "assert_requester_is_admin" function (#5120)Richard van der Hoff2019-05-021-1/+1
| | | | | | | | Rather than copying-and-pasting the same four lines hundreds of times
| * Add management endpoints for account validityBrendan Abolivier2019-04-171-1/+1
| |
| * Send out emails with links to extend an account's validity periodBrendan Abolivier2019-04-171-2/+3
| |
* | Merge branch 'develop' into dinsicAndrew Morgan2019-04-151-0/+12
|\|
| * Add account expiration featureBrendan Abolivier2019-04-091-0/+12
| |
* | Merge branch 'master' of github.com:matrix-org/synapse into dinsicErik Johnston2019-04-051-11/+11
|\|
| * Support 3PID login in password providers (#4931)Andrew Morgan2019-03-261-11/+11
| | | | | | | | | | Adds a new method, check_3pid_auth, which gives password providers the chance to allow authentication with third-party identifiers such as email or msisdn.
* | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/dinsic-mergedErik Johnston2019-03-211-3/+5
|\|
| * Enforce hs_disabled_message correctlyRichard van der Hoff2019-03-191-3/+5
| | | | | | | | | | Fixes a bug where hs_disabled_message was not enforced for 3pid-based requests if there was no server_notices_mxid configured.
* | FixupsErik Johnston2019-03-151-0/+6
| |
* | Merge branch 'master' of github.com:matrix-org/synapse into ↵Erik Johnston2019-03-151-68/+66
|\| | | | | | | erikj/dinsic-merged-master
| * Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-01-291-12/+1
| |\ | | | | | | | | | erikj/redactions_eiah
| | * Remove dead functionErik Johnston2019-01-291-11/+0
| | |
| | * Replace usage of builder.user_id with builder.senderErik Johnston2019-01-291-1/+1
| | | | | | | | | | | | | | | `.user_id` is proxed to `.sender` in FrozenEvent, so this has no functional change
| * | Implement rechecking of redactionsErik Johnston2019-01-291-2/+2
| |/
| * Pass through room version to event authErik Johnston2019-01-251-4/+10
| |
| * Fix None guard in config.server.is_threepid_reservedNeil Johnson2019-01-221-1/+3
| |
| * Merge branch rav/macaroon_key_fix_0.34 into rav/macaroon_key_fix_0.34.1Richard van der Hoff2019-01-101-38/+27
| |\ | | | | | | | | | Fixes #4371
| | * Merge branch 'rav/macaroon_key_fix' into rav/macaroon_key_fix_0.34Richard van der Hoff2019-01-101-38/+27
| | |\
| | | * Skip macaroon check for access tokens in the dbRichard van der Hoff2019-01-101-38/+27
| | | |
| * | | create support user (#4141)Neil Johnson2018-12-141-2/+3
| |/ / | | | | | | | | | | | | | | | Allow for the creation of a support user. A support user can access the server, join rooms, interact with other users, but does not appear in the user directory nor does it contribute to monthly active user limits.
| * | Add an option to enable recording IPs for appservice users (#3831)Travis Ralston2018-12-041-9/+20
| | |
* | | Synchronise account metadata onto another server. (#4145) dinsic_2019-01-11Matthew Hodgson2019-01-111-29/+16
|/ / | | | | | | | | * implement shadow registration via AS (untested) * shadow support for 3pid binding/unbinding (untested)
* | assert rather than warn hhs-4Neil Johnson2018-08-311-3/+2
| |
* | move threepid checker to config, add missing yieldsNeil Johnson2018-08-311-2/+11
| |
* | fix reference to is_threepid_reservedNeil Johnson2018-08-311-1/+1
| |
* | ensure post registration auth checks do not fail erroneouslyNeil Johnson2018-08-311-5/+2
| |
* | fix bug where preserved threepid user comes to sign up and server is mau blockedNeil Johnson2018-08-311-1/+9
| |
* | Change admin_uri to admin_contact in config and errorsErik Johnston2018-08-241-2/+2
| |
* | Implement trail usersErik Johnston2018-08-231-1/+5
| |
* | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2018-08-221-7/+7
|\ \ | | | | | | | | | neilj/server_notices_on_blocking
| * | Port over enough to get some sytests running on Python 3 (#3668)Amber Brown2018-08-201-7/+7
| | |
* | | rename error codeNeil Johnson2018-08-181-2/+2
| | |
* | | special case server_notices_mxidNeil Johnson2018-08-181-0/+6
|/ /
* | Merge branch 'develop' into neilj/limit_exceeded_errorNeil Johnson2018-08-171-1/+2
|\ \
| * | call reap on start up and fix under reaping bugNeil Johnson2018-08-161-1/+1
| | |
* | | add new error type ResourceLimitNeil Johnson2018-08-161-4/+6
|/ /
* | replace admin_email with admin_uri for greater flexibilityNeil Johnson2018-08-151-5/+5
| |
* | Merge branch 'develop' of github.com:matrix-org/synapse into neilj/admin_emailNeil Johnson2018-08-141-1/+11
|\ \
| * | make comments clearerNeil Johnson2018-08-141-1/+2
| | |
| * | rename _user_last_seen_monthly_activeNeil Johnson2018-08-091-1/+1
| | |
| * | fix errant parenthesisNeil Johnson2018-08-091-1/+1
| | |
| * | only block on sync where user is not part of the mau cohortNeil Johnson2018-08-091-2/+11
| | |
* | | support admin_email config and pass through into blocking errors, return ↵Neil Johnson2018-08-131-2/+6
| | | | | | | | | | | | AuthError in all cases
* | | Revert "support admin_email config and pass through into blocking errors, ↵Neil Johnson2018-08-131-6/+2
| | | | | | | | | | | | | | | | | | return AuthError in all cases" This reverts commit 0d43f991a19840a224d3dac78d79f13d78212ee6.
* | | support admin_email config and pass through into blocking errors, return ↵Neil Johnson2018-08-131-2/+6
|/ / | | | | | | AuthError in all cases
* | Merge branch 'neilj/mau_tracker' of github.com:matrix-org/synapse into ↵Neil Johnson2018-08-061-4/+1
|\ \ | | | | | | | | | neilj/disable_hs
| * | update comments to reflect new sigNeil Johnson2018-08-061-4/+1
| | |
* | | disable HS from configNeil Johnson2018-08-041-0/+4
|/ /
* | wip commit - tests failingNeil Johnson2018-08-031-2/+4
| |
* | do mau checks based on monthly_active_users tableNeil Johnson2018-08-021-0/+13
| |
* | insertion into monthly_active_usersNeil Johnson2018-08-021-1/+1
|/
* Python 3: Convert some unicode/bytes uses (#3569)Amber Brown2018-08-021-2/+2
|
* Merge branch 'develop' into erikj/client_apis_moveErik Johnston2018-07-241-2/+4
|\
| * Use new gettersErik Johnston2018-07-231-2/+4
| |
* | Move check_in_room_or_world_readable to AuthErik Johnston2018-07-201-0/+34
|/
* Make auth & transactions more testable (#3499)Amber Brown2018-07-141-62/+62
|
* run isortAmber Brown2018-07-091-3/+4
|
* add ip_range_whitelist parameter to limit where ASes can connect fromMatthew Hodgson2018-06-281-0/+6
|
* Don't print invalid access tokens in the logsTravis Ralston2018-06-241-2/+2
| | | | | Tokens shouldn't be appearing the logs, valid or invalid. Signed-off-by: Travis Ralston <travpc@gmail.com>
* Refactor get_send_level to take a power_levels eventRichard van der Hoff2018-06-141-1/+1
| | | | it makes it easier for me to reason about
* Consistently use six's iteritems and wrap lazy keys/values in list() if ↵Amber Brown2018-05-311-1/+3
| | | | they're not meant to be lazy (#3307)
* replacing portionsAmber Brown2018-05-211-1/+1
|
* Add b prefixes to some strings that are bytes in py3Adrian Tschira2018-04-041-5/+5
| | | | | | This has no effect on python2 Signed-off-by: Adrian Tschira <nota@notafile.com>
* Improve comments on get_user_by_access_tokenRichard van der Hoff2017-11-291-1/+5
| | | | because I have to reverse-engineer this every time.
* Add a config option to block all room invites (#2457)Richard van der Hoff2017-09-191-0/+8
| | | | | - allows sysadmins the ability to lock down their servers so that people can't send their users room invites.
* Merge pull request #2309 from matrix-org/erikj/user_ip_replErik Johnston2017-07-061-1/+1
|\ | | | | Fix up user_ip replication commands
| * Fix upErik Johnston2017-06-271-1/+1
| |
* | Cache macaroon parse and validationErik Johnston2017-06-291-13/+60
|/ | | | | | Turns out this can be quite expensive for requests, and is easily cachable. We don't cache the lookup to the DB so invalidation still works.
* Batch upsert user ipsErik Johnston2017-06-271-2/+1
|
* Change is_host_joined to use current_state tableErik Johnston2017-06-091-11/+2
| | | | | | This bypasses a bug where using the state groups to figure out if a host is in a room sometimes errors if the servers isn't in the room. (For example when the server rejected an invite to a remote room)
* Fix a couple of logcontext leaksRichard van der Hoff2017-03-231-3/+2
| | | | | Use preserve_fn to correctly manage the logcontexts around things we don't want to yield on.
* Change resolve_state_groups call site logging to DEBUGErik Johnston2017-01-171-1/+1
|
* Remove unused functionErik Johnston2017-01-131-3/+0
|
* Split event auth code into seperate moduleErik Johnston2017-01-131-645/+9
|
* Split out static auth methods from Auth objectErik Johnston2017-01-101-419/+495
|
* Fix flake8 and update changelog v0.18.6-rc3Mark Haines2017-01-051-1/+1
|
* add logging for all the places we call resolve_state_groups. my kingdom for ↵Matthew Hodgson2017-01-051-0/+1
| | | | a backtrace that actually works.
* Prevent user tokens being used as guest tokens (#1675)Richard van der Hoff2016-12-061-15/+36
| | | | | Make sure that a user cannot pretend to be a guest by adding 'guest = True' caveats.
* Rip out more refresh_token codeRichard van der Hoff2016-11-301-3/+2
| | | | | | | | We might as well treat all refresh_tokens as invalid. Just return a 403 from /tokenrefresh, so that we don't have a load of dead, untestable code hanging around. Still TODO: removing the table from the schema.
* Merge pull request #1656 from matrix-org/rav/remove_time_caveatRichard van der Hoff2016-11-301-3/+13
|\ | | | | Stop putting a time caveat on access tokens
| * CommentsRichard van der Hoff2016-11-301-3/+9
| | | | | | | | Update comments in verify_macaroon
| * Stop putting a time caveat on access tokensRichard van der Hoff2016-11-291-0/+4
| | | | | | | | | | | | | | | | The 'time' caveat on the access tokens was something of a lie, since we weren't enforcing it; more pertinently its presence stops us ever adding useful time caveats. Let's move in the right direction by not lying in our caveats.
* | Merge pull request #1653 from matrix-org/rav/guest_e2eRichard van der Hoff2016-11-291-1/+5
|\ \ | |/ |/| Implement E2E for guests
| * Give guest users a device_idRichard van der Hoff2016-11-251-1/+5
| | | | | | | | | | We need to create devices for guests so that they can use e2e, but we don't have anywhere to store it, so just use a fixed one.
* | Remove redundant list of known caveat prefixesRichard van der Hoff2016-11-241-26/+8
|/ | | | Also add some comments.
* Merge pull request #1098 from matrix-org/markjh/bearer_tokenMark Haines2016-10-251-9/+37
|\ | | | | Allow clients to supply access_tokens as headers
| * Fix unit testsMark Haines2016-09-121-1/+1
| |
| * Allow clients to supply access_tokens as headersMark Haines2016-09-091-9/+37
| | | | | | | | | | | | | | | | | | | | Clients can continue to supply access tokens as query parameters or can supply the token as a header: Authorization: Bearer <access_token_goes_here> This matches the ouath2 format of https://tools.ietf.org/html/rfc6750#section-2.1
* | Closing brace on following lineLuke Barnard2016-10-201-1/+2
| |
* | as_user->app_service, less redundant comments, better positioned commentsLuke Barnard2016-10-201-3/+3
| |
* | flake8Luke Barnard2016-10-201-1/+3
| |
* | Use real AS object by passing it through the requesterLuke Barnard2016-10-201-7/+7
| | | | | | | | This means synapse does not have to check if the AS is interested, but instead it effectively re-uses what it already knew about the requesting user
* | Merge pull request #1157 from Rugvip/nolimitErik Johnston2016-10-111-4/+3
|\ \ | | | | | | Remove rate limiting from app service senders and fix get_or_create_user requester
| * | storage/appservice: make appservice methods only relying on the cache ↵Patrik Oldsberg2016-10-061-4/+3
| | | | | | | | | | | | synchronous
* | | api/auth: fix for not being allowed to set your own state_keyPatrik Oldsberg2016-09-301-10/+0
|/ / | | | | | | Signed-off-by: Patrik Oldsberg <patrik.oldsberg@ericsson.com>
* | Update commentsErik Johnston2016-09-221-2/+3
| |
* | Add commentsErik Johnston2016-09-221-0/+3
| |
* | Shuffle things around to make unit tests workErik Johnston2016-09-221-14/+15
| |
* | Allow invites via 3pid to bypass sender sig checkErik Johnston2016-09-221-1/+16
|/ | | | | | | | | | | | | | When a server sends a third party invite another server may be the one that the inviting user registers with. In this case it is that remote server that will issue an actual invitation, and wants to do it "in the name of" the original invitee. However, the new proper invite will not be signed by the original server, and thus other servers would reject the invite if it was seen as coming from the original user. To fix this, a special case has been added to the auth rules whereby another server can send an invite "in the name of" another server's user, so long as that user had previously issued a third party invite that is now being accepted.
* Add helper function for getting access_tokens from requestsMark Haines2016-09-091-7/+51
| | | | | | Rather than reimplementing the token parsing in the various places. This will make it easier to change the token parsing to allow access_tokens in HTTP headers.
* Handle the fact that workers can't generate state groupsErik Johnston2016-08-311-2/+4
|
* Correctly handle the difference between prev and current stateErik Johnston2016-08-311-2/+2
|
* Cache check_host_in_roomErik Johnston2016-08-261-14/+6
|
* Add measure on check_host_in_roomErik Johnston2016-08-261-11/+12
|
* Pull out full state lessErik Johnston2016-08-251-6/+7
|
* Replace context.current_state with context.current_state_idsErik Johnston2016-08-251-24/+44
|
* Fix login with m.login.tokenRichard van der Hoff2016-08-081-15/+30
| | | | | login with token (as used by CAS auth) was broken by 067596d, such that it always returned a 401.
* Merge pull request #952 from matrix-org/markjh/more_fixesMark Haines2016-07-261-0/+4
|\ | | | | Check if the user is banned when handling 3pid invites
| * Check if the user is banned when handling 3pid invitesMark Haines2016-07-261-0/+4
| |
* | Add `create_requester` functionRichard van der Hoff2016-07-261-13/+11
|/ | | | | Wrap the `Requester` constructor with a function which provides sensible defaults, and use it throughout
* Record device_id in client_ipsRichard van der Hoff2016-07-201-6/+23
| | | | | Record the device_id when we add a client ip; it's somewhat redundant as we could get it via the access_token, but it will make querying rather easier.
* More doc-commentsRichard van der Hoff2016-07-201-3/+2
| | | | Fix some more comments on some things
* Fix 500 ISE when sending alias event without a state_keyMark Haines2016-07-151-0/+5
|
* Merge pull request #919 from matrix-org/erikj/auth_fixErik Johnston2016-07-151-1/+25
|\ | | | | Various auth.py fixes.
| * Check sender signed eventErik Johnston2016-07-141-2/+8
| |
| * Check if alias event's state_key matches sender's domainErik Johnston2016-07-131-0/+11
| |
| * Check creation event's room_id domain matches sender'sErik Johnston2016-07-131-0/+7
| |
* | Bug fix: expire invalid access tokensNegar Fazeli2016-07-131-0/+3
|/
* Fix bug where we did not correctly explode when multiple user_ids were set ↵Erik Johnston2016-07-071-5/+10
| | | | in macaroon
* Working unsubscribe links going straight to the HSDavid Baker2016-06-021-0/+7
| | | | and authed by macaroons that let you delete pushers and nothing else
* Merge remote-tracking branch 'origin/develop' into dbkr/email_unsubscribeDavid Baker2016-06-021-0/+18
|\
| * special case m.room.third_party_invite event auth to match invites, ↵Matthew Hodgson2016-06-011-0/+18
| | | | | | | | otherwise they get out of sync and you get https://github.com/vector-im/vector-web/issues/1208
* | WIP on unsubscribing email notifs without logging inDavid Baker2016-06-011-9/+16
|/
* Spell "domain" correctlyMark Haines2016-05-161-8/+8
| | | | s/domian/domain/g
* Create user with expiryNegi Fazeli2016-05-131-1/+2
| | | | | | - Add unittests for client, api and handler Signed-off-by: Negar Fazeli <negar.fazeli@ericsson.com>
* Add and use get_domian_from_idErik Johnston2016-05-091-8/+8
|
* Measure Auth.checkErik Johnston2016-04-131-47/+50
|
* Don't auto log failed auth checksErik Johnston2016-04-131-53/+45
|
* Add published room list edit APIErik Johnston2016-03-211-4/+50
|
* Send the user ID matching the guest access token, since there is no Matrix ↵David Baker2016-03-071-2/+2
| | | | API to discover what user ID an access token is for.
* Allow third_party_signed to be specified on /joinDaniel Wagner-Hall2016-02-231-21/+36
|
* Fix up logcontextsErik Johnston2016-02-081-1/+3
|
* Log more diagnostics for unrecognised access tokensDaniel Wagner-Hall2016-02-021-0/+2
|
* Fix flake8 warnings for new flake8Daniel Wagner-Hall2016-02-021-1/+1
|
* Don't error on AS non-ghost user useDaniel Wagner-Hall2016-01-181-0/+2
| | | | | This will probably go away either when we fix our existing ASes, or when we kill the concept of non-ghost users.
* Pull out app service user lookupDaniel Wagner-Hall2016-01-181-31/+28
| | | | I find this a lot simpler than nested try-catches and stuff
* Require AS users to be registered before useDaniel Wagner-Hall2016-01-131-0/+5
|
* Introduce a Requester objectDaniel Wagner-Hall2016-01-111-3/+5
| | | | | | | | | This tracks data about the entity which made the request. This is instead of passing around a tuple, which requires call-site modifications every time a new piece of optional context is passed around. I tried to introduce a User object. I gave up.
* Allow guests to upgrade their accountsDaniel Wagner-Hall2016-01-051-3/+3
|
* Strip address and such out of 3pid invitesDaniel Wagner-Hall2015-12-171-1/+1
| | | | We're not meant to leak that into the graph
* Allow user to redact with an equal powerErik Johnston2015-11-261-1/+1
| | | | | Users only need their power level to be equal to the redact level for them to be allowed to redact events.
* Merge branch 'develop' into daniel/forgetroomsPaul "LeoNerd" Evans2015-11-191-8/+17
|\
| * Take a boolean not a list of lambdasDaniel Wagner-Hall2015-11-191-8/+17
| |
* | Allow users to forget roomsDaniel Wagner-Hall2015-11-171-0/+7
|/
* Always check guest = true in macaroonsSteven Hammerton2015-11-171-1/+2
|
* Share more code between macaroon validationSteven Hammerton2015-11-111-9/+10
|
* Exchange 3pid invites for m.room.member invitesDaniel Wagner-Hall2015-11-051-35/+38
|
* Allow guests to register and call /events?room_id=Daniel Wagner-Hall2015-11-041-41/+54
| | | | | | | This follows the same flows-based flow as regular registration, but as the only implemented flow has no requirements, it auto-succeeds. In the future, other flows (e.g. captcha) may be required, so clients should treat this like the regular registration flow choices.
* Reject events which are too largeDaniel Wagner-Hall2015-10-221-1/+21
| | | | SPEC-222
* Allow rejecting invitesDaniel Wagner-Hall2015-10-201-1/+5
| | | | | This is done by using the same /leave flow as you would use if you had already accepted the invite and wanted to leave.
* Stuff signed data in a standalone objectDaniel Wagner-Hall2015-10-161-7/+14
| | | | | Makes both generating it in sydent, and verifying it here, simpler at the cost of some repetition
* Add signing host and keyname to signaturesDaniel Wagner-Hall2015-10-161-5/+9
|
* Verify third party ID server certificatesDaniel Wagner-Hall2015-10-161-0/+11
|
* Remove unnecessary class-wrappingDaniel Wagner-Hall2015-10-131-3/+3
|
* Add some docstringDaniel Wagner-Hall2015-10-131-0/+15
|
* Move event contents into third_party_layout fieldDaniel Wagner-Hall2015-10-131-9/+12
|
* Add third party invites to auth_events for joinsDaniel Wagner-Hall2015-10-061-0/+5
|
* Merge branch 'develop' into daniel/3pidinvitesDaniel Wagner-Hall2015-10-051-1/+24
|\