From d36dd548b34cdb73d1a5502912631c7db8b07484 Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 2 Mar 2020 23:28:58 +0100 Subject: [PATCH 01/28] Add support for laravel 7 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 097c227..71ad6c5 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,8 @@ "ext-json": "*", "bacon/bacon-qr-code": "2.*", "paragonie/constant_time_encoding": "2.*", - "illuminate/support": "^6.15", - "illuminate/auth": "^6.15" + "illuminate/support": "^6.15||^7.0", + "illuminate/auth": "^6.15||^7.0" }, "require-dev": { "orchestra/testbench": "^4.0", From c61ba5bcdb299e3598199b2931581071c4fd466a Mon Sep 17 00:00:00 2001 From: Italo Date: Mon, 2 Mar 2020 23:35:26 -0300 Subject: [PATCH 02/28] Fixed wrong method name to create another secret. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b2cde3..3b0bc08 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ public function confirmTwoFactor(Request $request) } ``` -If the User doesn't issue the correct Code, the method will return `false`. You can tell the User to double-check its device's timezone, or create another Shared Secret with `confirmTwoFactorAuth()`. +If the User doesn't issue the correct Code, the method will return `false`. You can tell the User to double-check its device's timezone, or create another Shared Secret with `createTwoFactorAuth()`. ### Recovery Codes From c9099291c8861dd14a4544040d972176253e29ea Mon Sep 17 00:00:00 2001 From: Italo Date: Mon, 2 Mar 2020 23:45:43 -0300 Subject: [PATCH 03/28] Deleted old reference to 2FA controller. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b0bc08..84c058e 100644 --- a/README.md +++ b/README.md @@ -398,7 +398,7 @@ You can override the view, which handles the Two Factor Code verification for th The way it works is very simple: it will hold the User credentials in a hidden input while it asks for the Two Factor Code. The User will send everything again along with the Code, the application will ensure its correct, and complete the log in. -This view and its controller is bypassed if the User doesn't uses Two Factor Authentication, making the log in transparent and non-invasive. +This view and its form is bypassed if the User doesn't uses Two Factor Authentication, making the log in transparent and non-invasive. ## Security From 3d442fd94c497a7a8e9772220376343d6eae0076 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 13:32:51 -0300 Subject: [PATCH 04/28] Reworked Github Workflow --- .editorconfig | 3 ++ .github/workflows/php.yml | 80 ++++++++++++++++++++++----------------- 2 files changed, 48 insertions(+), 35 deletions(-) diff --git a/.editorconfig b/.editorconfig index cd8eb86..c451dda 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,3 +13,6 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false + +[*.yml] +indent_size = 2 diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f42decd..5b34ade 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -3,42 +3,52 @@ name: PHP Composer on: [push] jobs: - build: + test: runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [7.4, 7.3, 7.2.15] + laravel: [7.*, 6.*] + dependency-version: [prefer-lowest, prefer-stable] + include: + - laravel: 7.* + testbench: 5.* + - laravel: 6.* + testbench: 4.* + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - - name: Checkout - uses: actions/checkout@v1 - - - name: Setup PHP - uses: shivammathur/setup-php@v1 - with: - php-version: '7.4' - extensions: mbstring, intl - coverage: xdebug - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest - - - name: Run test suite - run: composer run-script test - - - name: Upload coverage results to Coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_SERVICE_NAME: github - run: | - composer require cedx/coveralls - vendor/bin/coveralls build/logs/clover.xml + - name: Checkout + uses: actions/checkout@v1 + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache/files + key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: xdebug + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest + + - name: Run test suite + run: composer run-script test + + - name: Upload Coverage to Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_SERVICE_NAME: github + run: | + composer require cedx/coveralls + vendor/bin/coveralls build/logs/clover.xml From f690f7fd30f8f6cd2cfa8da277ceac9ce0636603 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 13:58:05 -0300 Subject: [PATCH 05/28] Updated dependencies (notably Laravel 7) --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 097c227..86a3130 100644 --- a/composer.json +++ b/composer.json @@ -23,13 +23,13 @@ "ext-json": "*", "bacon/bacon-qr-code": "2.*", "paragonie/constant_time_encoding": "2.*", - "illuminate/support": "^6.15", - "illuminate/auth": "^6.15" + "illuminate/support": "^6.15|7.*", + "illuminate/auth": "^6.15|7.*" }, "require-dev": { - "orchestra/testbench": "^4.0", - "orchestra/canvas": "^4.0", - "phpunit/phpunit": "^8.0" + "orchestra/testbench": "^5.0", + "orchestra/canvas": "^5.0", + "phpunit/phpunit": "^9.0" }, "autoload": { "psr-4": { From 7bab6b8d9640c6ff20efbf50e3055493c6c47f08 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 14:44:26 -0300 Subject: [PATCH 06/28] Fixed PHPUnit version. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 86a3130..a8d4e8d 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ } ], "require": { - "php": "^7.2", + "php": "^7.3", "ext-json": "*", "bacon/bacon-qr-code": "2.*", "paragonie/constant_time_encoding": "2.*", @@ -29,7 +29,7 @@ "require-dev": { "orchestra/testbench": "^5.0", "orchestra/canvas": "^5.0", - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "8.*|^9.0" }, "autoload": { "psr-4": { From 7fdfc474299e83af4df0e0a99355ba34e4b38fd1 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 15:37:32 -0300 Subject: [PATCH 07/28] Fixed Canvas dependency. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a8d4e8d..105ef65 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "require-dev": { "orchestra/testbench": "^5.0", - "orchestra/canvas": "^5.0", + "orchestra/canvas": "^4.0|^5.0", "phpunit/phpunit": "8.*|^9.0" }, "autoload": { From 4d63f8ae654be2b904604fb17920d042daffbb9f Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 15:40:32 -0300 Subject: [PATCH 08/28] Relaxed PHP version requirement. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 105ef65..0124753 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ } ], "require": { - "php": "^7.3", + "php": "^7.2.15", "ext-json": "*", "bacon/bacon-qr-code": "2.*", "paragonie/constant_time_encoding": "2.*", From afe868c034de56e4def4dc7068fbf67b16193846 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 15:54:25 -0300 Subject: [PATCH 09/28] Last try for dependency hell. --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 5b34ade..bf8fe2f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -50,5 +50,5 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github run: | - composer require cedx/coveralls + composer require "cedx/coveralls:v11.2.0 - v12.0.0" vendor/bin/coveralls build/logs/clover.xml From c179b993825e580ef53861d0442d5e9d4c50c951 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 16:11:45 -0300 Subject: [PATCH 10/28] Fixed call to public method inside the same class. --- src/TwoFactorAuthentication.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TwoFactorAuthentication.php b/src/TwoFactorAuthentication.php index b324456..02a0ded 100644 --- a/src/TwoFactorAuthentication.php +++ b/src/TwoFactorAuthentication.php @@ -18,7 +18,9 @@ trait TwoFactorAuthentication public function initializeTwoFactorAuthentication() { // For security, we will hide the Two Factor Authentication data from the parent model. - $this->addHidden('twoFactorAuth'); + if (! in_array('twoFactorAuth', $this->hidden, true)) { + $this->hidden[] = 'twoFactorAuth'; + } } /** From eda3dc73a9db743e6e68b52fd2ab243e7d7e2123 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 16:26:57 -0300 Subject: [PATCH 11/28] Changed Coveralls step in Github CI. --- .github/workflows/php.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index bf8fe2f..6d03c46 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -45,10 +45,7 @@ jobs: - name: Run test suite run: composer run-script test - - name: Upload Coverage to Coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_SERVICE_NAME: github - run: | - composer require "cedx/coveralls:v11.2.0 - v12.0.0" - vendor/bin/coveralls build/logs/clover.xml + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} From 413a31cb207f3b9cf540888a01787f2a4581d1f3 Mon Sep 17 00:00:00 2001 From: Victor Lap Date: Tue, 3 Mar 2020 20:45:13 +0100 Subject: [PATCH 12/28] Add testing support for more php versions and laravel versions --- .github/workflows/php.yml | 24 ++++++++++++++++++++---- composer.json | 4 ++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f42decd..d36606a 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -7,6 +7,20 @@ jobs: runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [7.4, 7.3, 7.2] + laravel: [7.*, 6.*] + dependency-version: [prefer-lowest, prefer-stable] + include: + - laravel: 7.* + testbench: 5.* + - laravel: 6.* + testbench: 4.* + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} + steps: - name: Checkout uses: actions/checkout@v1 @@ -14,7 +28,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v1 with: - php-version: '7.4' + php-version: ${{ matrix.php }} extensions: mbstring, intl coverage: xdebug @@ -26,11 +40,13 @@ jobs: uses: actions/cache@v1 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- + key: ${{ runner.os }}-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + restore-keys: ${{ runner.os }}-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer- - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-progress --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-suggest - name: Run test suite run: composer run-script test diff --git a/composer.json b/composer.json index 71ad6c5..8b68ae2 100644 --- a/composer.json +++ b/composer.json @@ -27,8 +27,8 @@ "illuminate/auth": "^6.15||^7.0" }, "require-dev": { - "orchestra/testbench": "^4.0", - "orchestra/canvas": "^4.0", + "orchestra/testbench": "^4.0||^5.0", + "orchestra/canvas": "^4.0||5.0", "phpunit/phpunit": "^8.0" }, "autoload": { From a771c9796f0003179caecceff5aea789837a963d Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 17:43:23 -0300 Subject: [PATCH 13/28] Removed redundant dependency and reverted back to Coveralls Composer package. --- .github/workflows/php.yml | 11 +++++++---- composer.json | 3 +-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 6d03c46..bf8fe2f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -45,7 +45,10 @@ jobs: - name: Run test suite run: composer run-script test - - name: Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Coverage to Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_SERVICE_NAME: github + run: | + composer require "cedx/coveralls:v11.2.0 - v12.0.0" + vendor/bin/coveralls build/logs/clover.xml diff --git a/composer.json b/composer.json index 0124753..c4e4341 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,7 @@ }, "require-dev": { "orchestra/testbench": "^5.0", - "orchestra/canvas": "^4.0|^5.0", - "phpunit/phpunit": "8.*|^9.0" + "orchestra/canvas": "^4.0|^5.0" }, "autoload": { "psr-4": { From 8fe4915833ea6d554251c173a9539693e17e0bff Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 17:48:15 -0300 Subject: [PATCH 14/28] Dependency hell. We are dropping LTS support. --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index c4e4341..f965cf4 100644 --- a/composer.json +++ b/composer.json @@ -23,12 +23,12 @@ "ext-json": "*", "bacon/bacon-qr-code": "2.*", "paragonie/constant_time_encoding": "2.*", - "illuminate/support": "^6.15|7.*", - "illuminate/auth": "^6.15|7.*" + "illuminate/support": "7.*", + "illuminate/auth": "7.*" }, "require-dev": { "orchestra/testbench": "^5.0", - "orchestra/canvas": "^4.0|^5.0" + "orchestra/canvas": "^5.0" }, "autoload": { "psr-4": { From 99d7c025300353705b09f7829b8fb9285725a123 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 17:49:56 -0300 Subject: [PATCH 15/28] Dependency hell. We are dropping LTS support #2 --- .github/workflows/php.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index bf8fe2f..5b24dcf 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -10,15 +10,13 @@ jobs: fail-fast: true matrix: php: [7.4, 7.3, 7.2.15] - laravel: [7.*, 6.*] + laravel: [7.*] dependency-version: [prefer-lowest, prefer-stable] include: - laravel: 7.* testbench: 5.* - - laravel: 6.* - testbench: 4.* - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} + name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - name: Checkout From 65d832238597cf00998aa681efd3d885c9b4eed7 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 17:57:23 -0300 Subject: [PATCH 16/28] Testing preemptively deleting installed packages. --- .github/workflows/php.yml | 9 ++++++--- composer.json | 9 +++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 5b24dcf..ac0b7cc 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -10,13 +10,15 @@ jobs: fail-fast: true matrix: php: [7.4, 7.3, 7.2.15] - laravel: [7.*] + laravel: [7.*, 6.*] dependency-version: [prefer-lowest, prefer-stable] include: - laravel: 7.* testbench: 5.* + - laravel: 6.* + testbench: 4.* - name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }} + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - name: Checkout @@ -48,5 +50,6 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github run: | - composer require "cedx/coveralls:v11.2.0 - v12.0.0" + composer remove orchestra/testbench orchestra/canvas phpunit/phpunit + composer require "cedx/coveralls:v11.2.0 - v12.0.0" --ignore-platform-reqs vendor/bin/coveralls build/logs/clover.xml diff --git a/composer.json b/composer.json index f965cf4..105ef65 100644 --- a/composer.json +++ b/composer.json @@ -19,16 +19,17 @@ } ], "require": { - "php": "^7.2.15", + "php": "^7.3", "ext-json": "*", "bacon/bacon-qr-code": "2.*", "paragonie/constant_time_encoding": "2.*", - "illuminate/support": "7.*", - "illuminate/auth": "7.*" + "illuminate/support": "^6.15|7.*", + "illuminate/auth": "^6.15|7.*" }, "require-dev": { "orchestra/testbench": "^5.0", - "orchestra/canvas": "^5.0" + "orchestra/canvas": "^4.0|^5.0", + "phpunit/phpunit": "8.*|^9.0" }, "autoload": { "psr-4": { From 57f2871b824a607246fed47291c5af58497bb889 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 17:59:31 -0300 Subject: [PATCH 17/28] Little fix to PHP version. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 105ef65..20418b5 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ } ], "require": { - "php": "^7.3", + "php": "^7.2.15", "ext-json": "*", "bacon/bacon-qr-code": "2.*", "paragonie/constant_time_encoding": "2.*", @@ -27,7 +27,7 @@ "illuminate/auth": "^6.15|7.*" }, "require-dev": { - "orchestra/testbench": "^5.0", + "orchestra/testbench": "^4.0|^5.0", "orchestra/canvas": "^4.0|^5.0", "phpunit/phpunit": "8.*|^9.0" }, From e60da82dfad890be52865e40b0080d3b39d387fe Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 18:03:21 -0300 Subject: [PATCH 18/28] Removed platform bypass. --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index ac0b7cc..54e51d9 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -51,5 +51,5 @@ jobs: COVERALLS_SERVICE_NAME: github run: | composer remove orchestra/testbench orchestra/canvas phpunit/phpunit - composer require "cedx/coveralls:v11.2.0 - v12.0.0" --ignore-platform-reqs + composer require "cedx/coveralls:v11.2.0 - v12.0.0" vendor/bin/coveralls build/logs/clover.xml From e783b54ee95e42232f92050a108a381ed3b8afe0 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 18:12:31 -0300 Subject: [PATCH 19/28] Back to old thing. Bye LTS. --- .github/workflows/php.yml | 81 +++++++++++++++++---------------------- composer.json | 9 ++--- 2 files changed, 39 insertions(+), 51 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 54e51d9..200a90e 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -3,53 +3,42 @@ name: PHP Composer on: [push] jobs: - test: + build: runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - php: [7.4, 7.3, 7.2.15] - laravel: [7.*, 6.*] - dependency-version: [prefer-lowest, prefer-stable] - include: - - laravel: 7.* - testbench: 5.* - - laravel: 6.* - testbench: 4.* - - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - - name: Checkout - uses: actions/checkout@v1 - - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ~/.composer/cache/files - key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick - coverage: xdebug - - - name: Install dependencies - run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest - - - name: Run test suite - run: composer run-script test - - - name: Upload Coverage to Coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_SERVICE_NAME: github - run: | - composer remove orchestra/testbench orchestra/canvas phpunit/phpunit - composer require "cedx/coveralls:v11.2.0 - v12.0.0" - vendor/bin/coveralls build/logs/clover.xml + - name: Checkout + uses: actions/checkout@v1 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.2.15' + extensions: mbstring, intl, pdo_sqlite + coverage: xdebug + + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Run test suite + run: composer run-script test + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Upload coverage results to Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_SERVICE_NAME: github + run: | + composer require cedx/coveralls + vendor/bin/coveralls build/logs/clover.xml diff --git a/composer.json b/composer.json index 20418b5..89b20bf 100644 --- a/composer.json +++ b/composer.json @@ -23,13 +23,12 @@ "ext-json": "*", "bacon/bacon-qr-code": "2.*", "paragonie/constant_time_encoding": "2.*", - "illuminate/support": "^6.15|7.*", - "illuminate/auth": "^6.15|7.*" + "illuminate/support": "^7", + "illuminate/auth": "^7" }, "require-dev": { - "orchestra/testbench": "^4.0|^5.0", - "orchestra/canvas": "^4.0|^5.0", - "phpunit/phpunit": "8.*|^9.0" + "orchestra/testbench": "^5.0", + "orchestra/canvas": "^5.0", }, "autoload": { "psr-4": { From c62befc1df69ab000101d04a4a782a9c9c2af678 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 18:14:24 -0300 Subject: [PATCH 20/28] Fixed trailing comma. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 89b20bf..8defe4d 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "require-dev": { "orchestra/testbench": "^5.0", - "orchestra/canvas": "^5.0", + "orchestra/canvas": "^5.0" }, "autoload": { "psr-4": { From 9f9f1f615774fc2e98865fd3d093db765be9ba18 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Tue, 3 Mar 2020 18:23:02 -0300 Subject: [PATCH 21/28] Please work. --- .github/workflows/php.yml | 81 ++++++++++++++++++++++----------------- composer-coveralls.json | 8 ++++ composer.json | 8 ++-- 3 files changed, 58 insertions(+), 39 deletions(-) create mode 100644 composer-coveralls.json diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 200a90e..0290097 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -3,42 +3,53 @@ name: PHP Composer on: [push] jobs: - build: + test: runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [7.4, 7.3, 7.2.15] + laravel: [7.*, 6.*] + dependency-version: [prefer-lowest, prefer-stable] + include: + - laravel: 7.* + testbench: 5.* + - laravel: 6.* + testbench: 4.* + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - - name: Checkout - uses: actions/checkout@v1 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.2.15' - extensions: mbstring, intl, pdo_sqlite - coverage: xdebug - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest - - - name: Run test suite - run: composer run-script test - - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Upload coverage results to Coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_SERVICE_NAME: github - run: | - composer require cedx/coveralls - vendor/bin/coveralls build/logs/clover.xml + - name: Checkout + uses: actions/checkout@v1 + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache/files + key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: xdebug + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest + + - name: Run test suite + run: composer run-script test + + - name: Upload Coverage to Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_SERVICE_NAME: github + run: | + mv -r composer-coveralls.json composer.json + composer install + vendor/bin/coveralls build/logs/clover.xml diff --git a/composer-coveralls.json b/composer-coveralls.json new file mode 100644 index 0000000..7df94f2 --- /dev/null +++ b/composer-coveralls.json @@ -0,0 +1,8 @@ +{ + "require": { + "cedx/coveralls": "*" + }, + "config": { + "vendor-dir": "vendor-coveralls" + } +} diff --git a/composer.json b/composer.json index 8defe4d..2a2f3d3 100644 --- a/composer.json +++ b/composer.json @@ -23,12 +23,12 @@ "ext-json": "*", "bacon/bacon-qr-code": "2.*", "paragonie/constant_time_encoding": "2.*", - "illuminate/support": "^7", - "illuminate/auth": "^7" + "illuminate/support": "^6.15|7.*", + "illuminate/auth": "^6.15|7.*" }, "require-dev": { - "orchestra/testbench": "^5.0", - "orchestra/canvas": "^5.0" + "orchestra/testbench": "^4.0|^5.0", + "orchestra/canvas": "^4.0|^5.0" }, "autoload": { "psr-4": { From a68bff22f7c7e5b8a65299447f9d04cad7f411a5 Mon Sep 17 00:00:00 2001 From: Italo Date: Tue, 3 Mar 2020 18:30:58 -0300 Subject: [PATCH 22/28] Fixed move command. --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 0290097..6b9a2ef 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -50,6 +50,6 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github run: | - mv -r composer-coveralls.json composer.json + mv -f composer-coveralls.json composer.json composer install vendor/bin/coveralls build/logs/clover.xml From 6a68bc253157e617822e86b4b6b6c8c8d475e0fc Mon Sep 17 00:00:00 2001 From: Victor Lap Date: Wed, 4 Mar 2020 12:02:00 +0100 Subject: [PATCH 23/28] Bump minimal php version --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index d36606a..7228ffc 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: true matrix: - php: [7.4, 7.3, 7.2] + php: [7.4, 7.3, 7.2.15] laravel: [7.*, 6.*] dependency-version: [prefer-lowest, prefer-stable] include: From 506b82f441b50f45ffcd9aa201b0d6e09b0fb2f9 Mon Sep 17 00:00:00 2001 From: Victor Lap Date: Wed, 4 Mar 2020 12:06:09 +0100 Subject: [PATCH 24/28] Change addHidden > makeHidden to support L7 --- src/TwoFactorAuthentication.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TwoFactorAuthentication.php b/src/TwoFactorAuthentication.php index b324456..badfbe5 100644 --- a/src/TwoFactorAuthentication.php +++ b/src/TwoFactorAuthentication.php @@ -18,7 +18,7 @@ trait TwoFactorAuthentication public function initializeTwoFactorAuthentication() { // For security, we will hide the Two Factor Authentication data from the parent model. - $this->addHidden('twoFactorAuth'); + $this->makeHidden('twoFactorAuth'); } /** From 01fe7fe6e8f320a64d864ffbec2d52137eb254cc Mon Sep 17 00:00:00 2001 From: Victor Lap Date: Wed, 4 Mar 2020 12:27:46 +0100 Subject: [PATCH 25/28] Remove composer deps before running coveralls --- .github/workflows/php.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 7228ffc..43ffc69 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -56,5 +56,6 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github run: | + rm -rf composer.* vendor/ composer require cedx/coveralls vendor/bin/coveralls build/logs/clover.xml From f7d780ff0cee3f52efe58316a2834c51489c0d04 Mon Sep 17 00:00:00 2001 From: Victor Lap Date: Wed, 4 Mar 2020 12:31:56 +0100 Subject: [PATCH 26/28] Enable test on PR --- .github/workflows/php.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 43ffc69..47d84b5 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,6 +1,8 @@ name: PHP Composer -on: [push] +on: + push: + pull_request: jobs: build: From d47b7da69c8e957cc3a4e7e2ce5998246bfcc56e Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Wed, 4 Mar 2020 12:02:43 -0300 Subject: [PATCH 27/28] Moved coveralls composer to workflow directory. --- .../workflows/composer-coveralls.json | 0 .github/workflows/php.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename composer-coveralls.json => .github/workflows/composer-coveralls.json (100%) diff --git a/composer-coveralls.json b/.github/workflows/composer-coveralls.json similarity index 100% rename from composer-coveralls.json rename to .github/workflows/composer-coveralls.json diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 0290097..8e8439a 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -50,6 +50,6 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github run: | - mv -r composer-coveralls.json composer.json + mv -f .github/workflows/composer-coveralls.json composer.json composer install vendor/bin/coveralls build/logs/clover.xml From 97c98aec8d5161279cd276d486b9b3d8aa989fd3 Mon Sep 17 00:00:00 2001 From: Italo Date: Wed, 4 Mar 2020 12:10:26 -0300 Subject: [PATCH 28/28] Fixed duplicate keys. --- .github/workflows/php.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index ee1f7b3..ed4703f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -22,20 +22,6 @@ jobs: name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - strategy: - fail-fast: true - matrix: - php: [7.4, 7.3, 7.2.15] - laravel: [7.*, 6.*] - dependency-version: [prefer-lowest, prefer-stable] - include: - - laravel: 7.* - testbench: 5.* - - laravel: 6.* - testbench: 4.* - - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - steps: - name: Checkout uses: actions/checkout@v1 @@ -73,4 +59,4 @@ jobs: run: | rm -rf composer.* vendor/ composer require cedx/coveralls - vendor/bin/coveralls build/logs/clover.xml \ No newline at end of file + vendor/bin/coveralls build/logs/clover.xml