Commit Graph

22487 Commits

Author SHA1 Message Date
Fabien Potencier
156368fa43 feature #15882 Easier Custom Authentication errors (weaverryan)
This PR was merged into the 2.8 branch.

Discussion
----------

Easier Custom Authentication errors

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | not yet

This makes failing authentication with a custom message much easier:

```php
throw CustomAuthenticationException::createWithSafeMessage(
    'That was a ridiculous username'
);

// or
$e = new CustomAuthenticationException();
$e->setSafeMessage('That was a ridiculous username');

throw $e;
```

Currently, to do this, you'd need to create a new sub-class of `AuthenticationException`, which is way more work than it needs to be. The original design was so that all messages exposed are safe, which is why I've named the methods like I have.

Thanks!

Commits
-------

d7c1463 Adding a class to make it easier to set custom authentication error messages
2015-09-28 09:00:41 +02:00
Fabien Potencier
4021353591 Merge branch '2.7' into 2.8
* 2.7:
  Readd the correct tests
2015-09-28 08:58:50 +02:00
Fabien Potencier
df7a89f171 minor #15942 [Security] Improve AbstractVoter tests (WouterJ)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] Improve AbstractVoter tests

Applying the improved tests from https://github.com/symfony/symfony/pull/15932 into the oldest possible branch.

Merge conflicts from 2.7 into 2.8 caused by this PR do not need to be done carefully, I'll create a new PR for 2.8 updating the tests as soon as these changes are merged up.

| Q             | A
| ------------- | ---
| Fixed tickets | -
| License       | MIT

Commits
-------

5ff741d Readd the correct tests
2015-09-28 08:54:42 +02:00
Fabien Potencier
3a665af934 Merge branch '2.7' into 2.8
* 2.7:
  [Security] fixed composer.json
2015-09-28 08:51:00 +02:00
Fabien Potencier
8a1f0a0501 [Security] fixed composer.json 2015-09-28 08:50:50 +02:00
Ryan Weaver
d7c14632f7 Adding a class to make it easier to set custom authentication error messages 2015-09-27 16:39:53 -04:00
Fabien Potencier
4b942741e5 minor #15940 [Console] don't rely on internal sort implementation om test (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[Console] don't rely on internal sort implementation om test

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14894
| License       | MIT
| Doc PR        |

PHP does not guarantuee how array elements with the same value will be
sorted when applying `asort()`. Since all namespaces used in the test
produce the same Levenshtein value, we should only check for presence of
these namespaces instead of comparing the exact order.

Commits
-------

3011fa0 don't rely on internal sort implementation in test
2015-09-27 16:47:35 +02:00
Matthias Pigulla
5392a0ca1f Remove failing test
Fixes #15935, test has been removed on 2.8 already in https://github.com/symfony/symfony/pull/15738/files#diff-990df0e8238847f8ae54e8227f295c22L107
2015-09-27 16:27:15 +02:00
Wouter J
5ff741de8a Readd the correct tests 2015-09-27 16:25:18 +02:00
Christian Flothmann
3011fa0ea9 don't rely on internal sort implementation in test
PHP does not guarantuee how array elements with the same value will be
sorted when applying `asort()`. Since all namespaces used in the test
produce the same Levenshtein value, we should only check for presence of
these namespaces instead of comparing the exact order.
2015-09-27 15:45:05 +02:00
Javier Eguiluz
8c47eb9be6 Removed the "Delete profiles" action from the web profiler sidebar 2015-09-27 15:39:02 +02:00
Fabien Potencier
7f829b8d55 bug #15533 [Console] Fix input validation when required arguments are missing (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

[Console] Fix input validation when required arguments are missing

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15505
| License       | MIT
| Doc PR        | -

The rule that was here in place previously only works when arguments are passed from command line, as in command line there is no way of skipping an argument. The rule does not work for arguments set on the Input after a command is run.

Commits
-------

4982b02 [Console] Add the command name to input arguments if it's missing
f12a4c1 [Console] Fix input validation when required arguments are missing
2015-09-27 15:31:56 +02:00
Fabien Potencier
6ae7d95e13 feature #15907 [DomCrawler] Deprecate methods inherited from SplObjectStorage (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

[DomCrawler] Deprecate methods inherited from SplObjectStorage

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | half of #15849
| License       | MIT
| Doc PR        | n/a

There is no documentation change to be done for it: we don't document the fact that DomCrawler extends SplObjectStorage (this is an implementation detail which leaked because of using inheritance rather than composition).

Commits
-------

997c650 Deprecate methods inherited from SplObjectStorage
2015-09-27 15:24:43 +02:00
Christophe Coevoet
997c650c1c Deprecate methods inherited from SplObjectStorage 2015-09-27 15:06:19 +02:00
ogizanagi
d961f7f344 [Config] Fix ArrayNode extra keys "ignore" and "remove" behaviors 2015-09-27 12:15:37 +02:00
Fabien Potencier
58ed0762e9 Merge branch '2.7' into 2.8
* 2.7:
  Detect Mintty for color support on Windows
  Detect Mintty for color support on Windows
  Add a group for tests of the finder against the FTP server
  Fix license headers
  Forbid serializing a Crawler
  Fix phpdoc block of NativeSessionStorage class
  Added exception when setAutoInitialize is called when locked
  [FrameworkBundle] Advanced search templates of bundles
  [Security] Allow user providers to be defined in many files
  Use random_bytes function if it is available for random number generation
2015-09-27 12:09:46 +02:00
Christophe Coevoet
ea2bd2a0a2 Detect Mintty for color support on Windows
Mintty is now the default terminal in GitBash, and it supports ANSI
colors without the need of ANSICON (it even supports 256 colors rather
than the 16 colors supported by ANSICON).
2015-09-27 12:08:51 +02:00
Fabien Potencier
3ba54c1c31 Merge branch '2.3' into 2.7
* 2.3:
  Detect Mintty for color support on Windows
  Add a group for tests of the finder against the FTP server
  Fix license headers
  Forbid serializing a Crawler
  Fix phpdoc block of NativeSessionStorage class
  Added exception when setAutoInitialize is called when locked
  [FrameworkBundle] Advanced search templates of bundles
  [Security] Allow user providers to be defined in many files
  Use random_bytes function if it is available for random number generation
2015-09-27 12:08:38 +02:00
Fabien Potencier
4a8935597c bug #15915 Detect Mintty for color support on Windows (stof)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #15915).

Discussion
----------

Detect Mintty for color support on Windows

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/5726

Mintty is now the default terminal in GitBash, and it supports ANSI colors without the need of ANSICON (it even supports 256 colors rather than the 16 colors supported by ANSICON).

I submitted it to 2.8 as it can be considered as a new feature. But it should not be hard to merge it in other branches if we decide to consider it as a bugfix (it just needs to be split because VarDumper does not exist in 2.3)

Commits
-------

12743d1 Detect Mintty for color support on Windows
2015-09-27 11:59:16 +02:00
Christophe Coevoet
12743d1035 Detect Mintty for color support on Windows
Mintty is now the default terminal in GitBash, and it supports ANSI
colors without the need of ANSICON (it even supports 256 colors rather
than the 16 colors supported by ANSICON).
2015-09-27 11:58:50 +02:00
Fabien Potencier
06c14a2653 bug #15925 Updating behavior to not continue after an authenticator has set the response (weaverryan)
This PR was merged into the 2.8 branch.

Discussion
----------

Updating behavior to not continue after an authenticator has set the response

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/14673/files#r40492765
| License       | MIT
| Doc PR        | n/a

This mirrors the behavior in core: *if* a listener sets a response (on success or failure),
then the other listeners are not called. But if a response is *not* set
(which is sometimes the case for success, like in BasicAuthenticationListener),
then the other listeners are called, and can even fail.

It's all a bit of an edge-case, as only one authenticator (like authentication listener) would normally be doing any work on a request, but I think matching the other listeners (since I'm not aware of anyone having issues with its behavior) is best.

Commits
-------

5fa2684 Making all "debug" messages use the debug router
f403444 Updating behavior to not continue after an authenticator has set the response
2015-09-27 11:53:56 +02:00
Fabien Potencier
8df5d94158 minor #15924 Add a group for tests of the finder against the FTP server (stof)
This PR was merged into the 2.3 branch.

Discussion
----------

Add a group for tests of the finder against the FTP server

This allows to skip them easily when running the testsuite, as they represent a significant part of the testsuite time. These 2 tests together represent 42% of the execution time of the testsuite (all the time being spent connecting to the FTP server).

I also remove the usage of the data provider as a data provider with a single dataset (and used only partially) only makes tests harder to read. and does not save any duplication.

Commits
-------

51147e3 Add a group for tests of the finder against the FTP server
2015-09-27 11:50:37 +02:00
Fabien Potencier
5dcdc486ad bug #15928 [2.8][WebProfilerBundle] Fix search button click listener (xelaris)
This PR was merged into the 2.8 branch.

Discussion
----------

[2.8][WebProfilerBundle] Fix search button click listener

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

This fixes an issue when clicking the sidebar "Search" button **text** instead of the **button**. Then the click event target/srcElement is the *span* child-element, instead of the listening *a* element, which causes errors in the listener, since it expects the listening element. In consequence of that the search form isn't shown.

To fix this, the same technique is used, as for the navigation tabs. Traversing the DOM up to the expected *a* element.

Commits
-------

f9ddddb [WebProfilerBundle] Fix search button click listener
2015-09-27 11:22:34 +02:00
Fabien Potencier
1e65f7189f bug #15921 Abstract voter tweaks (weaverryan)
This PR was merged into the 2.8 branch.

Discussion
----------

Abstract voter tweaks

| Q             | A
| ------------- | ---
| Bug fix?      | yes (a little)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Based on suggestions from stof in #15870, this simplifies the BC and deprecation throwing code. This also adds a BadMethodCallException in case the user doesn't override `isGranted` *or* `voteOnAttribute`, because that's just plain wrong (as is calling `isGranted()` on the parent class directly, since that was formerly abstract).

Commits
-------

c03f5c2 Massively simplifying the BC and deprecated-throwing code thanks to suggestions by stof in #15870
2015-09-27 11:19:34 +02:00
Fabien Potencier
709cc13887 bug #15927 Making GuardTokenInterface extend TokenInterface (weaverryan)
This PR was merged into the 2.8 branch.

Discussion
----------

Making GuardTokenInterface extend TokenInterface

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15884
| License       | MIT
| Doc PR        | n/a

See #15884

Commits
-------

7f04fbb Making GuardTokenInterface extend TokenInterface
2015-09-27 11:18:08 +02:00
Fabien Potencier
9ec98c2a2c minor #15901 [Validator] Add Hungarian translation for the BIC constraint (1ed)
This PR was merged into the 2.8 branch.

Discussion
----------

[Validator] Add Hungarian translation for the BIC constraint

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

f26425b [Validator] Add Hungarian translation for the BIC constraint
2015-09-27 11:10:04 +02:00
Fabien Potencier
9cf4ab74d3 minor #15920 Guard minor tweaks (weaverryan)
This PR was merged into the 2.8 branch.

Discussion
----------

Guard minor tweaks

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Various completely minor things, most from suggestions on #14673

Commits
-------

869d5a7 tweaking message related to configuration edge case that we want to be helpful with
da4758a Minor tweaks - lowering the required security-http requirement and nulling out a test field
2015-09-27 10:55:21 +02:00
Fabien Potencier
92a9e22b48 bug #15906 Forbid serializing a Crawler (stof)
This PR was merged into the 2.3 branch.

Discussion
----------

Forbid serializing a Crawler

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Unserializing a Crawler instance creates DOM elements in an invalid state, making the Crawler unusable.
While working on #15849, I figured out that DomCrawler actually inherits ``Serializable`` from its ``SplObjectStorage`` parent, and so I tried to serialize and unserialize one. The answer is that it does not work. This is what happens when trying to call ``parents`` on it for instance:

```
Symfony\Component\DomCrawler\Crawler::parents(): Invalid State Error
```

Commits
-------

12733cb Forbid serializing a Crawler
2015-09-27 10:54:00 +02:00
Fabien Potencier
936e1b3ac2 minor #15912 Allow serializer 3.0 in the PropertyInfo component (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

Allow serializer 3.0 in the PropertyInfo component

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This makes the component consistent with other components.

Commits
-------

0d72411 Allow serializer 3.0 in the PropertyInfo component
2015-09-27 10:49:22 +02:00
Fabien Potencier
15326ad1af minor #15910 Add the replace rules for the security-guard component (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

Add the replace rules for the security-guard component

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

The update of composer replacements was forgotten in #14673

Commits
-------

5ef8abc Add the replace rules for the security-guard component
2015-09-27 10:47:35 +02:00
Alexander Schwenn
f9ddddb6c2 [WebProfilerBundle] Fix search button click listener 2015-09-27 09:53:17 +02:00
Tobias Schultze
3909460c04 feature #15301 [Form][Type Date/Time] added choice_translation_domain option. (aitboudad)
This PR was squashed before being merged into the 2.8 branch (closes #15301).

Discussion
----------

[Form][Type Date/Time] added choice_translation_domain option.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |  #15222 and #15298
| License       | MIT

- [x] add test

Commits
-------

1f3af26 [Form][Type Date/Time] added choice_translation_domain option.
2015-09-27 01:13:22 +02:00
Abdellatif Ait boudad
1f3af26e5c [Form][Type Date/Time] added choice_translation_domain option. 2015-09-27 01:13:15 +02:00
Ryan Weaver
c03f5c2ad4 Massively simplifying the BC and deprecated-throwing code thanks to suggestions by stof in #15870 2015-09-26 17:07:41 -04:00
Christophe Coevoet
e610b416c9 Merge branch '2.7' into 2.8
* 2.7:
  Fix license headers
  Ensure the ClockMock is loaded before using it in the testsuite
  Fix with_minutes option in time widget
  Fixed properties not explicitily declared
2015-09-26 21:48:07 +02:00
Christophe Coevoet
05fc646142 minor #15913 Ensure the ClockMock is loaded before using it in the testsuite (stof)
This PR was merged into the 2.7 branch.

Discussion
----------

Ensure the ClockMock is loaded before using it in the testsuite

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

The ``ProgressBarTest`` is passing in 2.7 and 2.8 on Travis only because the ``LegacyProgressHelperTest`` is running first, and so the clock mock is loaded. It would not pass when running it standalone. And the testsuite is currently broken in the master branch because LegacyProgressHelperTest is gone there, and so the clock mock was not loaded before the test.

Commits
-------

0e5aa0e Ensure the ClockMock is loaded before using it in the testsuite
2015-09-26 21:30:33 +02:00
Christophe Coevoet
a31dfa6f4b minor #15923 Fix legacy security tests (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

Fix legacy security tests

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

when merging legacy test classes together in #15893, use statements where not copied, making the tests fail.

Commits
-------

8b615bb Fix legacy security tests
2015-09-26 21:22:35 +02:00
Tobias Schultze
4cc8b76787 minor #15922 [Security] Fix trigger_error calls in voters (WouterJ)
This PR was merged into the 2.8 branch.

Discussion
----------

[Security] Fix trigger_error calls in voters

Fixes typos found by @weaverryan in https://github.com/symfony/symfony/pull/15151

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

69e80be Fix trigger_error calls
2015-09-26 20:56:55 +02:00
Ryan Weaver
5fa2684273 Making all "debug" messages use the debug router
Only the "auth success" and "auth failed" messages remain at info. That's
consistent with AbstractAuthenticationListener
2015-09-26 14:16:48 -04:00
Ryan Weaver
7f04fbb078 Making GuardTokenInterface extend TokenInterface
This makes some of our type-hints more honest: i.e. where we look for a GuardTokenInterface,
but really also expect it to implement TokenInterface.
2015-09-26 14:10:49 -04:00
Ryan Weaver
f403444cc0 Updating behavior to not continue after an authenticator has set the response
This mirrors the behavior in core: *if* a listener sets a response (on success or failure),
then the other listeners are not called. But if a response is *not* set
(which is sometimes the case for success, like in BasicAuthenticationListener),
then the other listeners are called, and can even fail.
2015-09-26 12:34:14 -04:00
Christophe Coevoet
51147e3aff Add a group for tests of the finder against the FTP server
This allows to skip them easily when running the testsuite, as they
represent a significant part of the testsuite time.
2015-09-26 17:47:39 +02:00
WouterJ
69e80beaa0 Fix trigger_error calls 2015-09-26 17:42:54 +02:00
Christophe Coevoet
8b615bb4b4 Fix legacy security tests 2015-09-26 17:38:37 +02:00
Ryan Weaver
869d5a77f0 tweaking message related to configuration edge case that we want to be helpful with 2015-09-26 10:22:30 -04:00
Ryan Weaver
da4758a2af Minor tweaks - lowering the required security-http requirement and nulling out a test field 2015-09-26 10:16:59 -04:00
Christophe Coevoet
1d5557f37f minor #15918 [2.8] Fix license headers (1ed)
This PR was merged into the 2.8 branch.

Discussion
----------

[2.8] Fix license headers

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

1701708 Fix license headers
2015-09-26 14:52:34 +02:00
Christophe Coevoet
548c10482e minor #15917 [2.7] Fix license headers (1ed)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7] Fix license headers

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

db8239f Fix license headers
2015-09-26 14:50:27 +02:00
Christophe Coevoet
2bd0738cc5 minor #15916 [2.3] Fix license headers (1ed)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3] Fix license headers

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

b03bcb3 Fix license headers
2015-09-26 14:42:05 +02:00
Gábor Egyed
1701708c48 Fix license headers 2015-09-26 14:22:32 +02:00