From 387dd9423481ce186ef0fbd7dac5770efef273e6 Mon Sep 17 00:00:00 2001 From: Garry Childs Date: Tue, 11 Apr 2023 20:25:17 +0100 Subject: [PATCH] Database entity changes --- CHANGELOG.md | 4 ++++ config/doctrine.auth.config.local.php.dist | 4 ++-- src/Command/DecryptEntityCommand.php | 2 +- src/Entity/BaseUsers.php | 2 +- src/Entity/FailedLoginAttemptsLog.php | 2 +- src/Entity/IpBlocked.php | 2 +- src/Entity/LoginLog.php | 2 +- src/Entity/PasswordReminder.php | 6 +++--- src/Entity/TwoFactorAuthMethods.php | 2 +- src/Entity/UserRoles.php | 2 +- 10 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb76aba..9a9485c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,3 +54,7 @@ Fixed bug where Google 2FA did not work with leading zero 0.3.3 Fixed command line error when no encryption set Changed email/sms code type to string + +0.3.4 Changed auto generated id's to unsigned int (may break database) + +0.3.5 Changed type hint for PasswordReminder::setDateCreated() to DateTimeInterface diff --git a/config/doctrine.auth.config.local.php.dist b/config/doctrine.auth.config.local.php.dist index 9658e9c..69645ed 100644 --- a/config/doctrine.auth.config.local.php.dist +++ b/config/doctrine.auth.config.local.php.dist @@ -47,8 +47,8 @@ return [ * Encryption */ 'encryptData' => false, // Encrypt user data, default = false - 'rsaPrivateKeyFile' => 'rsa/id_rsa.pem', // <- path and filename of your rsa private key @see https://docs.rightscale.com/faq/How_Do_I_Generate_My_Own_SSH_Key_Pair.html - 'rsaPublicKeyFile' => 'rsa/id_rsa.pub', // <- path and filename of your rsa public key + 'rsaPrivateKeyFile' => 'rsa/key.pem', // <- path and filename of your rsa private key @see https://docs.rightscale.com/faq/How_Do_I_Generate_My_Own_SSH_Key_Pair.html + 'rsaPublicKeyFile' => 'rsa/key.pub', // <- path and filename of your rsa public key 'rsaKeyPassphrase' => 'passphrase', // Optional passphrase used when creating the above keys /** * Registration diff --git a/src/Command/DecryptEntityCommand.php b/src/Command/DecryptEntityCommand.php index 41d3308..26289df 100644 --- a/src/Command/DecryptEntityCommand.php +++ b/src/Command/DecryptEntityCommand.php @@ -32,7 +32,7 @@ protected function configure() ->setDescription('Decrypt given entitys data') ->setHelp( <<addArgument('entity', InputArgument::REQUIRED, 'Entity class to decrypt, must be instance of FwsDoctrineAuth\Entity\EntityInterface') diff --git a/src/Entity/BaseUsers.php b/src/Entity/BaseUsers.php index 43857c6..5c4394f 100644 --- a/src/Entity/BaseUsers.php +++ b/src/Entity/BaseUsers.php @@ -31,7 +31,7 @@ class BaseUsers implements EntityInterface /** * @var int|null * - * @ORM\Column(name="user_id", type="integer", nullable=false) + * @ORM\Column(name="user_id", type="integer", options={"unsigned"=true}, nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ diff --git a/src/Entity/FailedLoginAttemptsLog.php b/src/Entity/FailedLoginAttemptsLog.php index a74d51c..588129f 100644 --- a/src/Entity/FailedLoginAttemptsLog.php +++ b/src/Entity/FailedLoginAttemptsLog.php @@ -16,7 +16,7 @@ class FailedLoginAttemptsLog implements EntityInterface { /** * @var int|null - * @ORM\Column(name="login_attempt_id", type="integer", nullable=false) + * @ORM\Column(name="login_attempt_id", type="integer", options={"unsigned"=true}, nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ diff --git a/src/Entity/IpBlocked.php b/src/Entity/IpBlocked.php index a1a2cf9..02ec8d3 100644 --- a/src/Entity/IpBlocked.php +++ b/src/Entity/IpBlocked.php @@ -22,7 +22,7 @@ class IpBlocked implements EntityInterface /** * @var int|null - * @ORM\Column(name="block_id", type="integer", nullable=false) + * @ORM\Column(name="block_id", type="integer", options={"unsigned"=true}, nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ diff --git a/src/Entity/LoginLog.php b/src/Entity/LoginLog.php index e901683..418c288 100644 --- a/src/Entity/LoginLog.php +++ b/src/Entity/LoginLog.php @@ -18,7 +18,7 @@ class LoginLog implements EntityInterface /** * @var int|null - * @ORM\Column(name="log_id", type="integer", nullable=false) + * @ORM\Column(name="log_id", type="integer", options={"unsigned"=true}, nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ diff --git a/src/Entity/PasswordReminder.php b/src/Entity/PasswordReminder.php index a123b05..afc9028 100644 --- a/src/Entity/PasswordReminder.php +++ b/src/Entity/PasswordReminder.php @@ -23,7 +23,7 @@ class PasswordReminder implements EntityInterface /** * @var int|null - * @ORM\Column(name="password_reminder_id", type="integer", nullable=false) + * @ORM\Column(name="password_reminder_id", type="integer", options={"unsigned"=true}, nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ @@ -119,10 +119,10 @@ public function setUser(BaseUsers $user) /** * - * @param DateTimeImmutable $dateCreated + * @param DateTimeInterface $dateCreated * @return $this */ - public function setDateCreated(DateTimeImmutable $dateCreated) + public function setDateCreated(DateTimeInterface $dateCreated) { $this->dateCreated = $dateCreated; return $this; diff --git a/src/Entity/TwoFactorAuthMethods.php b/src/Entity/TwoFactorAuthMethods.php index 167989f..bddecb0 100644 --- a/src/Entity/TwoFactorAuthMethods.php +++ b/src/Entity/TwoFactorAuthMethods.php @@ -19,7 +19,7 @@ class TwoFactorAuthMethods implements EntityInterface /** * @var int|null - * @ORM\Column(name="auth_method_id", type="integer", nullable=false) + * @ORM\Column(name="auth_method_id", type="integer", options={"unsigned"=true}, nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ diff --git a/src/Entity/UserRoles.php b/src/Entity/UserRoles.php index 1de100f..f8a485b 100644 --- a/src/Entity/UserRoles.php +++ b/src/Entity/UserRoles.php @@ -24,7 +24,7 @@ class UserRoles implements EntityInterface /** * @var int|null * - * @ORM\Column(name="user_role_id", type="integer", nullable=false) + * @ORM\Column(name="user_role_id", type="integer", options={"unsigned"=true}, nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */