Skip to content

Commit

Permalink
Allow lcobucci/jwt v5
Browse files Browse the repository at this point in the history
Psalm auto target php version 8 (inferred from composer.json)
  • Loading branch information
maxhelias authored and scheb committed Apr 1, 2023
1 parent 533a0c3 commit 779aff1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
php-version:
- '8.1'
- '8.0'

steps:
- name: 'Checkout code'
Expand Down
2 changes: 1 addition & 1 deletion app/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"egulias/email-validator": "^3.0",
"endroid/qr-code": "^4.0",
"lcobucci/clock": "^2.0 || ^3.0",
"lcobucci/jwt": "^4.1",
"lcobucci/jwt": "^4.1 || ^5.0",
"paragonie/constant_time_encoding": "^2.4",
"spomky-labs/otphp": "^10.0 || ^11.0",
"symfony/dotenv": "^5.4 || ^6.0",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"ext-json": "*",
"lcobucci/clock": "^2.0 || ^3.0",
"lcobucci/jwt": "^4.1",
"lcobucci/jwt": "^4.1 || ^5.0",
"paragonie/constant_time_encoding": "^2.4",
"spomky-labs/otphp": "^10.0 || ^11.0",
"symfony/config": "^5.4 || ^6.0",
Expand Down
2 changes: 1 addition & 1 deletion src/trusted-device/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"scheb/2fa-bundle": "self.version",
"lcobucci/clock": "^2.0 || ^3.0",
"lcobucci/jwt": "^4.1"
"lcobucci/jwt": "^4.1 || ^5.0"
},
"autoload": {
"psr-4": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function generateToken_parametersGiven_returnTrustedDeviceToken(): void
->expects($this->once())
->method('generateToken')
->with('username', 'firewallName', 1, new DateTime('2018-01-01 01:00:00'))
->willReturn(new Plain(new DataSet([], ''), new DataSet([], ''), Signature::fromEmptyData()));
->willReturn(new Plain(new DataSet([], ''), new DataSet([], ''), new Signature('', '')));

$token = $this->tokenEncoder->generateToken('username', 'firewallName', 1);
$this->assertInstanceOf(TrustedDeviceToken::class, $token);
Expand All @@ -49,7 +49,7 @@ public function decodeToken_validToken_returnDecodedTrustedDeviceToken(): void
$this->jwtEncoder
->expects($this->once())
->method('decodeToken')
->willReturn(new Plain(new DataSet([], ''), new DataSet([], ''), Signature::fromEmptyData()));
->willReturn(new Plain(new DataSet([], ''), new DataSet([], ''), new Signature('', '')));

$returnValue = $this->tokenEncoder->decodeToken('validToken');
$this->assertInstanceOf(TrustedDeviceToken::class, $returnValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function setUp(): void
JwtTokenEncoder::CLAIM_FIREWALL => 'firewallName',
JwtTokenEncoder::CLAIM_VERSION => 1,
], 'encodedClaims');
$jwtToken = new Plain(new DataSet([], 'encodedHeaders'), $claims, Signature::fromEmptyData());
$jwtToken = new Plain(new DataSet([], 'encodedHeaders'), $claims, new Signature('', ''));
$this->trustedToken = new TrustedDeviceToken($jwtToken);
}

Expand Down

0 comments on commit 779aff1

Please sign in to comment.