Skip to content

Commit

Permalink
feat: Removed deprecated LoginAttempt entity, using default Symfony l…
Browse files Browse the repository at this point in the history
…ogin throtling

BREAKING CHANGE: RZ\Roadiz\CoreBundle\Entity\LoginAttempt has been removed with its manager and utils
  • Loading branch information
ambroisemaupate committed Jul 12, 2023
1 parent 0b54f08 commit f7e2a39
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 529 deletions.
1 change: 0 additions & 1 deletion lib/RoadizCompatBundle/src/Aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public static function getAliases(): array
\RZ\Roadiz\CoreBundle\Entity\FolderTranslation::class => \RZ\Roadiz\Core\Entities\FolderTranslation::class,
\RZ\Roadiz\CoreBundle\Entity\Group::class => \RZ\Roadiz\Core\Entities\Group::class,
\RZ\Roadiz\CoreBundle\Entity\Log::class => \RZ\Roadiz\Core\Entities\Log::class,
\RZ\Roadiz\CoreBundle\Entity\LoginAttempt::class => \RZ\Roadiz\Core\Entities\LoginAttempt::class,
\RZ\Roadiz\CoreBundle\Entity\Node::class => \RZ\Roadiz\Core\Entities\Node::class,
\RZ\Roadiz\CoreBundle\Entity\NodeType::class => \RZ\Roadiz\Core\Entities\NodeType::class,
\RZ\Roadiz\CoreBundle\Entity\NodeTypeField::class => \RZ\Roadiz\Core\Entities\NodeTypeField::class,
Expand Down
1 change: 0 additions & 1 deletion lib/RoadizCoreBundle/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ services:
Solarium\Core\Client\Client:
factory: ['RZ\Roadiz\CoreBundle\SearchEngine\ClientRegistry', 'getClient']

# Provides LoginAttemptManager aware authentication
RZ\Roadiz\CoreBundle\Security\Authentication\JwtAuthenticationSuccessHandler:
decorates: 'lexik_jwt_authentication.handler.authentication_success'

Expand Down
36 changes: 36 additions & 0 deletions lib/RoadizCoreBundle/migrations/Version20230712171650.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

namespace RZ\Roadiz\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230712171650 extends AbstractMigration
{
public function getDescription(): string
{
return 'Removed useless login_attempts table';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE login_attempts');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE login_attempts (id INT AUTO_INCREMENT NOT NULL, ip_address VARCHAR(46) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, date DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', blocks_login_until DATETIME DEFAULT NULL, username VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, attempt_count INT DEFAULT NULL, INDEX IDX_9163C7FBEFF8A4EEF85E0677 (blocks_login_until, username), INDEX IDX_9163C7FBEFF8A4EEF85E067722FFD58C (blocks_login_until, username, ip_address), INDEX IDX_9163C7FBF85E0677 (username), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
}

public function isTransactional(): bool
{
return false;
}
}
43 changes: 0 additions & 43 deletions lib/RoadizCoreBundle/src/Console/CleanLoginAttemptCommand.php

This file was deleted.

54 changes: 0 additions & 54 deletions lib/RoadizCoreBundle/src/Console/PurgeLoginAttemptCommand.php

This file was deleted.

109 changes: 0 additions & 109 deletions lib/RoadizCoreBundle/src/Entity/LoginAttempt.php

This file was deleted.

This file was deleted.

Loading

0 comments on commit f7e2a39

Please sign in to comment.