Skip to content

Commit cbaf5a1

Browse files
committed
minor #23826 [2.8] Modify 2.8 upgrade doc - key option is deprecated. (sampart)
This PR was squashed before being merged into the 2.8 branch (closes #23826). Discussion ---------- [2.8] Modify 2.8 upgrade doc - key option is deprecated. | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no, but this is only a documentation change - I don't think it's my change that has broken them. | Fixed tickets | n/a | License | MIT | Doc PR | n/a The 2.8.0 section of the [CHANGELOG for the Security bundle](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md#280) has two items in it > * deprecated the `key` setting of `anonymous`, `remember_me` and `http_digest` in favor of the `secret` setting. > * deprecated the `intention` firewall listener setting in favor of the `csrf_token_id`. The first of these isn't also in the Symfony upgrade guide, but the second is. This PR adds the missing item (deprecated `key` setting) into the Symfony upgrade guide. Commits ------- 2309fd9 [2.8] Modify 2.8 upgrade doc - key option is deprecated.
2 parents 65fa8c2 + 2309fd9 commit cbaf5a1

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

UPGRADE-2.8.md

+89
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,95 @@ Security
546546

547547
* The `VoterInterface::supportsClass` and `supportsAttribute` methods were
548548
deprecated and will be removed from the interface in 3.0.
549+
550+
* The the `key` setting of `anonymous`, `remember_me` and `http_digest`
551+
is deprecated, and will be removed in 3.0. Use `secret` instead.
552+
553+
Before:
554+
555+
```yaml
556+
security:
557+
# ...
558+
firewalls:
559+
default:
560+
# ...
561+
anonymous: { key: "%secret%" }
562+
remember_me:
563+
key: "%secret%"
564+
http_digest:
565+
key: "%secret%"
566+
```
567+
568+
```xml
569+
<!-- ... -->
570+
<config>
571+
<!-- ... -->
572+
573+
<firewall>
574+
<!-- ... -->
575+
576+
<anonymous key="%secret%"/>
577+
<remember-me key="%secret%"/>
578+
<http-digest key="%secret%"/>
579+
</firewall>
580+
</config>
581+
```
582+
583+
```php
584+
// ...
585+
$container->loadFromExtension('security', array(
586+
// ...
587+
'firewalls' => array(
588+
// ...
589+
'anonymous' => array('key' => '%secret%'),
590+
'remember_me' => array('key' => '%secret%'),
591+
'http_digest' => array('key' => '%secret%'),
592+
),
593+
));
594+
```
595+
596+
After:
597+
598+
```yaml
599+
security:
600+
# ...
601+
firewalls:
602+
default:
603+
# ...
604+
anonymous: { secret: "%secret%" }
605+
remember_me:
606+
secret: "%secret%"
607+
http_digest:
608+
secret: "%secret%"
609+
```
610+
611+
```xml
612+
<!-- ... -->
613+
<config>
614+
<!-- ... -->
615+
616+
<firewall>
617+
<!-- ... -->
618+
619+
<anonymous secret="%secret%"/>
620+
<remember-me secret="%secret%"/>
621+
<http-digest secret="%secret%"/>
622+
</firewall>
623+
</config>
624+
```
625+
626+
```php
627+
// ...
628+
$container->loadFromExtension('security', array(
629+
// ...
630+
'firewalls' => array(
631+
// ...
632+
'anonymous' => array('secret' => '%secret%'),
633+
'remember_me' => array('secret' => '%secret%'),
634+
'http_digest' => array('secret' => '%secret%'),
635+
),
636+
));
637+
```
549638

550639
* The `intention` option is deprecated for all the authentication listeners,
551640
and will be removed in 3.0. Use the `csrf_token_id` option instead.

0 commit comments

Comments
 (0)