Skip to content

Commit

Permalink
Security fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Spomky committed Nov 17, 2023
1 parent c1cd440 commit 09dd5f7
Show file tree
Hide file tree
Showing 9 changed files with 425 additions and 457 deletions.
806 changes: 417 additions & 389 deletions composer.lock

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ security:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false

# admin:
# pattern: ^/admin
# provider: app_admin_provider
# x509:
# user_identifier: CN

main:
pattern: ^/
lazy: true
Expand All @@ -34,7 +28,7 @@ security:
logout:
path: app_logout
# where to redirect after logout
# target: app_any_route
target: app_homepage

# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall
Expand Down
29 changes: 0 additions & 29 deletions src/Entity/Admin.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(
$this->accessTokens = new ArrayCollection();
}

public function __toString()
public function __toString(): string
{
return sprintf('%s (%s)', $this->username, $this->email);
}
Expand Down
4 changes: 3 additions & 1 deletion src/Repository/CityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public function flush(): void
public function findByNameLike(string $query): array
{
return $this->createQueryBuilder('c')
->andWhere('(LOWER(c.name) LIKE :query) OR (LOWER(c.zipCode) LIKE :query) OR (LOWER(c.inseeCode) LIKE :query)')
->andWhere(
'(LOWER(c.name) LIKE :query) OR (LOWER(c.zipCode) LIKE :query) OR (LOWER(c.inseeCode) LIKE :query)'
)
->setParameter('query', sprintf('%%%s%%', mb_strtolower($query)))
->orderBy('c.name', Criteria::ASC)
->setMaxResults(50)
Expand Down
27 changes: 0 additions & 27 deletions src/Security/AdminProvider.php

This file was deleted.

3 changes: 2 additions & 1 deletion tests/Benchmark/Argon2Bench.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
namespace App\Tests\Benchmark;

use PhpBench\Benchmark\Metadata\Annotations\Revs;
use const PASSWORD_BCRYPT;
use const PASSWORD_ARGON2I;
use const PASSWORD_ARGON2ID;

final class Argon2Bench
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Benchmark/PBKDF2Bench.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace App\Tests\Benchmark;

use PhpBench\Benchmark\Metadata\Annotations\Revs;
use const PASSWORD_BCRYPT;

final class PBKDF2Bench
{
Expand All @@ -16,6 +15,7 @@ public function benchPBKDF2_MinimumNISTRecommendation(): void
{
hash_pbkdf2('sha256', 'this is a very secret password', random_bytes(16), 1_000, 64, true);
}

/**
* @Revs(1)
*/
Expand Down
1 change: 0 additions & 1 deletion tests/Benchmark/ShaBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace App\Tests\Benchmark;

use PhpBench\Benchmark\Metadata\Annotations\Revs;
use const PASSWORD_BCRYPT;

final class ShaBench
{
Expand Down

0 comments on commit 09dd5f7

Please sign in to comment.