From 6c59ed20c46a161b31a8b5812f3010d94aefe7ba Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 28 Mar 2024 14:08:00 -0300 Subject: [PATCH] chore: temporary remove support to TwoFactorGateway Signed-off-by: Vitor Mattos --- .github/workflows/behat-mysql.yml | 2 +- .github/workflows/phpunit-mariadb.yml | 8 ++++---- .github/workflows/phpunit-mysql.yml | 8 ++++---- .github/workflows/phpunit-pgsql.yml | 8 ++++---- .github/workflows/phpunit-sqlite.yml | 8 ++++---- lib/Controller/SignFileController.php | 9 ++++----- 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/behat-mysql.yml b/.github/workflows/behat-mysql.yml index 167058160c..2a83e9bf00 100644 --- a/.github/workflows/behat-mysql.yml +++ b/.github/workflows/behat-mysql.yml @@ -180,4 +180,4 @@ jobs: steps: - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-mysql.result != 'success' }}; then exit 1; fi + run: if ${{ needs.changes.outputs.src != 'false' && needs.behat-mysql.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/phpunit-mariadb.yml b/.github/workflows/phpunit-mariadb.yml index c81da7de44..306684b298 100644 --- a/.github/workflows/phpunit-mariadb.yml +++ b/.github/workflows/phpunit-mariadb.yml @@ -152,10 +152,10 @@ jobs: ./occ --version ./occ app:enable --force ${{ env.APP_NAME }} - - name: Set up dependencies apps - run: | - ./occ app:install --force --keep-disabled twofactor_gateway - ./occ app:enable --force twofactor_gateway + # - name: Set up dependencies apps + # run: | + # ./occ app:install --force --keep-disabled twofactor_gateway + # ./occ app:enable --force twofactor_gateway - name: Run Nextcloud run: php -S localhost:8080 & diff --git a/.github/workflows/phpunit-mysql.yml b/.github/workflows/phpunit-mysql.yml index 0361ede80f..331964cc1e 100644 --- a/.github/workflows/phpunit-mysql.yml +++ b/.github/workflows/phpunit-mysql.yml @@ -152,10 +152,10 @@ jobs: ./occ --version ./occ app:enable --force ${{ env.APP_NAME }} - - name: Set up dependencies apps - run: | - ./occ app:install --force --keep-disabled twofactor_gateway - ./occ app:enable --force twofactor_gateway + # - name: Set up dependencies apps + # run: | + # ./occ app:install --force --keep-disabled twofactor_gateway + # ./occ app:enable --force twofactor_gateway - name: Run Nextcloud run: php -S localhost:8080 & diff --git a/.github/workflows/phpunit-pgsql.yml b/.github/workflows/phpunit-pgsql.yml index abfeedf8e5..6182a918ea 100644 --- a/.github/workflows/phpunit-pgsql.yml +++ b/.github/workflows/phpunit-pgsql.yml @@ -148,10 +148,10 @@ jobs: ./occ --version ./occ app:enable --force ${{ env.APP_NAME }} - - name: Set up dependencies apps - run: | - ./occ app:install --force --keep-disabled twofactor_gateway - ./occ app:enable --force twofactor_gateway + # - name: Set up dependencies apps + # run: | + # ./occ app:install --force --keep-disabled twofactor_gateway + # ./occ app:enable --force twofactor_gateway - name: Run Nextcloud run: php -S localhost:8080 & diff --git a/.github/workflows/phpunit-sqlite.yml b/.github/workflows/phpunit-sqlite.yml index 77cb53a5c4..44885442dc 100644 --- a/.github/workflows/phpunit-sqlite.yml +++ b/.github/workflows/phpunit-sqlite.yml @@ -143,10 +143,10 @@ jobs: ./occ --version ./occ app:enable --force ${{ env.APP_NAME }} - - name: Set up dependencies apps - run: | - ./occ app:install --force --keep-disabled twofactor_gateway - ./occ app:enable --force twofactor_gateway + # - name: Set up dependencies apps + # run: | + # ./occ app:install --force --keep-disabled twofactor_gateway + # ./occ app:enable --force twofactor_gateway - name: Run Nextcloud run: php -S localhost:8080 & diff --git a/lib/Controller/SignFileController.php b/lib/Controller/SignFileController.php index 4fc1820617..cc67ac2377 100644 --- a/lib/Controller/SignFileController.php +++ b/lib/Controller/SignFileController.php @@ -36,7 +36,6 @@ use OCA\Libresign\Service\FileService; use OCA\Libresign\Service\IdentifyMethodService; use OCA\Libresign\Service\SignFileService; -use OCA\TwoFactorGateway\Exception\SmsTransmissionException; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; @@ -212,10 +211,10 @@ private function getCode(string $uuid = null, int $fileId = null): JSONResponse ); $message = $this->l10n->t('The code to sign file was successfully requested.'); $statusCode = Http::STATUS_OK; - } catch (SmsTransmissionException $e) { - // There was an error when to send SMS code to user. - $message = $this->l10n->t('Failed to send code.'); - $statusCode = Http::STATUS_UNPROCESSABLE_ENTITY; + // } catch (\OCA\TwoFactorGateway\Exception\SmsTransmissionException $e) { + // // There was an error when to send SMS code to user. + // $message = $this->l10n->t('Failed to send code.'); + // $statusCode = Http::STATUS_UNPROCESSABLE_ENTITY; } catch (\Throwable $th) { $message = $th->getMessage(); $statusCode = Http::STATUS_UNPROCESSABLE_ENTITY;