Olivier 'reivilibre e2a08d2365 Only allow C-S device scopes when the C-S API scope has been requested
It'd be weird for a client to request a device on the client-server API but yet not request any client-server API scopes to use it with.

By adding this restriction, we can then create a partial index on the oauth2_sessions table to quickly identify sessions that have C-S API scopes and use this as a proxy metric for how many sessions may have device scopes.
This in turn makes it feasible to efficiently limit the number of 'devices' a user has, or more precisely: the number of sessions with client-server API access.

We can't do the same for device scopes themselves because, other than nastiness like parsing the JSON stringification of the scope list, it's not feasible to identify device scopes within a Postgres index predicate.

Part of: #4339
2025-10-31 15:17:39 +00:00
2025-10-28 12:42:38 +00:00
2025-10-20 16:42:01 +01:00
2025-10-28 12:42:38 +00:00
2025-09-12 09:46:52 +02:00
2025-10-28 12:50:11 +00:00
2025-10-28 12:50:11 +00:00
2025-09-16 13:39:01 +02:00
2024-09-10 14:28:55 +02:00
2025-06-12 10:31:53 +02:00
2025-06-12 10:31:51 +02:00

Matrix Authentication Service

MAS (Matrix Authentication Service) is a user management and authentication service for Matrix homeservers, written and maintained by Element. You can directly run and manage the source code in this repository, available under an AGPL license (or alternatively under a commercial license from Element). Support is not provided by Element unless you have a subscription.

It has been created to support the migration of Matrix to a next-generation of auth APIs per MSC3861.

See the Documentation for information on installation and use.

You can learn more about Matrix and next-generation auth at areweoidcyet.com.

💬 Community room

Developers and users of Matrix Authentication Service can chat in the #matrix-auth:matrix.org room on Matrix.

🛠️ Installing and configuration

The best way to get a modern Element Matrix stack is through the Element Server Suite Community Edition, which includes MAS.

The MAS documentation describes how to install and configure MAS. We recommend using the Docker image or the pre-built binaries.

📖 Translations

Matrix Authentication Service is available in multiple languages. Anyone can contribute to translations through Localazy.

🏗️ Contributing

See the contribution guidelines for information on how to contribute to this project.

Copyright 2024, 2025 New Vector Ltd. Copyright 2021-2024 The Matrix.org Foundation C.I.C.

This software is dual-licensed by New Vector Ltd (Element). It can be used either:

(1) for free under the terms of the GNU Affero General Public License (as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version); OR

(2) under the terms of a paid-for Element Commercial License agreement between you and Element (the terms of which may vary depending on what you and Element have agreed to). Unless required by applicable law or agreed to in writing, software distributed under the Licenses is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses.

S
Description
No description provided
Readme AGPL-3.0
41 MiB
Languages
Rust 84.2%
TypeScript 8.7%
HTML 4%
Open Policy Agent 1.2%
CSS 1%
Other 0.8%