Remove leftovers from OAuth 2.0 consent tracking cleanup
This commit is contained in:
@@ -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;
|
||||
@@ -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!(
|
||||
|
||||
Reference in New Issue
Block a user