8000 [SecurityBundle] Improve authenticators tab by MatTheCat · Pull Request #2 · MatTheCat/symfony · GitHub
[go: up one dir, main page]

Skip to content

[SecurityBundle] Improve authenticators tab #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

MatTheCat
Copy link
Owner
@MatTheCat MatTheCat commented Jun 24, 2024
Q A
Branch? 7.2
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix parts of 36668
License MIT

This PR adds two new pieces of data to the profiler’s security panel’s authenticators tab: their “laziness” (if their supports method returned null) and the exception passed to their onAuthenticationFailure method.

It also redesigns it because displaying every possible column leads to a lot of wasted space and decreases legibility:


(You can see the table overflowing its container and the screen.)

Instead, I took inspiration from the logger panel and

  • reduced the number of columns to two
  • did not display placeholders for missing data
  • hid dumps behind toggles

This will also make easier to add data if needed.

@MatTheCat MatTheCat force-pushed the new_authenticator_profiler branch 3 times, most recently from db6b852 to 1d9779f Compare June 24, 2024 14:56
@fabpot fabpot force-pushed the profiler_skipped_authenticators branch from bc2c171 to 06f7876 Compare June 25, 2024 05:51
@MatTheCat MatTheCat force-pushed the new_authenticator_profiler branch from 1d9779f to 42ec401 Compare June 25, 2024 07:38
@MatTheCat MatTheCat changed the base branch from profiler_skipped_authenticators to 7.2 June 25, 2024 07:38
@MatTheCat MatTheCat force-pushed the new_authenticator_profiler branch 2 times, most recently from 42ec401 to d0ecca2 Compare June 25, 2024 14:20
@MatTheCat MatTheCat force-pushed the new_authenticator_profiler branch from d0ecca2 to 002a527 Compare June 26, 2024 07:30
@MatTheCat
Copy link
Owner Author

Opened symfony#57525

@MatTheCat MatTheCat closed this Jun 26, 2024
MatTheCat pushed a commit that referenced this pull request Aug 13, 2024
…rsimpsons)

This PR was merged into the 5.4 branch.

Discussion
----------

[Yaml] 🐛 throw ParseException on invalid date

| Q             | A
| ------------- | ---
| Branch?       | 5.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Issues        | None <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License       | MIT

(found in symfony-tools/docs-builder#179)

When parsing the following yaml:
```
date: 6418-75-51
```

`symfony/yaml` will throw an exception:
```
$ php main.php
PHP Fatal error:  Uncaught Exception: Failed to parse time string (6418-75-51) at position 6 (5): Unexpected character in /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php:714
Stack trace:
#0 /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php(714): DateTimeImmutable->__construct()
#1 /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php(312): Symfony\Component\Yaml\Inline::evaluateScalar()
#2 /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php(80): Symfony\Component\Yaml\Inline::parseScalar()
symfony#3 /tmp/symfony-yaml/vendor/symfony/yaml/Parser.php(790): Symfony\Component\Yaml\Inline::parse()
symfony#4 /tmp/symfony-yaml/vendor/symfony/yaml/Parser.php(341): Symfony\Component\Yaml\Parser->parseValue()
symfony#5 /tmp/symfony-yaml/vendor/symfony/yaml/Parser.php(86): Symfony\Component\Yaml\Parser->doParse()
symfony#6 /tmp/symfony-yaml/vendor/symfony/yaml/Yaml.php(77): Symfony\Component\Yaml\Parser->parse()
symfony#7 /tmp/symfony-yaml/main.php(8): Symfony\Component\Yaml\Yaml::parse()
symfony#8 {main}
  thrown in /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php on line 714
```

This is because the "month" is invalid. Fixing the "month" will trigger about the same issue because the "day" would be invalid.

With the current change it will throw a `ParseException`.

Commits
-------

6d71a7e 🐛 throw ParseException on invalid date
MatTheCat pushed a commit that referenced this pull request Oct 22, 2024
…h()` (simoheinonen)

This PR was merged into the 5.4 branch.

Discussion
----------

[MonologBridge] Fix PHP deprecation with `preg_match()`

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

```
preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
```

Commits
-------

4d7a6f6 Passing null to parameter #2 ($subject) of type string is deprecated
MatTheCat pushed a commit that referenced this pull request Oct 22, 2024
* 5.4:
  do not mix named and positional arguments in data provider definitions
  session names must not be empty
  fix Contracts directory name in PHPUnit configuration
  Passing null to parameter #2 ($subject) of type string is deprecated
MatTheCat pushed a commit that referenced this pull request Oct 22, 2024
* 6.4:
  do not mix named and positional arguments in data provider definitions
  session names must not be empty
  fix Contracts directory name in PHPUnit configuration
  Passing null to parameter #2 ($subject) of type string is deprecated
MatTheCat pushed a commit that referenced this pull request Oct 22, 2024
* 7.1:
  do not mix named and positional arguments in data provider definitions
  session names must not be empty
  add missing properties
  fix Contracts directory name in PHPUnit configuration
  [Validator][CidrValidator] Fix error message for `OutOfRangeNetmask` validation
  Passing null to parameter #2 ($subject) of type string is deprecated
MatTheCat pushed a commit that referenced this pull request Nov 20, 2024
… not throw exception (lyrixx)

This PR was merged into the 5.4 branch.

Discussion
----------

[HttpKernel] Ensure `HttpCache::getTraceKey()` does not throw exception

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

We have such logs in our logs. It's in our raw PHP logs. They are not caught by monolog, it's too early

```
[11-Oct-2024 01:23:33 UTC] PHP Fatal error:  Uncaught Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException: Invalid method override "__CONSTRUCT". in /var/www/redirection.io/backend/blue/vendor/symfony/http-foundation/Request.php:1234
Stack trace:
#0 /var/www/redirection.io/backend/blue/vendor/symfony/http-kernel/HttpCache/HttpCache.php(728): Symfony\Component\HttpFoundation\Request->getMethod()
#1 /var/www/redirection.io/backend/blue/vendor/symfony/http-kernel/HttpCache/HttpCache.php(207): Symfony\Component\HttpKernel\HttpCache\HttpCache->getTraceKey()
#2 /var/www/redirection.io/backend/blue/vendor/symfony/http-kernel/Kernel.php(188): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle()
symfony#3 /var/www/redirection.io/backend/blue/web/app.php(9): Symfony\Component\HttpKernel\Kernel->handle()
symfony#4 {main}
  thrown in /var/www/redirection.io/backend/blue/vendor/symfony/http-foundation/Request.php on line 1234

```

I managed to reproduced locally.
* Before the patch, without the http_cache, symfony returns a 405
* After the patch, without the http_cache, symfony returns a 405
* Before the patch, with the http_cache, symfony returns a 500, without any information (too early)
* After the patch, with the http_cache, symfony returns a 405

Commits
-------

a2ebbe0 [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0