Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 61c522f

Browse files
committed
Upgrade to Laravel 5.8
1 parent 926b21a commit 61c522f

17 files changed

+79
-96
lines changed

composer.json

Lines changed: 56 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,64 @@
11
{
2-
"name": "colq2/laravel-keycloak",
3-
"description": "A keycloak adapter for laravel.",
4-
"keywords": ["laravel", "keycloak", "jwt", "auth", "oidc"],
5-
"type": "library",
6-
"license": "BSD-2-Clause",
7-
"authors": [
8-
{
9-
"name": "Oliver Wycisk",
10-
"email": "development@o-wycisk.de"
11-
}
12-
],
2+
"name": "colq2/laravel-keycloak",
3+
"description": "A keycloak adapter for laravel.",
4+
"keywords": [
5+
"laravel",
6+
"keycloak",
7+
"jwt",
8+
"auth",
9+
"oidc"
10+
],
11+
"type": "library",
12+
"license": "BSD-2-Clause",
13+
"authors": [
14+
{
15+
"name": "Oliver Wycisk",
16+
"email": "development@o-wycisk.de"
17+
}
18+
],
1319
"repositories": [
1420
{
1521
"type": "vcs",
1622
"url": "https://github.com/colq2/oauth2-keycloak"
1723
}
1824
],
19-
"require": {
20-
"php": "^7.1",
21-
"illuminate/auth": "^5.7",
22-
"illuminate/cache": "^5.7",
23-
"illuminate/contracts": "5.7.*",
24-
"illuminate/session": "^5.7",
25-
"illuminate/support": "^5.7",
26-
"stevenmaguire/oauth2-keycloak": "dev-master",
27-
"lcobucci/jwt": "^3.2",
28-
"ext-json": "*"
29-
},
30-
"require-dev": {
31-
"orchestra/testbench": "~3.7",
32-
"orchestra/testbench-dusk": "^3.7",
33-
"phpunit/phpunit": "^7.0"
34-
},
35-
"autoload": {
36-
"psr-4": {
37-
"colq2\\Keycloak\\": "src/"
38-
}
39-
},
40-
"autoload-dev": {
41-
"psr-4": {
42-
"colq2\\Tests\\Keycloak\\": "tests/"
43-
}
44-
},
45-
"extra": {
46-
"laravel": {
47-
"providers": [
48-
"colq2\\Keycloak\\KeycloakServiceProvider"
49-
],
50-
"aliases": {
51-
"Debugbar": "Barryvdh\\Debugbar\\Facade"
52-
}
53-
}
54-
},
55-
"minimum-stability": "dev",
56-
"prefer-stable": true
25+
"require": {
26+
"php": "^7.1",
27+
"illuminate/auth": "^5.8",
28+
"illuminate/cache": "^5.8",
29+
"illuminate/contracts": "5.8",
30+
set
31+
"illuminate/session": "^5.8",
32+
"illuminate/support": "^5.8",
33+
"stevenmaguire/oauth2-keycloak": "dev-master",
34+
"lcobucci/jwt": "^3.2",
35+
"ext-json": "*"
36+
},
37+
"require-dev": {
38+
"orchestra/testbench": "~3.7",
39+
"orchestra/testbench-dusk": "^3.7",
40+
"phpunit/phpunit": "^7.0"
41+
},
42+
"autoload": {
43+
"psr-4": {
44+
"colq2\\Keycloak\\": "src/"
45+
}
46+
},
47+
"autoload-dev": {
48+
"psr-4": {
49+
"colq2\\Tests\\Keycloak\\": "tests/"
50+
}
51+
},
52+
"extra": {
53+
"laravel": {
54+
"providers": [
55+
"colq2\\Keycloak\\KeycloakServiceProvider"
56+
],
57+
"aliases": {
58+
"Debugbar": "Barryvdh\\Debugbar\\Facade"
59+
}
60+
}
61+
},
62+
"minimum-stability": "dev",
63+
"prefer-stable": true
5764
}

src/KeycloakRealmKeyFetcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function retrieveFromCache()
6464
protected function putToCache(string $publicKey)
6565
{
6666
try {
67-
cache()->put(self::PUBLIC_KEY_CACHE_NAME, $publicKey, 60 * 4);
67+
cache()->put(self::PUBLIC_KEY_CACHE_NAME, $publicKey, 60 * 60 * 4);
6868
} catch (\Exception $e) {
6969
return;
7070
}

src/OnlineRealmKeyFetcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function retrieveFromCache()
6565
protected function putToCache(string $publicKey)
6666
{
6767
try {
68-
cache()->put(self::PUBLIC_KEY_CACHE_NAME, $publicKey, 60 * 4);
68+
cache()->put(self::PUBLIC_KEY_CACHE_NAME, $publicKey, 60 * 60 * 4);
6969
} catch (\Exception $e) {
7070
return;
7171
}

tests/Integration/AuthenticatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class AuthenticatorTest extends TestCase
3333
*/
3434
private $tokenStorage;
3535

36-
protected function setUp()
36+
protected function setUp(): void
3737
{
3838
parent::setUp();
3939

@@ -43,7 +43,7 @@ protected function setUp()
4343
}
4444

4545

46-
protected function tearDown()
46+
protected function tearDown(): void
4747
{
4848
parent::tearDown();
4949

tests/Integration/KeycloakGatewayTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class KeycloakGatewayTest extends TestCase
2222
private $authenticator;
2323

2424

25-
protected function setUp()
25+
protected function setUp(): void
2626
{
2727
parent::setUp();
2828

tests/Integration/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class TestCase extends BaseTestCase
88
{
9-
protected function setUp()
9+
protected function setUp(): void
1010
{
1111
parent::setUp();
1212

tests/TestCase.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
use colq2\Tests\Keycloak\Stubs\KeycloakUser;
99
use colq2\Tests\Keycloak\Traits\FakeGateway;
1010
use Dotenv\Dotenv;
11+
use Dotenv\Environment\Adapter\EnvConstAdapter;
12+
use Dotenv\Environment\Adapter\ServerConstAdapter;
13+
use Dotenv\Environment\DotenvFactory;
1114
use Illuminate\Support\Arr;
1215
use Lcobucci\JWT\Builder;
1316

1417
class TestCase extends \Orchestra\Testbench\Dusk\TestCase
1518
{
16-
protected function setUp()
19+
protected function setUp(): void
1720
{
1821
parent::setUp();
1922

@@ -42,9 +45,11 @@ protected function getPackageProviders($app)
4245
*/
4346
protected function getEnvironmentSetUp($app)
4447
{
45-
$dotenv = new Dotenv(__DIR__.'/..');
48+
$factory = new DotenvFactory([new EnvConstAdapter(), new ServerConstAdapter()]);
4649

50+
$dotenv = Dotenv::create(__DIR__ . '/..', null, $factory);
4751
$dotenv->load();
52+
4853
// Setup default database to use sqlite :memory:
4954
$app['config']->set('database.default', 'testbench');
5055
$app['config']->set('database.connections.testbench', [

tests/Unit/AuthenticatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ class AuthenticatorTest extends TestCase
1616
*/
1717
private $authenticator;
1818

19-
protected function setUp()
19+
protected function setUp(): void
2020
{
2121
parent::setUp();
2222

2323
$this->authenticator = $this->app->make(Authenticator::class);
2424
}
2525

26-
protected function tearDown()
26+
protected function tearDown(): void
2727
{
2828
Mockery::close();
2929
parent::tearDown();

tests/Unit/ConfigKeyFetcherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ConfigKeyFetcherTest extends TestCase
1414
*/
1515
private $fetcher;
1616

17-
protected function setUp()
17+
protected function setUp(): void
1818
{
1919
parent::setUp();
2020

tests/Unit/KeycloakProviderTest.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

tests/Unit/MiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class MiddlewareTest extends TestCase
3030
*/
3131
private $user;
3232

33-
protected function setUp()
33+
protected function setUp(): void
3434
{
3535
parent::setUp();
3636

tests/Unit/OnlineKeyFetcherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class OnlineKeyFetcherTest extends TestCase
1616
*/
1717
private $fetcher;
1818

19-
protected function setUp()
19+
protected function setUp(): void
2020
{
2121
parent::setUp();
2222

tests/Unit/RealmKeyFetcherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class RealmKeyFetcherTest extends TestCase
1616
*/
1717
private $fetcher;
1818

19-
protected function setUp()
19+
protected function setUp(): void
2020
{
2121
parent::setUp();
2222

tests/Unit/RoleCheckerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class RoleCheckerTest extends TestCase
1515
protected $roleChecker;
1616

1717

18-
protected function setUp()
18+
protected function setUp(): void
1919
{
2020
parent::setUp();
2121

tests/Unit/SessionTokenStorageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class SessionTokenStorageTest extends TokenStorageTestCase
1616
/**
1717
* setup environment
1818
*/
19-
protected function setUp()
19+
protected function setUp(): void
2020
{
2121
parent::setUp();
2222

tests/Unit/TokenCheckerTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use colq2\Tests\Keycloak\TestCase;
1010
use colq2\Tests\Keycloak\Traits\FakeGateway;
1111
use Lcobucci\JWT\Token;
12-
use Mockery\Generator\StringManipulation\Pass\RemoveBuiltinMethodsThatAreFinalPass;
1312

1413
class TokenCheckerTest extends TestCase
1514
{
@@ -46,7 +45,7 @@ class TokenCheckerTest extends TestCase
4645
/**
4746
* Set up Tests
4847
*/
49-
protected function setUp()
48+
protected function setUp(): void
5049
{
5150
parent::setUp();
5251

tests/Unit/TokenStorageTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ abstract class TokenStorageTestCase extends TestCase
2222
*/
2323
protected $token;
2424

25-
protected function setUp()
25+
protected function setUp(): void
2626
{
2727
parent::setUp();
2828

0 commit comments

Comments
 (0)