Commit Graph

48717 Commits

Author SHA1 Message Date
Christian Flothmann 1452619a52 remove not needed BC layer 2020-04-21 09:24:21 +02:00
Christian Flothmann eb26992f95 [#35368] add missing changelog entry 2020-04-21 08:45:37 +02:00
Thomas Calvet 76072c6424 [FrameworkBundle] Fix session.attribute_bag service definition 2020-04-20 18:42:48 +02:00
Thomas Calvet 9ac1c76fd5 [Routing] Remove unused properties from the Route annotation 2020-04-20 16:41:27 +02:00
noniagriconomie 1b8709ee72 Add Free Mobile notifier 2020-04-20 15:47:45 +02:00
Wouter de Jong b1e040f311 Rename providerKey to firewallName for more consistent naming 2020-04-20 14:20:56 +02:00
Wouter de Jong 50224aa285 Introduce Passport & Badges to extend authenticators 2020-04-20 14:20:56 +02:00
Wouter de Jong 9ea32c4ed3 Also use authentication failure/success handlers in FormLoginAuthenticator 2020-04-20 14:20:56 +02:00
Wouter de Jong 0fe5083a3e Added JSON login authenticator 2020-04-20 14:20:56 +02:00
Wouter de Jong 7ef6a7ab03 Use the firewall event dispatcher 2020-04-20 14:20:56 +02:00
Wouter de Jong 95edc806a1 Added pre-authenticated authenticators (X.509 & REMOTE_USER) 2020-04-20 14:20:56 +02:00
Wouter de Jong f5e11e5f32 Reverted changes to the Guard component 2020-04-20 14:20:56 +02:00
Wouter de Jong ba3754a80f Differentiate between interactive and non-interactive authenticators 2020-04-20 14:20:56 +02:00
Wouter de Jong 6b9d78d5e0 Added tests 2020-04-20 14:20:56 +02:00
Wouter de Jong 59f49b20ca Rename AuthenticatingListener 2020-04-20 14:20:56 +02:00
Wouter de Jong 60d396f2d1 Added automatically CSRF protected authenticators 2020-04-20 14:20:56 +02:00
Wouter de Jong bf1a452e94 Merge AuthenticatorManager and AuthenticatorHandler
The AuthenticatorManager now performs the whole authentication process. This
allows for manual authentication without duplicating or publicly exposing parts
of the process.
2020-04-20 14:20:56 +02:00
Wouter de Jong 44cc76fec2 Use one AuthenticatorManager per firewall 2020-04-20 14:20:56 +02:00
Wouter de Jong 09bed16d3d Only load old manager if new system is disabled 2020-04-20 14:20:56 +02:00
Wouter de Jong ddf430fc1e Added remember me functionality 2020-04-20 14:20:56 +02:00
Wouter de Jong 1c810d5d2a Added support for lazy firewalls 2020-04-20 14:20:56 +02:00
Wouter de Jong 7859977324 Removed all mentions of 'guard' in the new system
This to remove confusion between the new system and Guard. When using the new
system, guard should not be installed. Guard did however influence the idea
behind the new system. Thus keeping the mentions of "guard" makes it confusing
to use the new system.
2020-04-20 14:20:56 +02:00
Wouter de Jong 999ec2795f Refactor to an event based authentication approach
This allows more flexibility for the authentication manager (to e.g. implement
login throttling, easier remember me, etc). It is also a known design pattern
in Symfony HttpKernel.
2020-04-20 14:20:56 +02:00
Wouter de Jong b14a5e8c52 Moved new authenticator to the HTTP namespace
This removes the introduced dependency on Guard from core. It also allows an
easier migration path, as the complete Guard subcomponent can now be deprecated
later in the 5.x life.
2020-04-20 14:20:56 +02:00
Wouter de Jong b923e4c4f6 Enabled remember me for the GuardManagerListener 2020-04-20 14:20:56 +02:00
Wouter de Jong 873b949cf9 Mark new core authenticators as experimental 2020-04-20 14:20:56 +02:00
Wouter de Jong 4c06236933 Fixes after testing in Demo application 2020-04-20 14:20:56 +02:00
Wouter de Jong fa4b3ec213 Implemented password migration for the new authenticators 2020-04-20 14:20:55 +02:00
Wouter de Jong 5efa892395 Create a new core AuthenticatorInterface
This is an iteration on the AuthenticatorInterface of the Guard, to allow more
flexibility so it can be used as a real replaced of the authentication
providers and listeners.
2020-04-20 14:20:55 +02:00
Wouter de Jong 50132587a1 Add provider key in PreAuthenticationGuardToken
This is required to create the correct authenticated token in the
GuardAuthenticationManager.
2020-04-20 14:20:55 +02:00
Wouter de Jong 526f75608b Added GuardManagerListener
This replaces all individual authentication listeners when guard authentication
manager is enabled.
2020-04-20 14:20:55 +02:00
Wouter de Jong a172bacaa6 Added FormLogin and Anonymous authenticators 2020-04-20 14:20:55 +02:00
Wouter J 9b7fddd10c Integrated GuardAuthenticationManager in the SecurityBundle 2020-04-20 14:20:55 +02:00
Wouter J a6890dbcf0 Created HttpBasicAuthenticator and some Guard traits 2020-04-20 14:20:55 +02:00
Wouter J c321f4d73a Created GuardAuthenticationManager to make Guard first-class Security 2020-04-20 14:20:55 +02:00
Thomas Calvet 9fd62f79fb [Routing] Add missing _locale requirements
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
2020-04-20 14:17:53 +02:00
Fabien Potencier e464954998 feature #36187 [Routing] Deal with hosts per locale (odolbeau)
This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Routing] Deal with hosts per locale

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #30617
| License       | MIT
| Doc PR        | TODO

Allow to define a different host for each locale in routing.

It's now possible to define this kind of configuration:
```yaml
controllers:
    resource: ../../src/Controller/
    type: annotation
    host:
        fr: www.example.fr
        en: www.example.com
```

It's still possible to define an unique host (`host: wwww.example.com`) and if a host is defined for a given route directly, it's not overridden.

To be done:
- [x] YamlLoader
- [x] XmlLoader
- [x] PhpLoader?
- [x] Documentation
- [x] Changelog

Commits
-------

4751a732f2 [Routing] Deal with hosts per locale
2020-04-20 10:51:57 +02:00
Olivier Dolbeau 4751a732f2 [Routing] Deal with hosts per locale 2020-04-20 10:51:50 +02:00
stoccc 4bda68a9a2
Update LdapBindAuthenticationProvider.php 2020-04-19 23:34:01 +02:00
Nicolas Grekas 95becc4078 bug #36457 [Cache] CacheItem with tag is never a hit after expired (alexander-schranz, nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] CacheItem with tag is never a hit after expired

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes/no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36458
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

It seems like a tag cacheItem is never a hit again. Not sure how fix this but the cache component is really hard to debug 🙈 .

It need to be somewhere generally as all TagAware caches are effected:

```
1) Symfony\Component\Cache\Tests\Adapter\FilesystemTagAwareAdapterTest::testRefreshAfterExpires

Failed asserting that false is true.

/home/travis/build/symfony/symfony/src/Symfony/Component/Cache/Tests/Traits/TagAwareTestTrait.php:194

2) Symfony\Component\Cache\Tests\Adapter\PredisTagAwareClusterAdapterTest::testRefreshAfterExpires

Failed asserting that true is false.

/home/travis/build/symfony/symfony/src/Symfony/Component/Cache/Tests/Traits/TagAwareTestTrait.php:183

3) Symfony\Component\Cache\Tests\Adapter\RedisTagAwareAdapterTest::testRefreshAfterExpires

Failed asserting that true is false.

/home/travis/build/symfony/symfony/src/Symfony/Component/Cache/Tests/Traits/TagAwareTestTrait.php:183

4) Symfony\Component\Cache\Tests\Adapter\RedisTagAwareClusterAdapterTest::testRefreshAfterExpires

Failed asserting that true is false.

/home/travis/build/symfony/symfony/src/Symfony/Component/Cache/Tests/Traits/TagAwareTestTrait.php:183
```

Commits
-------

d082eca7dd Add reproducer to for hit after update expire cacheItem
f815b011c3 [Cache] fix FilesystemTagAwareAdapter failing when a tag link preexists
2020-04-19 21:54:45 +02:00
Nicolas Grekas 8f9ff4f7a0 [Routing] fix CS 2020-04-19 19:10:00 +02:00
Nicolas Grekas 69b6c90330 Merge branch '5.0'
* 5.0:
  [HttpFoundation] workaround PHP bug in the session module
  [SecurityBundle] fix accepting env vars in remember-me configurations
  [Form] Fixed handling groups sequence validation
  [Mime] Ensure proper line-ending for SMIME
  [Cache] Avoid memory leak in TraceableAdapter::reset()
2020-04-18 22:50:29 +02:00
Nicolas Grekas efbe752918 Merge branch '4.4' into 5.0
* 4.4:
  [HttpFoundation] workaround PHP bug in the session module
  [SecurityBundle] fix accepting env vars in remember-me configurations
  [Form] Fixed handling groups sequence validation
  [Cache] Avoid memory leak in TraceableAdapter::reset()
2020-04-18 22:50:06 +02:00
Nicolas Grekas e0e3cf634e Merge branch '3.4' into 4.4
* 3.4:
  [HttpFoundation] workaround PHP bug in the session module
2020-04-18 22:40:08 +02:00
Nicolas Grekas 62565a1b66 bug #36490 [HttpFoundation] workaround PHP bug in the session module (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] workaround PHP bug in the session module

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Current tests fail after https://github.com/php/php-src/pull/5305
Which itself is a patch for a bug in the session module.

This PR works around the issue in older versions of PHP and fixes the tests.

Commits
-------

0cbca19edc [HttpFoundation] workaround PHP bug in the session module
2020-04-18 22:39:13 +02:00
Nicolas Grekas 0cbca19edc [HttpFoundation] workaround PHP bug in the session module 2020-04-18 22:23:17 +02:00
Nicolas Grekas 23f5070696 minor #36485 [Security] Fixed broken master build (wouterj)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Security] Fixed broken master build

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | n/a

The build failures are caused by these lines (line 100 specically):

2460ca59af/src/Symfony/Component/Security/Http/Firewall/ContextListener.php (L97-L108)

Since #34363, `$request->cookies->get()` is typehinted as `string|null`. On Travis with PHP=7.4, this doc typehint is transformed into PHP return type: `get(): ?string`.

On tests, the session cookie is set to `true`. See #36118 for some background on why this is necessary.

There are a couple possible solutions:

1. Update the `InputBag::get()` PHPdoc to use `@return scalar|null`
2. Use `$request->cookie->all()[$session->getName()]` in `ContextListener`
3. Allow pre-configuring the session ID in `MockArraySessionStorage`.

I've implemented solution (1). The method is actually using `is_scalar()` to check if a deprecation notice should be triggered, so it is expected to return a scalar in Symfony 6.

_I've had to update the `DebugClassLoader` to not convert this to `get(): ?scalar`, as that doesn't exists in PHP. I'm not sure if my changes are correct (but they work)._

Commits
-------

94f47630ba Fixed fetching sessionId from InputBag
2020-04-18 21:15:36 +02:00
Wouter de Jong 94f47630ba Fixed fetching sessionId from InputBag 2020-04-18 20:51:12 +02:00
Alexander Schranz d082eca7dd Add reproducer to for hit after update expire cacheItem 2020-04-18 16:28:10 +02:00
Nicolas Grekas f815b011c3 [Cache] fix FilesystemTagAwareAdapter failing when a tag link preexists 2020-04-18 16:28:10 +02:00