Advanced Authentication

This commit is contained in:
Mawoka
2022-12-18 18:31:06 +01:00
parent bb848adca8
commit 2e159af134
29 changed files with 3315 additions and 1620 deletions
@@ -0,0 +1,40 @@
"""Added webauthn
Revision ID: 25f2c34a69c8
Revises: 97144a8cf6b6
Create Date: 2022-12-17 16:53:28.909124
"""
from alembic import op
import sqlalchemy as sa
import ormar
# revision identifiers, used by Alembic.
revision = "25f2c34a69c8"
down_revision = "97144a8cf6b6"
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"fido_credentials",
sa.Column("pk", sa.Integer(), nullable=False),
sa.Column("id", sa.LargeBinary(length=256), nullable=False),
sa.Column("public_key", sa.LargeBinary(length=256), nullable=False),
sa.Column("sign_count", sa.Integer(), nullable=False),
sa.Column("user", ormar.fields.sqlalchemy_uuid.CHAR(32), nullable=True),
sa.ForeignKeyConstraint(["user"], ["users.id"], name="fk_fido_credentials_users_id_user"),
sa.PrimaryKeyConstraint("pk"),
)
op.add_column("users", sa.Column("require_password", sa.Boolean(), nullable=False))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("users", "require_password")
op.drop_table("fido_credentials")
# ### end Alembic commands ###