8000 Fixed remaining deprecated usage of IS_AUTHENTICATED_ANONYMOUSLY · symfony/symfony@71f08d8 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 71f08d8

Browse files
committed
Fixed remaining deprecated usage of IS_AUTHENTICATED_ANONYMOUSLY
1 parent ffa81a0 commit 71f08d8

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,14 @@ public function testAccess()
243243
$requestMatcher->getArguments()
244244
);
245245
} elseif (2 === $i) {
246-
$this->assertEquals(['IS_AUTHENTICATED_ANONYMOUSLY'], $attributes);
246+
$this->assertEquals(['IS_AUTHENTICATED'], $attributes);
247247
$this->assertNull($channel);
248248
$this->assertEquals(
249249
['/blog/.*'],
250250
$requestMatcher->getArguments()
251251
);
252252
} elseif (3 === $i) {
253-
$this->assertEquals('IS_AUTHENTICATED_ANONYMOUSLY', $attributes[0]);
253+
$this->assertEquals('IS_AUTHENTICATED', $attributes[0]);
254254
$expression = $container->getDefinition((string) $attributes[1])->getArgument(0);
255255
$this->assertEquals("token.getUsername() matches '/^admin/'", $expression);
256256
}

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696

9797
'access_control' => [
9898
['path' => '/blog/524', 'role' => 'ROLE_USER', 'requires_channel' => 'https', 'methods' => ['get', 'POST'], 'port' => 8000],
99-
['path' => '/blog/.*', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY'],
100-
['path' => '/blog/524', 'role' => 'IS_AUTHENTICATED_ANONYMOUSLY', 'allow_if' => "token.getUsername() matches '/^admin/'"],
99+
['path' => '/blog/.*', 'role' => 'IS_AUTHENTICATED'],
100+
['path' => '/blog/524', 'role' => 'IS_AUTHENTICATED', 'allow_if' => "token.getUsername() matches '/^admin/'"],
101101
],
102102

103103
'role_hierarchy' => [

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<role id="ROLE_REMOTE">ROLE_USER,ROLE_ADMIN</role>
7676

7777
<rule path="/blog/524" role="ROLE_USER" requires-channel="https" methods="get,POST" port="8000" />
78-
<rule role='IS_AUTHENTICATED_ANONYMOUSLY' path="/blog/.*" />
79-
<rule role='IS_AUTHENTICATED_ANONYMOUSLY' allow-if="token.getUsername() matches '/^admin/'" path="/blog/524" />
78+
<rule role='IS_AUTHENTICATED' path="/blog/.*" />
79+
<rule role='IS_AUTHENTICATED' allow-if="token.getUsername() matches '/^admin/'" path="/blog/524" />
8080
</config>
8181
</srv:container>

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,5 @@ security:
8383
- { path: /blog/524, role: ROLE_USER, requires_channel: https, methods: [get, POST], port: 8000}
8484
-
8585
path: /blog/.*
86-
role: IS_AUTHENTICATED_ANONYMOUSLY
87-
- { path: /blog/524, role: IS_AUTHENTICATED_ANONYMOUSLY, allow_if: "token.getUsername() matches '/^admin/'" }
86+
role: IS_AUTHENTICATED
87+
- { path: /blog/524, role: IS_AUTHENTICATED, allow_if: "token.getUsername() matches '/^admin/'" }

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ security:
2222
stateless: true
2323

2424
access_control:
25-
- { path: ^/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
25+
- { path: ^/login$, roles: IS_ANONYMOUS }
2626
- { path: .*, roles: IS_AUTHENTICATED_FULLY }

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/config.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ security:
3535
path: /second/logout
3636

3737
access_control:
38-
- { path: ^/unprotected_resource$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
39-
- { path: ^/secure-but-not-covered-by-access-control$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
40-
- { path: ^/secured-by-one-ip$, ip: 10.10.10.10, roles: IS_AUTHENTICATED_ANONYMOUSLY }
41-
- { path: ^/secured-by-two-ips$, ips: [1.1.1.1, 2.2.2.2], roles: IS_AUTHENTICATED_ANONYMOUSLY }
38+
- { path: ^/unprotected_resource$, roles: IS_ANONYMOUS }
39+
- { path: ^/secure-but-not-covered-by-access-control$, roles: IS_ANONYMOUS }
40+
- { path: ^/secured-by-one-ip$, ip: 10.10.10.10, roles: IS_AUTHENTICATED }
41+
- { path: ^/secured-by-two-ips$, ips: [1.1.1.1, 2.2.2.2], roles: IS_AUTHENTICATED }
4242
# these real IP addresses are reserved for docs/examples (https://tools.ietf.org/search/rfc5737)
43-
- { path: ^/secured-by-one-real-ip$, ips: 198.51.100.0, roles: IS_AUTHENTICATED_ANONYMOUSLY }
44-
- { path: ^/secured-by-one-real-ip-with-mask$, ips: '203.0.113.0/24', roles: IS_AUTHENTICATED_ANONYMOUSLY }
45-
- { path: ^/secured-by-one-real-ipv6$, ips: 0:0:0:0:0:ffff:c633:6400, roles: IS_AUTHENTICATED_ANONYMOUSLY }
43+
- { path: ^/secured-by-one-real-ip$, ips: 198.51.100.0, roles: IS_AUTHENTICATED }
44+
- { path: ^/secured-by-one-real-ip-with-mask$, ips: '203.0.113.0/24', roles: IS_AUTHENTICATED }
45+
- { path: ^/secured-by-one-real-ipv6$, ips: 0:0:0:0:0:ffff:c633:6400, roles: IS_AUTHENTICATED }
4646
- { path: ^/highly_protected_resource$, roles: IS_ADMIN }
4747
- { path: ^/protected-via-expression$, allow_if: "(is_anonymous() and request.headers.get('user-agent') matches '/Firefox/i') or is_granted('ROLE_USER')" }
4848
- { path: .*, roles: IS_AUTHENTICATED_FULLY }

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/invalid_ip_access_control.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ security:
1919

2020
access_control:
2121
# the '256.357.458.559' IP is wrong on purpose, to check invalid IP errors
22-
- { path: ^/unprotected_resource$, ips: [1.1.1.1, 256.357.458.559], roles: IS_AUTHENTICATED_ANONYMOUSLY }
22+
- { path: ^/unprotected_resource$, ips: [1.1.1.1, 256.357.458.559], roles: IS_AUTHENTICATED }

src/Symfony/Component/Security/Core/Tests/Authorization/Voter/AuthenticatedVoterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getVoteTests()
5757
}
5858

5959
/**
60-
* @legacy
60+
* @group legacy
6161
* @dataProvider getLegacyVoteTests
6262
*/
6363
public function testVoteIsAuthenticatedAnonymously($authenticated, $attributes, $expected)

0 commit comments

Comments
 (0)
0