From 6c536303b8b9428d7aec10eede096b5aa5e457ee Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Wed, 15 Jan 2025 11:01:05 +0100 Subject: [PATCH 1/9] fix(oauth2): adjust db schemas when migrating from owncloud Signed-off-by: Richard Steinmetz --- .../Repair/Owncloud/MigrateOauthTables.php | 61 ++++++++++++++++++- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/lib/private/Repair/Owncloud/MigrateOauthTables.php b/lib/private/Repair/Owncloud/MigrateOauthTables.php index 8282db6bd0b2c..31d6072293027 100644 --- a/lib/private/Repair/Owncloud/MigrateOauthTables.php +++ b/lib/private/Repair/Owncloud/MigrateOauthTables.php @@ -25,6 +25,7 @@ use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; +use OCP\Security\ICrypto; class MigrateOauthTables implements IRepairStep { /** @var Connection */ @@ -33,7 +34,10 @@ class MigrateOauthTables implements IRepairStep { /** * @param Connection $db */ - public function __construct(Connection $db) { + public function __construct( + Connection $db, + private readonly ICrypto $crypto, + ) { $this->db = $db; } @@ -71,6 +75,22 @@ public function run(IOutput $output) { if (!$table->hasIndex('oauth2_access_client_id_idx')) { $table->addIndex(['client_id'], 'oauth2_access_client_id_idx'); } + if (!$table->hasColumn('token_id')) { + $table->addColumn('token_id', 'integer', [ + 'notnull' => true, + ]); + } + if ($table->hasColumn('user_id')) { + $table->dropColumn('user_id'); + } + if ($table->hasColumn('expires')) { + $table->dropColumn('expires'); + } + if ($table->hasColumn('token')) { + // Warning: We are dropping auth tokens. However, they should only be valid for an hour, + // and we can't really migrate them to oc_authtoken anyway. + $table->dropColumn('token'); + } $output->info('Update the oauth2_clients table schema.'); $table = $schema->getTable('oauth2_clients'); @@ -114,10 +134,10 @@ public function run(IOutput $output) { $table->addIndex(['client_identifier'], 'oauth2_client_id_idx'); } - $this->db->migrateToSchema($schema->getWrappedSchema()); - // Regenerate schema after migrating to it + $this->db->migrateToSchema($schema->getWrappedSchema()); $schema = new SchemaWrapper($this->db); + if ($schema->getTable('oauth2_clients')->hasColumn('identifier')) { $output->info("Move identifier column's data to the new client_identifier column."); // 1. Fetch all [id, identifier] couple. @@ -139,7 +159,10 @@ public function run(IOutput $output) { $output->info('Drop the identifier column.'); $table = $schema->getTable('oauth2_clients'); $table->dropColumn('identifier'); + + // Regenerate schema after migrating to it $this->db->migrateToSchema($schema->getWrappedSchema()); + $schema = new SchemaWrapper($this->db); } $output->info('Delete clients (and their related access tokens) with the redirect_uri starting with oc:// or ending with *'); @@ -172,5 +195,37 @@ public function run(IOutput $output) { $qbDeleteClients->expr()->iLike('redirect_uri', $qbDeleteClients->createNamedParameter('%*', IQueryBuilder::PARAM_STR)) ); $qbDeleteClients->executeStatement(); + + // Migrate plain client secrets and widen the column + $clientsTable = $schema->getTable('oauth2_clients'); + if ($clientsTable->getColumn('secret')->getLength() === 64) { + $output->info("Migrate client secrets."); + + // Widen the column first + $clientsTable->getColumn('secret')->setLength(512); + + // Regenerate schema after migrating to it + $this->db->migrateToSchema($schema->getWrappedSchema()); + $schema = new SchemaWrapper($this->db); + + $qb = $this->db->getQueryBuilder(); + $qb->update('oauth2_clients') + ->set('secret', $qb->createParameter('secret')) + ->where($qb->expr()->eq('id', $qb->createParameter('id'))); + + $qbSelect = $this->db->getQueryBuilder(); + $qbSelect->select('id', 'secret') + ->from('oauth2_clients'); + $result = $qbSelect->executeQuery(); + while ($row = $result->fetch()) { + $id = $row['id']; + $secret = $row['secret']; + $encryptedSecret = bin2hex($this->crypto->calculateHMAC($secret)); + $qb->setParameter('id', $id); + $qb->setParameter('secret', $encryptedSecret); + $qb->executeStatement(); + } + $result->closeCursor(); + } } } From 4f05cb3a136c805baab6ed82a993681876250217 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Wed, 15 Jan 2025 12:42:05 +0100 Subject: [PATCH 2/9] fixup! fix(oauth2): adjust db schemas when migrating from owncloud --- apps/oauth2/lib/Db/AccessTokenMapper.php | 12 ++++++- .../lib/Migration/SetTokenExpiration.php | 3 +- .../Repair/Owncloud/MigrateOauthTables.php | 34 +------------------ 3 files changed, 14 insertions(+), 35 deletions(-) diff --git a/apps/oauth2/lib/Db/AccessTokenMapper.php b/apps/oauth2/lib/Db/AccessTokenMapper.php index 0347a43d7c62d..3f25cb1f26811 100644 --- a/apps/oauth2/lib/Db/AccessTokenMapper.php +++ b/apps/oauth2/lib/Db/AccessTokenMapper.php @@ -41,6 +41,16 @@ * @template-extends QBMapper */ class AccessTokenMapper extends QBMapper { + // Ignore potential legacy column 'token' from oc for now until it is migrated properly + public const COLUMN_LIST = [ + 'id', + 'token_id', + 'client_id', + 'hashed_code', + 'encrypted_token', + 'code_created_at', + 'token_count', + ]; public function __construct( IDBConnection $db, @@ -57,7 +67,7 @@ public function __construct( public function getByCode(string $code): AccessToken { $qb = $this->db->getQueryBuilder(); $qb - ->select('*') + ->select(...self::COLUMN_LIST) ->from($this->tableName) ->where($qb->expr()->eq('hashed_code', $qb->createNamedParameter(hash('sha512', $code)))); diff --git a/apps/oauth2/lib/Migration/SetTokenExpiration.php b/apps/oauth2/lib/Migration/SetTokenExpiration.php index 5a5c5ff478193..75751ad4c8e41 100644 --- a/apps/oauth2/lib/Migration/SetTokenExpiration.php +++ b/apps/oauth2/lib/Migration/SetTokenExpiration.php @@ -28,6 +28,7 @@ use OC\Authentication\Token\IProvider as TokenProvider; use OCA\OAuth2\Db\AccessToken; +use OCA\OAuth2\Db\AccessTokenMapper; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Authentication\Exceptions\InvalidTokenException; use OCP\IDBConnection; @@ -59,7 +60,7 @@ public function getName(): string { public function run(IOutput $output) { $qb = $this->connection->getQueryBuilder(); - $qb->select('*') + $qb->select(...AccessTokenMapper::COLUMN_LIST) ->from('oauth2_access_tokens'); $cursor = $qb->execute(); diff --git a/lib/private/Repair/Owncloud/MigrateOauthTables.php b/lib/private/Repair/Owncloud/MigrateOauthTables.php index 31d6072293027..0f894b6b3cc4b 100644 --- a/lib/private/Repair/Owncloud/MigrateOauthTables.php +++ b/lib/private/Repair/Owncloud/MigrateOauthTables.php @@ -89,7 +89,7 @@ public function run(IOutput $output) { if ($table->hasColumn('token')) { // Warning: We are dropping auth tokens. However, they should only be valid for an hour, // and we can't really migrate them to oc_authtoken anyway. - $table->dropColumn('token'); + //$table->dropColumn('token'); } $output->info('Update the oauth2_clients table schema.'); @@ -195,37 +195,5 @@ public function run(IOutput $output) { $qbDeleteClients->expr()->iLike('redirect_uri', $qbDeleteClients->createNamedParameter('%*', IQueryBuilder::PARAM_STR)) ); $qbDeleteClients->executeStatement(); - - // Migrate plain client secrets and widen the column - $clientsTable = $schema->getTable('oauth2_clients'); - if ($clientsTable->getColumn('secret')->getLength() === 64) { - $output->info("Migrate client secrets."); - - // Widen the column first - $clientsTable->getColumn('secret')->setLength(512); - - // Regenerate schema after migrating to it - $this->db->migrateToSchema($schema->getWrappedSchema()); - $schema = new SchemaWrapper($this->db); - - $qb = $this->db->getQueryBuilder(); - $qb->update('oauth2_clients') - ->set('secret', $qb->createParameter('secret')) - ->where($qb->expr()->eq('id', $qb->createParameter('id'))); - - $qbSelect = $this->db->getQueryBuilder(); - $qbSelect->select('id', 'secret') - ->from('oauth2_clients'); - $result = $qbSelect->executeQuery(); - while ($row = $result->fetch()) { - $id = $row['id']; - $secret = $row['secret']; - $encryptedSecret = bin2hex($this->crypto->calculateHMAC($secret)); - $qb->setParameter('id', $id); - $qb->setParameter('secret', $encryptedSecret); - $qb->executeStatement(); - } - $result->closeCursor(); - } } } From 0b8f969945ae5f1ed5e2bb17981520578d296bce Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Wed, 15 Jan 2025 17:12:43 +0100 Subject: [PATCH 3/9] fixup! fix(oauth2): adjust db schemas when migrating from owncloud --- lib/private/Repair/Owncloud/MigrateOauthTables.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/private/Repair/Owncloud/MigrateOauthTables.php b/lib/private/Repair/Owncloud/MigrateOauthTables.php index 0f894b6b3cc4b..b5468b82ebff5 100644 --- a/lib/private/Repair/Owncloud/MigrateOauthTables.php +++ b/lib/private/Repair/Owncloud/MigrateOauthTables.php @@ -25,7 +25,6 @@ use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; -use OCP\Security\ICrypto; class MigrateOauthTables implements IRepairStep { /** @var Connection */ @@ -34,10 +33,7 @@ class MigrateOauthTables implements IRepairStep { /** * @param Connection $db */ - public function __construct( - Connection $db, - private readonly ICrypto $crypto, - ) { + public function __construct(Connection $db) { $this->db = $db; } From dbc03f44518c45e991715077333b78cec2061c16 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Thu, 16 Jan 2025 09:07:24 +0100 Subject: [PATCH 4/9] fixup! fix(oauth2): adjust db schemas when migrating from owncloud --- apps/oauth2/lib/Db/AccessTokenMapper.php | 12 +----------- apps/oauth2/lib/Migration/SetTokenExpiration.php | 3 +-- lib/private/Repair/Owncloud/MigrateOauthTables.php | 10 ++++------ 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/apps/oauth2/lib/Db/AccessTokenMapper.php b/apps/oauth2/lib/Db/AccessTokenMapper.php index 3f25cb1f26811..0347a43d7c62d 100644 --- a/apps/oauth2/lib/Db/AccessTokenMapper.php +++ b/apps/oauth2/lib/Db/AccessTokenMapper.php @@ -41,16 +41,6 @@ * @template-extends QBMapper */ class AccessTokenMapper extends QBMapper { - // Ignore potential legacy column 'token' from oc for now until it is migrated properly - public const COLUMN_LIST = [ - 'id', - 'token_id', - 'client_id', - 'hashed_code', - 'encrypted_token', - 'code_created_at', - 'token_count', - ]; public function __construct( IDBConnection $db, @@ -67,7 +57,7 @@ public function __construct( public function getByCode(string $code): AccessToken { $qb = $this->db->getQueryBuilder(); $qb - ->select(...self::COLUMN_LIST) + ->select('*') ->from($this->tableName) ->where($qb->expr()->eq('hashed_code', $qb->createNamedParameter(hash('sha512', $code)))); diff --git a/apps/oauth2/lib/Migration/SetTokenExpiration.php b/apps/oauth2/lib/Migration/SetTokenExpiration.php index 75751ad4c8e41..5a5c5ff478193 100644 --- a/apps/oauth2/lib/Migration/SetTokenExpiration.php +++ b/apps/oauth2/lib/Migration/SetTokenExpiration.php @@ -28,7 +28,6 @@ use OC\Authentication\Token\IProvider as TokenProvider; use OCA\OAuth2\Db\AccessToken; -use OCA\OAuth2\Db\AccessTokenMapper; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Authentication\Exceptions\InvalidTokenException; use OCP\IDBConnection; @@ -60,7 +59,7 @@ public function getName(): string { public function run(IOutput $output) { $qb = $this->connection->getQueryBuilder(); - $qb->select(...AccessTokenMapper::COLUMN_LIST) + $qb->select('*') ->from('oauth2_access_tokens'); $cursor = $qb->execute(); diff --git a/lib/private/Repair/Owncloud/MigrateOauthTables.php b/lib/private/Repair/Owncloud/MigrateOauthTables.php index b5468b82ebff5..1c3e4c15084c1 100644 --- a/lib/private/Repair/Owncloud/MigrateOauthTables.php +++ b/lib/private/Repair/Owncloud/MigrateOauthTables.php @@ -76,16 +76,14 @@ public function run(IOutput $output) { 'notnull' => true, ]); } - if ($table->hasColumn('user_id')) { - $table->dropColumn('user_id'); - } if ($table->hasColumn('expires')) { $table->dropColumn('expires'); } + if ($table->hasColumn('user_id')) { + $table->dropColumn('user_id'); + } if ($table->hasColumn('token')) { - // Warning: We are dropping auth tokens. However, they should only be valid for an hour, - // and we can't really migrate them to oc_authtoken anyway. - //$table->dropColumn('token'); + $table->dropColumn('token'); } $output->info('Update the oauth2_clients table schema.'); From 8468a1e69dc9aa710ff5d96e0443b7f1f6a600c4 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Thu, 16 Jan 2025 11:42:46 +0100 Subject: [PATCH 5/9] fixup! fix(oauth2): adjust db schemas when migrating from owncloud --- lib/private/Repair.php | 2 + .../Repair/Owncloud/MigrateOauthTables.php | 76 ++++++++++++++++++- 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/lib/private/Repair.php b/lib/private/Repair.php index ec1dad2b55ad6..54c3118c260ad 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -34,6 +34,7 @@ */ namespace OC; +use OC\Authentication\Token\IProvider as ITokenProvider; use OC\DB\Connection; use OC\DB\ConnectionAdapter; use OC\Repair\AddAppConfigLazyMigration; @@ -85,6 +86,7 @@ use OC\Repair\RepairMimeTypes; use OC\Template\JSCombiner; use OCA\DAV\Migration\DeleteSchedulingObjects; +use OCA\OAuth2\Db\AccessTokenMapper; use OCP\AppFramework\QueryException; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Collaboration\Resources\IManager; diff --git a/lib/private/Repair/Owncloud/MigrateOauthTables.php b/lib/private/Repair/Owncloud/MigrateOauthTables.php index 1c3e4c15084c1..a62e5a274905d 100644 --- a/lib/private/Repair/Owncloud/MigrateOauthTables.php +++ b/lib/private/Repair/Owncloud/MigrateOauthTables.php @@ -20,11 +20,18 @@ */ namespace OC\Repair\Owncloud; +use OC\Authentication\Token\IProvider as ITokenProvider; use OC\DB\Connection; use OC\DB\SchemaWrapper; +use OCA\OAuth2\Db\AccessToken; +use OCA\OAuth2\Db\AccessTokenMapper; +use OCP\AppFramework\Utility\ITimeFactory; +use OCP\Authentication\Token\IToken; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; +use OCP\Security\ICrypto; +use OCP\Security\ISecureRandom; class MigrateOauthTables implements IRepairStep { /** @var Connection */ @@ -33,7 +40,14 @@ class MigrateOauthTables implements IRepairStep { /** * @param Connection $db */ - public function __construct(Connection $db) { + public function __construct( + Connection $db, + private AccessTokenMapper $accessTokenMapper, + private ITokenProvider $tokenProvider, + private ISecureRandom $random, + private ITimeFactory $timeFactory, + private ICrypto $crypto, + ) { $this->db = $db; } @@ -52,13 +66,22 @@ public function run(IOutput $output) { } $output->info('Update the oauth2_access_tokens table schema.'); + + // Create column and then migrate before handling unique index. + // So that we can distinguish between legacy (from oc) and new rows (from nc). $table = $schema->getTable('oauth2_access_tokens'); if (!$table->hasColumn('hashed_code')) { $table->addColumn('hashed_code', 'string', [ 'notnull' => true, 'length' => 128, ]); + + // Regenerate schema after migrating to it + $this->db->migrateToSchema($schema->getWrappedSchema()); + $schema = new SchemaWrapper($this->db); } + + $table = $schema->getTable('oauth2_access_tokens'); if (!$table->hasColumn('encrypted_token')) { $table->addColumn('encrypted_token', 'string', [ 'notnull' => true, @@ -66,6 +89,12 @@ public function run(IOutput $output) { ]); } if (!$table->hasIndex('oauth2_access_hash_idx')) { + // Drop legacy access codes first to prevent integrity constraint violations + $qb = $this->db->getQueryBuilder(); + $qb->delete('oauth2_access_tokens') + ->where($qb->expr()->eq('hashed_code', $qb->createNamedParameter(''))); + $qb->executeStatement(); + $table->addUniqueIndex(['hashed_code'], 'oauth2_access_hash_idx'); } if (!$table->hasIndex('oauth2_access_client_id_idx')) { @@ -189,5 +218,50 @@ public function run(IOutput $output) { $qbDeleteClients->expr()->iLike('redirect_uri', $qbDeleteClients->createNamedParameter('%*', IQueryBuilder::PARAM_STR)) ); $qbDeleteClients->executeStatement(); + + // Migrate legacy refresh tokens from oc + if ($schema->hasTable('oauth2_refresh_tokens')) { + $output->info('Migrate legacy oauth2 refresh tokens.'); + + $qbSelect = $this->db->getQueryBuilder(); + $qbSelect->select('*') + ->from('oauth2_refresh_tokens'); + $result = $qbSelect->executeQuery(); + $now = $this->timeFactory->now()->getTimestamp(); + $index = 0; + while ($row = $result->fetch()) { + $clientId = $row['client_id']; + $refreshToken = $row['token']; + + // Insert expired token so that it can be rotated on the next refresh + $accessToken = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS); + $authToken = $this->tokenProvider->generateToken( + $accessToken, + $row['user_id'], + $row['user_id'], + null, + "oc_migrated_client${clientId}_t{$now}_i$index", + IToken::PERMANENT_TOKEN, + IToken::DO_NOT_REMEMBER, + ); + $authToken->setExpires($now - 3600); + $this->tokenProvider->updateToken($authToken); + + $accessTokenEntity = new AccessToken(); + $accessTokenEntity->setTokenId($authToken->getId()); + $accessTokenEntity->setClientId($clientId); + $accessTokenEntity->setHashedCode(hash('sha512', $refreshToken)); + $accessTokenEntity->setEncryptedToken($this->crypto->encrypt($accessToken, $refreshToken)); + $accessTokenEntity->setCodeCreatedAt($now); + $accessTokenEntity->setTokenCount(1); + $this->accessTokenMapper->insert($accessTokenEntity); + + $index++; + } + $result->closeCursor(); + + $schema->dropTable('oauth2_refresh_tokens'); + $schema->performDropTableCalls(); + } } } From e7a0676d793943042d790df051ab87c2c1d31de7 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Mon, 20 Jan 2025 10:23:48 +0100 Subject: [PATCH 6/9] fixup! fix(oauth2): adjust db schemas when migrating from owncloud --- lib/private/Repair/Owncloud/MigrateOauthTables.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Repair/Owncloud/MigrateOauthTables.php b/lib/private/Repair/Owncloud/MigrateOauthTables.php index a62e5a274905d..05a692499eb3b 100644 --- a/lib/private/Repair/Owncloud/MigrateOauthTables.php +++ b/lib/private/Repair/Owncloud/MigrateOauthTables.php @@ -65,8 +65,7 @@ public function run(IOutput $output) { return; } - $output->info('Update the oauth2_access_tokens table schema.'); - + $output->info('Prepare the oauth2_access_tokens table schema.'); // Create column and then migrate before handling unique index. // So that we can distinguish between legacy (from oc) and new rows (from nc). $table = $schema->getTable('oauth2_access_tokens'); @@ -81,6 +80,7 @@ public function run(IOutput $output) { $schema = new SchemaWrapper($this->db); } + $output->info('Update the oauth2_access_tokens table schema.'); $table = $schema->getTable('oauth2_access_tokens'); if (!$table->hasColumn('encrypted_token')) { $table->addColumn('encrypted_token', 'string', [ From 100ceefbe1f2017d281fa12ffefcb7a5134ec9f3 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Mon, 20 Jan 2025 10:24:28 +0100 Subject: [PATCH 7/9] fixup! fix(oauth2): adjust db schemas when migrating from owncloud [skip ci] --- lib/private/Repair/Owncloud/MigrateOauthTables.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Repair/Owncloud/MigrateOauthTables.php b/lib/private/Repair/Owncloud/MigrateOauthTables.php index 05a692499eb3b..f17a6b63cb063 100644 --- a/lib/private/Repair/Owncloud/MigrateOauthTables.php +++ b/lib/private/Repair/Owncloud/MigrateOauthTables.php @@ -65,11 +65,11 @@ public function run(IOutput $output) { return; } - $output->info('Prepare the oauth2_access_tokens table schema.'); // Create column and then migrate before handling unique index. // So that we can distinguish between legacy (from oc) and new rows (from nc). $table = $schema->getTable('oauth2_access_tokens'); if (!$table->hasColumn('hashed_code')) { + $output->info('Prepare the oauth2_access_tokens table schema.'); $table->addColumn('hashed_code', 'string', [ 'notnull' => true, 'length' => 128, From 7d0c0b9d45be967b1e7656206537711ddc2d1c10 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Mon, 20 Jan 2025 13:49:42 +0100 Subject: [PATCH 8/9] fixup! fix(oauth2): adjust db schemas when migrating from owncloud --- lib/private/Repair.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/private/Repair.php b/lib/private/Repair.php index 54c3118c260ad..4cf54c47534d4 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -34,8 +34,6 @@ */ namespace OC; -use OC\Authentication\Token\IProvider as ITokenProvider; -use OC\DB\Connection; use OC\DB\ConnectionAdapter; use OC\Repair\AddAppConfigLazyMigration; use OC\Repair\AddBruteForceCleanupJob; @@ -86,7 +84,6 @@ use OC\Repair\RepairMimeTypes; use OC\Template\JSCombiner; use OCA\DAV\Migration\DeleteSchedulingObjects; -use OCA\OAuth2\Db\AccessTokenMapper; use OCP\AppFramework\QueryException; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Collaboration\Resources\IManager; From 16471dd91b2c70f00d37e53c7e81735e52ae5a2a Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Mon, 20 Jan 2025 13:54:29 +0100 Subject: [PATCH 9/9] fixup! fix(oauth2): adjust db schemas when migrating from owncloud --- lib/private/Repair.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Repair.php b/lib/private/Repair.php index 4cf54c47534d4..871b1a13119be 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -187,7 +187,7 @@ public static function getRepairSteps(): array { \OC::$server->getUserManager(), \OC::$server->getConfig() ), - new MigrateOauthTables(\OC::$server->get(Connection::class)), + \OC::$server->get(MigrateOauthTables::class), new FixMountStorages(\OC::$server->getDatabaseConnection()), new UpdateLanguageCodes(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()), new AddLogRotateJob(\OC::$server->getJobList()),