forked from ITISFoundation/osparc-simcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ web-api: request for an account deletion (🗃️) (ITISFoundation#4871)
- Loading branch information
Showing
33 changed files
with
665 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/models-library/src/models_library/api_schemas_webserver/auth.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from models_library.emails import LowerCaseEmailStr | ||
from pydantic import SecretStr | ||
|
||
from ._base import InputSchema | ||
|
||
|
||
class UnregisterCheck(InputSchema): | ||
email: LowerCaseEmailStr | ||
password: SecretStr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.8.0 | ||
0.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
..._postgres_database/migration/versions/be0dece4e67c_rm_created_ip_and_add_deleted_user_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"""rm created_ip and add DELETED user status | ||
Revision ID: be0dece4e67c | ||
Revises: 76d106b243c3 | ||
Create Date: 2023-10-23 17:36:46.349925+00:00 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "be0dece4e67c" | ||
down_revision = "76d106b243c3" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
column_name = "status" | ||
enum_typename = "userstatus" | ||
new_value = "DELETED" | ||
|
||
|
||
def upgrade(): | ||
# SEE https://medium.com/makimo-tech-blog/upgrading-postgresqls-enum-type-with-sqlalchemy-using-alembic-migration-881af1e30abe | ||
|
||
with op.get_context().autocommit_block(): | ||
op.execute(f"ALTER TYPE {enum_typename} ADD VALUE '{new_value}'") | ||
|
||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("users", "created_ip") | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
|
||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column( | ||
"users", | ||
sa.Column("created_ip", sa.VARCHAR(), autoincrement=False, nullable=True), | ||
) | ||
# ### end Alembic commands ### | ||
|
||
# NOTE: Downgrade new updates requires re-building the entire enum! | ||
op.execute(f"ALTER TYPE {enum_typename} RENAME TO {enum_typename}_old") | ||
op.execute( | ||
f"CREATE TYPE {enum_typename} AS ENUM('CONFIRMATION_PENDING', 'ACTIVE', 'BANNED')" | ||
) | ||
op.execute( | ||
f"ALTER TABLE users ALTER COLUMN {column_name} TYPE {enum_typename} USING " | ||
f"{column_name}::text::{enum_typename}" | ||
) | ||
op.execute(f"DROP TYPE {enum_typename}_old") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
id,name,email,password_hash,status,role,created_at,created_ip | ||
21,devops,[email protected],$5$rounds=1000$jjUWjHSG5F2dMKw.$9VRlE4YLl4bPfIrWkDz/8GtEx1XkzTpuZzyc/uiBFE4,ACTIVE,USER,2019-06-27 11:35:44.828696,172.16.8.64 | ||
id,name,email,password_hash,status,role,created_at | ||
21,devops,[email protected],$5$rounds=1000$jjUWjHSG5F2dMKw.$9VRlE4YLl4bPfIrWkDz/8GtEx1XkzTpuZzyc/uiBFE4,ACTIVE,USER,2019-06-27 11:35:44.828696 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.34.0 | ||
0.35.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.