mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that the login account should be locked after N number of attempts. N is configurable using the 'MAX_LOGIN_ATTEMPTS' parameter. Fixes #6337
This commit is contained in:
committed by
Akshay Joshi
parent
c2db647379
commit
a3d3c74e67
33
web/migrations/versions/6650c52670c2_.py
Normal file
33
web/migrations/versions/6650c52670c2_.py
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
"""empty message
|
||||
|
||||
Revision ID: 6650c52670c2
|
||||
Revises: c465fee44968
|
||||
Create Date: 2021-07-10 18:12:38.821602
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
from pgadmin import db
|
||||
|
||||
revision = '6650c52670c2'
|
||||
down_revision = 'c465fee44968'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
db.engine.execute(
|
||||
'ALTER TABLE user ADD COLUMN locked BOOLEAN DEFAULT FALSE'
|
||||
)
|
||||
db.engine.execute(
|
||||
'ALTER TABLE user ADD COLUMN login_attempts int DEFAULT 0'
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
# pgAdmin only upgrades, downgrade not implemented.
|
||||
pass
|
||||
Reference in New Issue
Block a user