for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2018 Spomky-Labs
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace OAuth2Framework\Bundle\DependencyInjection\Component;
use Jose\Bundle\JoseFramework\Helper\ConfigurationHelper;
use OAuth2Framework\Bundle\DependencyInjection\Component\Component;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
final class KeySet implements Component
load
{
/**
* {@inheritdoc}
public function name(): string
return 'key_set';
}
public function getNodeDefinition(NodeDefinition $node)
$node
->addDefaultsIfNotSet()
->children()
->scalarNode('signature')->defaultNull()->end()
->scalarNode('encryption')->defaultNull()->end()
->end();
public function prepend(ContainerBuilder $container, array $config): array
if (null !== $config['key_set']['signature']) {
ConfigurationHelper::addKeyset($container, 'oauth2_server.key_set.signature', 'jwkset', ['value' => $config['key_set']['signature']]);
if (null !== $config['key_set']['encryption']) {
ConfigurationHelper::addKeyset($container, 'oauth2_server.key_set.encryption', 'jwkset', ['value' => $config['key_set']['encryption']]);
return [];