Remove leftovers from OAuth 2.0 consent tracking cleanup

This commit is contained in:
Quentin Gliech
2026-01-08 13:18:15 +01:00
parent 5cdf938129
commit bc1ca15833
2 changed files with 18 additions and 20 deletions

View File

@@ -0,0 +1,18 @@
-- Copyright 2026 Element Creations Ltd.
--
-- SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
-- Please see LICENSE in the repository root for full details.
-- We've removed the idea of conditional consent (just go through the login if
-- we already consented in the past) but didn't do the cleanup in
-- https://github.com/element-hq/matrix-authentication-service/pull/4386
-- In this version we completely stopped writing to this table, so that it's
-- safe to completely drop in the next version
TRUNCATE TABLE oauth2_consents;
-- We stopped reading and writing in those columns a long time ago, so it's fine
-- to drop them now
ALTER TABLE oauth2_authorization_grants
DROP COLUMN max_age,
DROP COLUMN requires_consent;

View File

@@ -725,26 +725,6 @@ impl OAuth2ClientRepository for PgOAuth2ClientRepository<'_> {
.await?;
}
// Delete the user consents
{
let span = info_span!(
"db.oauth2_client.delete_by_id.consents",
{ DB_QUERY_TEXT } = tracing::field::Empty,
);
sqlx::query!(
r#"
DELETE FROM oauth2_consents
WHERE oauth2_client_id = $1
"#,
Uuid::from(id),
)
.record(&span)
.execute(&mut *self.conn)
.instrument(span)
.await?;
}
// Delete the OAuth 2 sessions related data
{
let span = info_span!(