Skip to content

Instantly share code, notes, and snippets.

@pboethig
Created October 31, 2016 23:58
Show Gist options
  • Save pboethig/3415ab645270f5199b757a43ddb09f73 to your computer and use it in GitHub Desktop.
Save pboethig/3415ab645270f5199b757a43ddb09f73 to your computer and use it in GitHub Desktop.
<?php
namespace Mittax\WsseBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files.
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
*/
class Configuration implements ConfigurationInterface
{
const WSSSE_SALT = 10;
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('mittax_wsse');
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
$rootNode
->children()
->scalarNode('salt')
->defaultValue('cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e')
->isRequired()
->cannotBeEmpty()
->end()
->integerNode('lifetime')
->defaultValue(600)
->end()
->scalarNode('encoder')
->defaultValue('Mittax\WsseBundle\DependencyInjection\Security\Encoders\Sha512')
->end()
->booleanNode('preventreplayattacks')
->defaultValue(true)
->end()
->end();
return $treeBuilder;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment