summary refs log tree commit diff
path: root/synapse/api/auth/msc3861_delegated.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Support getting the device ID explicitly from MAS (#18174)Quentin Gliech2025-03-041-17/+32
| | | | | | | | | | | | | | | | | | | | | | | The context for this is that the Matrix spec allows basically anything in the device ID. With MSC3861, we're restricting this to strings that can be represented as scopes. Whilst this works well for next-gen auth sessions, compatibility/legacy sessions still can have characters that can't be encoded (mainly spaces) in them. To work around that, we added in MAS a behaviour where the device_id is given as an explicit property of the token introspection response, and remove it from the scope. Because we don't expect users to rollout new Synapse and MAS versions in sync, we needed a way to 'advertise' support for this behaviour: the easiest way to do that was through an extra header in the introspection response. On the longer term, I expect MAS and Synapse to move away from the introspection endpoint, and instead define a specific API for Synapse -> MAS communication. PR on the MAS side: https://github.com/element-hq/matrix-authentication-service/pull/4067
* Add MSC3861 config options admin_token_path and client_secret_path (#18004)V024602025-02-041-6/+8
| | | | | | | | | | | | | | Another PR on my quest to a `*_path` variant for every secret. Adds two config options `admin_token_path` and `client_secret_path` to the experimental config under `experimental_features.msc3861`. Also includes tests. I tried to be a good citizen here by following `attrs` conventions and not rewriting the corresponding non-path variants in the class, but instead adding methods to retrieve the value. Reading secrets from files has the security advantage of separating the secrets from the config. It also simplifies secrets management in Kubernetes. Also useful to NixOS users.
* Support the new `/auth_metadata` endpoint defined in MSC2965. (#18093)Quentin Gliech2025-01-211-0/+6
| | | | | | | See the updated MSC2965 --------- Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Reduce overhead of sliding sync E2EE loops (#17771)Erik Johnston2024-09-301-1/+1
| | | | Mainly toning down logging and only calling `get_membership_from_event_ids` if something has changed.
* MSC3861: load the issuer and account management URLs from OIDC discovery ↵Quentin Gliech2024-08-301-2/+31
| | | | | | | | | | | | | | (#17407) This will help mitigating any discrepancies between the issuer configured and the one returned by the OIDC provider. This also removes the need for configuring the `account_management_url` explicitely, as it will now be loaded from the OIDC discovery, as per MSC2965. Because we may now fetch stuff for the .well-known/matrix/client endpoint, this also transforms the client well-known resource to be asynchronous.
* MSC3861: allow overriding the introspection endpoint (#17406)Quentin Gliech2024-07-081-2/+13
| | | | This makes it easier to go through an internal endpoint instead of the public facing URL when introspecting tokens, reducing latency.
* Allow enabling sliding sync per-user (#17393)Erik Johnston2024-07-051-0/+28
| | | Based on #17392
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+1
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Merge remote-tracking branch 'gitlab/clokep/license-license' into new_developErik Johnston2023-12-131-10/+16
|\
| * Update license headersPatrick Cloke2023-11-211-10/+16
| |
* | Keep track of `user_ips` and `monthly_active_users` when delegating auth ↵David Robertson2023-11-231-0/+4
|/ | | | | | | | | | | | | (#16672) * Describe `insert_client_ip` * Pull out client_ips and MAU tracking to BaseAuth * Define HAS_AUTHLIB once in tests sick of copypasting * Track ips and token usage when delegating auth * Test that we track MAU and user_ips * Don't track `__oidc_admin`
* Refactor `get_user_by_id` (#16316)Erik Johnston2023-09-141-1/+1
|
* Revert MSC3861 introspection cache, admin impersonation and account lock ↵Quentin Gliech2023-09-061-85/+6
| | | | (#16258)
* Add an admin endpoint to allow authorizing server to signal token ↵Shay2023-08-221-0/+13
| | | | revocations (#16125)
* MSC3861: allow impersonation by an admin using a query param (#16132)Mathieu Velten2023-08-181-3/+22
|
* Add response time metrics for introspection requests (#16131)Erik Johnston2023-08-181-7/+27
| | | See #16119
* Cache token introspection response from OIDC provider (#16117)Shay2023-08-171-2/+38
|
* Implements admin API to lock an user (MSC3939) (#15870)Mathieu Velten2023-08-101-0/+13
|
* Add stricter mypy options (#15694)Patrick Cloke2023-05-311-1/+1
| | | | Enable warn_unused_configs, strict_concatenate, disallow_subclassing_any, and disallow_incomplete_defs.
* Enforce that an admin token also has the basic Matrix API scopeQuentin Gliech2023-05-301-5/+2
|
* Reject tokens with multiple device scopesQuentin Gliech2023-05-301-6/+24
|
* Make OIDC scope constantsQuentin Gliech2023-05-301-10/+15
|
* Handle errors when introspecting tokensQuentin Gliech2023-05-301-5/+37
| | | | | This returns a proper 503 when the introspection endpoint is not working for some reason, which should avoid logging out clients in those cases.
* Make AS tokens work & allow ASes to /registerQuentin Gliech2023-05-301-2/+7
|
* Add an admin token for MAS -> Synapse callsQuentin Gliech2023-05-301-0/+15
|
* Refactor config to be an experimental featureHugh Nimmo-Smith2023-05-301-0/+280
Also enforce you can't combine it with incompatible config options