Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparing sf5 compatibility #230

Merged
merged 2 commits into from Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 11 additions & 12 deletions composer.json
Expand Up @@ -61,11 +61,11 @@
"psr/http-client": "^1.0",
"spomky-labs/aes-key-wrap": "^5.0",
"spomky-labs/base64url": "^2.0",
"symfony/config": "^4.2",
"symfony/console": "^4.2",
"symfony/dependency-injection": "^4.2",
"symfony/framework-bundle": "^4.2",
"symfony/http-kernel": "^4.2"
"symfony/config": "^4.2|^5.0",
"symfony/console": "^4.2|^5.0",
"symfony/dependency-injection": "^4.2|^5.0",
"symfony/framework-bundle": "^4.2|^5.0",
"symfony/http-kernel": "^4.2|^5.0"
},
"require-dev": {
"ext-curl": "*",
Expand All @@ -74,7 +74,6 @@
"bjeavons/zxcvbn-php": "^0.4.0",
"blackfire/php-sdk": "^1.14",
"nyholm/psr7": "^1.0",
"infection/infection": "^0.13",
"matthiasnoback/symfony-config-test": "^3.1|^4.0",
"php-coveralls/php-coveralls": "^2.0",
"php-http/httplug-bundle": "^1.7",
Expand All @@ -84,12 +83,12 @@
"phpstan/phpstan-phpunit": "^0.11",
"phpstan/phpstan-strict-rules": "^0.11",
"phpunit/phpunit": "^8.0",
"symfony/browser-kit": "^4.2",
"symfony/event-dispatcher": "^4.2",
"symfony/finder": "^4.2",
"symfony/phpunit-bridge": "^4.2",
"symfony/serializer": "^4.2",
"symfony/var-dumper": "^4.2"
"symfony/browser-kit": "^4.2|^5.0",
"symfony/event-dispatcher": "^4.2|^5.0",
"symfony/finder": "^4.2|^5.0",
"symfony/phpunit-bridge": "^4.2|^5.0",
"symfony/serializer": "^4.2|^5.0",
"symfony/var-dumper": "^4.2|^5.0"
},
"replace": {
"web-token/jwt-core": "self.version",
Expand Down
Expand Up @@ -37,6 +37,7 @@ protected function setUp(): void
*/
public function theClaimCheckerManagerFactoryIsAvailable()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertNotNull($container);
Expand All @@ -48,6 +49,7 @@ public function theClaimCheckerManagerFactoryIsAvailable()
*/
public function theClaimCheckerManagerFactoryCanCreateAClaimCheckerManager()
{
static::ensureKernelShutdown();
$client = static::createClient();
/** @var ClaimCheckerManagerFactory $claimCheckerManagerFactory */
$claimCheckerManagerFactory = $client->getContainer()->get(\Jose\Bundle\JoseFramework\Services\ClaimCheckerManagerFactory::class);
Expand All @@ -63,6 +65,7 @@ public function theClaimCheckerManagerFactoryCanCreateAClaimCheckerManager()
*/
public function aClaimCheckerCanBeDefinedUsingTheConfigurationFile()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertTrue($container->has('jose.claim_checker.checker1'));
Expand All @@ -76,6 +79,7 @@ public function aClaimCheckerCanBeDefinedUsingTheConfigurationFile()
*/
public function aClaimCheckerCanBeDefinedFromAnotherBundleUsingTheHelper()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertTrue($container->has('jose.claim_checker.checker2'));
Expand Down
Expand Up @@ -37,6 +37,7 @@ protected function setUp(): void
*/
public function theHeaderCheckerManagerFactoryIsAvailable()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertNotNull($container);
Expand All @@ -48,6 +49,7 @@ public function theHeaderCheckerManagerFactoryIsAvailable()
*/
public function theHeaderCheckerManagerFactoryCanCreateAHeaderCheckerManager()
{
static::ensureKernelShutdown();
$client = static::createClient();
/** @var HeaderCheckerManagerFactory $headerCheckerManagerFactory */
$headerCheckerManagerFactory = $client->getContainer()->get(\Jose\Bundle\JoseFramework\Services\HeaderCheckerManagerFactory::class);
Expand All @@ -63,6 +65,7 @@ public function theHeaderCheckerManagerFactoryCanCreateAHeaderCheckerManager()
*/
public function aHeaderCheckerCanBeDefinedUsingTheConfigurationFile()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertTrue($container->has('jose.header_checker.checker1'));
Expand All @@ -76,6 +79,7 @@ public function aHeaderCheckerCanBeDefinedUsingTheConfigurationFile()
*/
public function aHeaderCheckerCanBeDefinedFromAnotherBundleUsingTheHelper()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertTrue($container->has('jose.header_checker.checker2'));
Expand Down
Expand Up @@ -37,6 +37,7 @@ protected function setUp(): void
*/
public function theJWEBuilderFactoryIsAvailable()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertNotNull($container);
Expand All @@ -48,6 +49,7 @@ public function theJWEBuilderFactoryIsAvailable()
*/
public function theJWEBuilderFactoryCanCreateAJWEBuilder()
{
static::ensureKernelShutdown();
$client = static::createClient();

/** @var JWEBuilderFactory $jweFactory */
Expand All @@ -63,6 +65,7 @@ public function theJWEBuilderFactoryCanCreateAJWEBuilder()
*/
public function aJWEBuilderCanBeDefinedUsingTheConfigurationFile()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertTrue($container->has('jose.jwe_builder.builder1'));
Expand All @@ -76,6 +79,7 @@ public function aJWEBuilderCanBeDefinedUsingTheConfigurationFile()
*/
public function aJWEBuilderCanBeDefinedFromAnotherBundleUsingTheHelper()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertTrue($container->has('jose.jwe_builder.builder2'));
Expand Down
Expand Up @@ -40,6 +40,7 @@ protected function setUp(): void
*/
public function iCanCreateAndLoadAToken()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();

Expand Down
Expand Up @@ -38,6 +38,7 @@ protected function setUp(): void
*/
public function theJWEDecrypterFactoryIsAvailable()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertNotNull($container);
Expand All @@ -49,6 +50,7 @@ public function theJWEDecrypterFactoryIsAvailable()
*/
public function theWEDecrypterFactoryCanCreateAJWEDecrypter()
{
static::ensureKernelShutdown();
$client = static::createClient();

/** @var JWEDecrypterFactory $jweFactory */
Expand All @@ -64,6 +66,7 @@ public function theWEDecrypterFactoryCanCreateAJWEDecrypter()
*/
public function aJWEDecrypterCanBeDefinedUsingTheConfigurationFile()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertTrue($container->has('jose.jwe_decrypter.loader1'));
Expand All @@ -77,6 +80,7 @@ public function aJWEDecrypterCanBeDefinedUsingTheConfigurationFile()
*/
public function aJWEDecrypterCanBeDefinedFromAnotherBundleUsingTheHelper()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertTrue($container->has('jose.jwe_decrypter.loader2'));
Expand Down
Expand Up @@ -39,6 +39,7 @@ protected function setUp(): void
*/
public function theJWELoaderFactoryIsAvailable()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertNotNull($container);
Expand All @@ -50,6 +51,7 @@ public function theJWELoaderFactoryIsAvailable()
*/
public function theWELoaderFactoryCanCreateAJWELoader()
{
static::ensureKernelShutdown();
$client = static::createClient();

/** @var JWELoaderFactory $jweLoaderFactory */
Expand All @@ -69,6 +71,7 @@ public function theWELoaderFactoryCanCreateAJWELoader()
*/
public function aJWELoaderCanBeDefinedUsingTheConfigurationFile()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertTrue($container->has('jose.jwe_loader.jwe_loader1'));
Expand All @@ -82,6 +85,7 @@ public function aJWELoaderCanBeDefinedUsingTheConfigurationFile()
*/
public function aJWELoaderCanBeDefinedFromAnotherBundleUsingTheHelper()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertTrue($container->has('jose.jwe_loader.jwe_loader2'));
Expand Down
Expand Up @@ -37,6 +37,7 @@ protected function setUp(): void
*/
public function jWESerializerManagerFromConfigurationIsAvailable()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertTrue($container->has('jose.jwe_serializer.jwe_serializer1'));
Expand All @@ -50,6 +51,7 @@ public function jWESerializerManagerFromConfigurationIsAvailable()
*/
public function jWESerializerManagerFromExternalBundleExtensionIsAvailable()
{
static::ensureKernelShutdown();
$client = static::createClient();
$container = $client->getContainer();
static::assertTrue($container->has('jose.jwe_serializer.jwe_serializer2'));
Expand Down
Expand Up @@ -38,6 +38,7 @@ protected function setUp(): void
*/
public function theJKUFactoryServiceIsAvailable()
{
static::ensureKernelShutdown();
$client = static::createClient();

$container = $client->getContainer();
Expand All @@ -49,6 +50,7 @@ public function theJKUFactoryServiceIsAvailable()
*/
public function theX5UFactoryServiceIsAvailable()
{
static::ensureKernelShutdown();
$client = static::createClient();

$container = $client->getContainer();
Expand Down
Expand Up @@ -39,6 +39,7 @@ protected function setUp(): void
*/
public function aJWKCanBeDefinedInTheConfiguration()
{
static::ensureKernelShutdown();
$client = static::createClient();

$container = $client->getContainer();
Expand All @@ -51,6 +52,7 @@ public function aJWKCanBeDefinedInTheConfiguration()
*/
public function aJWKCanBeDefinedFromAnotherBundle()
{
static::ensureKernelShutdown();
$client = static::createClient();

$container = $client->getContainer();
Expand All @@ -63,6 +65,7 @@ public function aJWKCanBeDefinedFromAnotherBundle()
*/
public function aX509InFileCanBeDefinedInTheConfiguration()
{
static::ensureKernelShutdown();
$client = static::createClient();

$container = $client->getContainer();
Expand All @@ -75,6 +78,7 @@ public function aX509InFileCanBeDefinedInTheConfiguration()
*/
public function aDirectX509InputCanBeDefinedInTheConfiguration()
{
static::ensureKernelShutdown();
$client = static::createClient();

$container = $client->getContainer();
Expand All @@ -87,6 +91,7 @@ public function aDirectX509InputCanBeDefinedInTheConfiguration()
*/
public function anEncryptedKeyFileCanBeLoadedInTheConfiguration()
{
static::ensureKernelShutdown();
$client = static::createClient();

$container = $client->getContainer();
Expand All @@ -99,6 +104,7 @@ public function anEncryptedKeyFileCanBeLoadedInTheConfiguration()
*/
public function aJWKCanBeLoadedFromAJwkSetInTheConfiguration()
{
static::ensureKernelShutdown();
$client = static::createClient();

$container = $client->getContainer();
Expand All @@ -111,6 +117,7 @@ public function aJWKCanBeLoadedFromAJwkSetInTheConfiguration()
*/
public function aJWKCanBeLoadedFromASecretInTheConfiguration()
{
static::ensureKernelShutdown();
$client = static::createClient();

$container = $client->getContainer();
Expand Down
Expand Up @@ -33,24 +33,20 @@ class JWKSetLoaderTest extends WebTestCase
*/
private $messageFactory;

public function __construct($name = null, array $data = [], $dataName = '')
{
parent::__construct($name, $data, $dataName);
$this->messageFactory = new Psr17Factory();
}

protected function setUp(): void
{
if (!class_exists(JWKFactory::class)) {
static::markTestSkipped('The component "web-token/jwt-key-mgmt" is not installed.');
}
$this->messageFactory = new Psr17Factory();
}

/**
* @test
*/
public function aJWKSetCanBeDefinedInTheConfiguration()
{
static::ensureKernelShutdown();
$client = static::createClient();

$container = $client->getContainer();
Expand All @@ -63,6 +59,7 @@ public function aJWKSetCanBeDefinedInTheConfiguration()
*/
public function aJWKSetCanBeSharedInTheConfiguration()
{
static::ensureKernelShutdown();
$client = static::createClient();

$client->request('GET', '/keys/1.jwkset');
Expand All @@ -80,6 +77,7 @@ public function aJWKSetCanBeSharedInTheConfiguration()
*/
public function aJWKSetCanBeDefinedFromAnotherBundle()
{
static::ensureKernelShutdown();
$client = static::createClient();

$container = $client->getContainer();
Expand All @@ -92,6 +90,7 @@ public function aJWKSetCanBeDefinedFromAnotherBundle()
*/
public function aJWKSetCanBeSharedFromAnotherBundle()
{
static::ensureKernelShutdown();
$client = static::createClient();

$client->request('GET', '/keys/2.jwkset');
Expand All @@ -109,6 +108,7 @@ public function aJWKSetCanBeSharedFromAnotherBundle()
*/
public function aJWKSetCanBeRetrieveFromADistantJkuThroughConfiguration()
{
static::ensureKernelShutdown();
$client = static::createClient();
/** @var Client $httpClient */
$httpClient = $client->getContainer()->get('httplug.client.mock');
Expand All @@ -127,6 +127,7 @@ public function aJWKSetCanBeRetrieveFromADistantJkuThroughConfiguration()
*/
public function aJWKSetCanBeRetrieveFromADistantX5uThroughConfiguration()
{
static::ensureKernelShutdown();
$client = static::createClient();
/** @var Client $httpClient */
$httpClient = $client->getContainer()->get('httplug.client.mock');
Expand Down