Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
gh-actions:
patterns: ['actions/*']
docker:
patterns: ['docker/*']
codecov:
patterns: ['codecov/*']
34 changes: 20 additions & 14 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ on:

jobs:
cs:
uses: bedita/github-workflows/.github/workflows/php-cs.yml@v1
uses: bedita/github-workflows/.github/workflows/php-cs.yml@v2
with:
php_versions: '["8.2"]'
php_versions: '["8.3"]'

stan:
uses: bedita/github-workflows/.github/workflows/php-stan.yml@v1
uses: bedita/github-workflows/.github/workflows/php-stan.yml@v2
with:
php_versions: '["8.2"]'
php_versions: '["8.3"]'

unit:
name: 'Run unit tests'
Expand All @@ -32,10 +32,8 @@ jobs:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'

env:
PHP_VERSION: '${{ matrix.php }}'
Expand Down Expand Up @@ -72,19 +70,27 @@ jobs:
run: 'composer dump-autoload --classmap-authoritative --no-cache'

- name: 'Run PHPUnit'
run: 'vendor/bin/phpunit --coverage-clover=clover.xml'
run: 'vendor/bin/phpunit --coverage-clover=${{ matrix.php-version }}-${{ strategy.job-index }}-clover.xml'

- name: Check test coverage
id: test-coverage
uses: johanvanhelden/gha-clover-test-coverage-check@v1
with:
percentage: '85'
filename: '${{ matrix.php-version }}-${{ strategy.job-index }}-clover.xml'

- name: 'Export coverage results'
uses: 'codecov/codecov-action@v1'
uses: 'codecov/codecov-action@v4'
with:
file: './clover.xml'
token: ${{ secrets.CODECOV_TOKEN }} # required
files: './${{ matrix.php-version }}-${{ strategy.job-index }}-clover.xml'
env_vars: PHP_VERSION

- name: 'Archive code coverage results'
uses: 'actions/upload-artifact@v2'
uses: 'actions/upload-artifact@v4'
with:
name: 'PHP ${{ matrix.php }}'
path: 'clover.xml'
name: 'PHP-${{ matrix.php-version }}-strategy-job-index-${{ strategy.job-index }}'
path: '${{ matrix.php-version }}-${{ strategy.job-index }}-clover.xml'

unit-lowest:
name: 'Run unit tests with lowest-matching dependencies versions'
Expand All @@ -98,7 +104,7 @@ jobs:
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '7.4'
php-version: '8.2'
tools: 'composer'
extensions: 'mbstring, intl'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
release-job:
uses: bedita/github-workflows/.github/workflows/release.yml@v1
uses: bedita/github-workflows/.github/workflows/release.yml@v2
with:
main_branch: 'master'
dist_branches: '["master"]'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AWS integrations plugin for BEdita 4
![GitHub Workflow](https://github.com/bedita/aws/actions/workflows/test.yml/badge.svg)
![GitHub Workflow](https://github.com/bedita/aws/actions/workflows/php.yml/badge.svg)
[![Codecov coverage](https://codecov.io/gh/bedita/aws/branch/master/graph/badge.svg)](https://codecov.io/gh/bedita/aws)

This plugin includes a few useful integrations for BEdita 4, such as:
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
"description": "BEdita 5 plugin for applications that use AWS resources such as S3",
"type": "cakephp-plugin",
"require": {
"php": "^7.4 || ^8.0",
"php": ">=8.2",
"ext-openssl": "*",
"aws/aws-sdk-php": "^3.222",
"bedita/core": "^5.0.0",
"cakephp/cakephp": "^4.4.1",
"bedita/core": "^5.29",
"cakephp/cakephp": "^4.5.0",
"lcobucci/jwt": "^4.2.1",
"league/flysystem": "^2.4.3",
"league/flysystem-aws-s3-v3": "^2.4.3",
"guzzlehttp/guzzle": "^7.4"
},
"require-dev": {
"cakephp/cakephp-codesniffer": "~4.5.1",
"cakephp/cakephp-codesniffer": "~4.7.0",
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "~1.8.2",
"phpstan/phpstan": "~1.9.14",
"cakephp/authentication": "^2.9",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-phpunit": "^1.1"
Expand Down
30 changes: 15 additions & 15 deletions tests/TestCase/Authenticator/AlbAuthenticatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function testAuthenticate(): void
$token = (new Builder(new JoseEncoder(), ChainedFormatter::default()))
->issuedAt(FrozenTime::now())
->canOnlyBeUsedAfter(FrozenTime::now())
->expiresAt(FrozenTime::now()->addMinute())
->expiresAt(FrozenTime::now()->addMinutes(1))
->withHeader('kid', $this->keyId)
->relatedTo('[email protected]')
->getToken(Sha256::create(), $this->privateKey)
Expand Down Expand Up @@ -288,9 +288,9 @@ public function testAuthenticateMissingKid(): void
);

$token = (new Builder(new JoseEncoder(), ChainedFormatter::default()))
->issuedAt(FrozenTime::now()->subDay())
->canOnlyBeUsedAfter(FrozenTime::now()->subDay())
->expiresAt(FrozenTime::now()->subDay()->addMinute())
->issuedAt(FrozenTime::now()->subDays(1))
->canOnlyBeUsedAfter(FrozenTime::now()->subDays(1))
->expiresAt(FrozenTime::now()->subDays(1)->addMinutes(1))
->relatedTo('[email protected]')
->getToken(Sha256::create(), $this->privateKey)
->toString();
Expand Down Expand Up @@ -329,9 +329,9 @@ public function testAuthenticateKeyNotFound(): void
);

$token = (new Builder(new JoseEncoder(), ChainedFormatter::default()))
->issuedAt(FrozenTime::now()->subDay())
->canOnlyBeUsedAfter(FrozenTime::now()->subDay())
->expiresAt(FrozenTime::now()->subDay()->addMinute())
->issuedAt(FrozenTime::now()->subDays(1))
->canOnlyBeUsedAfter(FrozenTime::now()->subDays(1))
->expiresAt(FrozenTime::now()->subDays(1)->addMinutes(1))
->withHeader('kid', $this->keyId)
->relatedTo('[email protected]')
->getToken(Sha256::create(), $this->privateKey)
Expand Down Expand Up @@ -372,9 +372,9 @@ public function testAuthenticateExpiredToken(): void
);

$token = (new Builder(new JoseEncoder(), ChainedFormatter::default()))
->issuedAt(FrozenTime::now()->subDay())
->canOnlyBeUsedAfter(FrozenTime::now()->subDay())
->expiresAt(FrozenTime::now()->subDay()->addMinute())
->issuedAt(FrozenTime::now()->subDays(1))
->canOnlyBeUsedAfter(FrozenTime::now()->subDays(1))
->expiresAt(FrozenTime::now()->subDays(1)->addMinutes(1))
->withHeader('kid', $this->keyId)
->relatedTo('[email protected]')
->getToken(Sha256::create(), $this->privateKey)
Expand Down Expand Up @@ -420,7 +420,7 @@ public function testAuthenticateInvalidSignature(): void
$token = (new Builder(new JoseEncoder(), ChainedFormatter::default()))
->issuedAt(FrozenTime::now())
->canOnlyBeUsedAfter(FrozenTime::now())
->expiresAt(FrozenTime::now()->addMinute())
->expiresAt(FrozenTime::now()->addMinutes(1))
->withHeader('kid', $this->keyId)
->relatedTo('[email protected]')
->getToken(Sha256::create(), $privateKey)
Expand Down Expand Up @@ -461,7 +461,7 @@ public function testAuthenticateInvalidAlgorithm(): void
$token = (new Builder(new JoseEncoder(), ChainedFormatter::default()))
->issuedAt(FrozenTime::now())
->canOnlyBeUsedAfter(FrozenTime::now())
->expiresAt(FrozenTime::now()->addMinute())
->expiresAt(FrozenTime::now()->addMinutes(1))
->withHeader('kid', $this->keyId)
->relatedTo('[email protected]')
->getToken(new None(), InMemory::plainText('key'))
Expand Down Expand Up @@ -502,7 +502,7 @@ public function testAuthenticateMissingSub(): void
$token = (new Builder(new JoseEncoder(), ChainedFormatter::default()))
->issuedAt(FrozenTime::now())
->canOnlyBeUsedAfter(FrozenTime::now())
->expiresAt(FrozenTime::now()->addMinute())
->expiresAt(FrozenTime::now()->addMinutes(1))
->withHeader('kid', $this->keyId)
->getToken(Sha256::create(), $this->privateKey)
->toString();
Expand Down Expand Up @@ -550,7 +550,7 @@ public function testAuthenticateIdentify(): void
$token = (new Builder(new JoseEncoder(), ChainedFormatter::default()))
->issuedAt(FrozenTime::now())
->canOnlyBeUsedAfter(FrozenTime::now())
->expiresAt(FrozenTime::now()->addMinute())
->expiresAt(FrozenTime::now()->addMinutes(1))
->withHeader('kid', $this->keyId)
->relatedTo('[email protected]')
->getToken(Sha256::create(), $this->privateKey)
Expand Down Expand Up @@ -606,7 +606,7 @@ public function testAuthenticateIdentifyFailure(): void
$token = (new Builder(new JoseEncoder(), ChainedFormatter::default()))
->issuedAt(FrozenTime::now())
->canOnlyBeUsedAfter(FrozenTime::now())
->expiresAt(FrozenTime::now()->addMinute())
->expiresAt(FrozenTime::now()->addMinutes(1))
->withHeader('kid', $this->keyId)
->relatedTo('[email protected]')
->getToken(Sha256::create(), $this->privateKey)
Expand Down