Skip to content

Commit

Permalink
Merge branch '2.8'
Browse files Browse the repository at this point in the history
* 2.8:
  Fixed tabs when there are several groups of tabs in the same page
  Fix mode
  Fixed failing test for HHVM
  Removed unused logic in MockStream
  Update coding standard for MockStream
  [Filesystem] added tempnam() stream wrapper aware version of PHP's native tempnam() and fixed dumpFile to allow dumping to streams
  Renamed key to secret
  • Loading branch information
fabpot committed Nov 10, 2015
2 parents 843846c + 9c07600 commit db09006
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Expand Up @@ -9,8 +9,8 @@ CHANGELOG
2.8.0
-----

* deprecated the `key` setting of `anonymous` and `remember_me` in favor of the
`secret` setting.
* deprecated the `key` setting of `anonymous`, `remember_me` and `http_digest`
in favor of the `secret` setting.

2.6.0
-----
Expand Down
20 changes: 18 additions & 2 deletions DependencyInjection/Security/Factory/HttpDigestFactory.php
Expand Up @@ -58,10 +58,26 @@ public function getKey()
public function addConfiguration(NodeDefinition $node)
{
$node
->beforeNormalization()
->ifTrue(function ($v) { return isset($v['key']); })
->then(function ($v) {
if (isset($v['secret'])) {
throw new \LogicException('Cannot set both key and secret options for http_digest, use only secret instead.');
}

@trigger_error('http_digest.key is deprecated since version 2.8 and will be removed in 3.0. Use http_digest.secret instead.', E_USER_DEPRECATED);

$v['secret'] = $v['key'];

unset($v['key']);

return $v;
})
->end()
->children()
->scalarNode('provider')->end()
->scalarNode('realm')->defaultValue('Secured Area')->end()
->scalarNode('key')->isRequired()->cannotBeEmpty()->end()
->scalarNode('secret')->isRequired()->cannotBeEmpty()->end()
->end()
;
}
Expand All @@ -76,7 +92,7 @@ protected function createEntryPoint($container, $id, $config, $defaultEntryPoint
$container
->setDefinition($entryPointId, new DefinitionDecorator('security.authentication.digest_entry_point'))
->addArgument($config['realm'])
->addArgument($config['key'])
->addArgument($config['secret'])
;

return $entryPointId;
Expand Down
2 changes: 1 addition & 1 deletion Tests/DependencyInjection/Fixtures/php/container1.php
Expand Up @@ -64,7 +64,7 @@
'simple' => array('pattern' => '/login', 'security' => false),
'secure' => array('stateless' => true,
'http_basic' => true,
'http_digest' => array('key' => 'TheKey'),
'http_digest' => array('secret' => 'TheSecret'),
'form_login' => true,
'anonymous' => true,
'switch_user' => true,
Expand Down
2 changes: 1 addition & 1 deletion Tests/DependencyInjection/Fixtures/xml/container1.xml
Expand Up @@ -49,7 +49,7 @@

<firewall name="secure" stateless="true">
<http-basic />
<http-digest key="TheKey" />
<http-digest secret="TheSecret" />
<form-login />
<anonymous />
<switch-user />
Expand Down
2 changes: 1 addition & 1 deletion Tests/DependencyInjection/Fixtures/yml/container1.yml
Expand Up @@ -47,7 +47,7 @@ security:
stateless: true
http_basic: true
http_digest:
key: TheKey
secret: TheSecret
form_login: true
anonymous: true
switch_user: true
Expand Down

0 comments on commit db09006

Please sign in to comment.