Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [2.0.1] - 2019-08-13
### Removed
- PSR-7/17 alias check during the container compile process ([0847ea3](https://github.com/trikoder/oauth2-bundle/commit/0847ea3034cc433c9c8f92ec46fedbdace259e3d))

## [2.0.0] - 2019-08-08
### Added
- Ability to specify a [Defuse](https://github.com/defuse/php-encryption/blob/master/docs/classes/Key.md) key as the encryption key ([d83fefe](https://github.com/trikoder/oauth2-bundle/commit/d83fefe149c1add841d4225ebc2a32aa9333308d))
Expand Down
35 changes: 0 additions & 35 deletions DependencyInjection/TrikoderOAuth2Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
use League\OAuth2\Server\Grant\RefreshTokenGrant;
use League\OAuth2\Server\ResourceServer;
use LogicException;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ServerRequestFactoryInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\UploadedFileFactoryInterface;
use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use Symfony\Component\Config\FileLocator;
Expand Down Expand Up @@ -99,7 +95,6 @@ public function prepend(ContainerBuilder $container)
public function process(ContainerBuilder $container)
{
$this->assertRequiredBundlesAreEnabled($container);
$this->assertPsrHttpAliasesExist($container);
}

private function assertRequiredBundlesAreEnabled(ContainerBuilder $container): void
Expand All @@ -122,36 +117,6 @@ private function assertRequiredBundlesAreEnabled(ContainerBuilder $container): v
}
}

private function assertPsrHttpAliasesExist(ContainerBuilder $container): void
{
$requiredAliases = [
ServerRequestFactoryInterface::class,
StreamFactoryInterface::class,
UploadedFileFactoryInterface::class,
ResponseFactoryInterface::class,
];

foreach ($requiredAliases as $requiredAlias) {
$definition = $container
->getDefinition(
$container->getAlias($requiredAlias)
)
;

$aliasedClass = $definition->getClass();

if (!class_exists($aliasedClass)) {
throw new LogicException(
sprintf(
'Alias \'%s\' points to a non-existing class \'%s\'. Did you configure a PSR-7/17 compatible library?',
$requiredAlias,
$aliasedClass
)
);
}
}
}

private function configureAuthorizationServer(ContainerBuilder $container, array $config): void
{
$authorizationServer = $container
Expand Down