Add webauthn_credential table

This is to store data for registered webauthn credentials, so
platform admins can later use them to log in.
This commit is contained in:
Pea Tyczynska
2021-05-07 16:08:34 +01:00
committed by Leo Hemsted
parent bb6cbf7a65
commit 3798a3bd1d
2 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
"""
Revision ID: 0355_add_webauthn_table
Revises: 0354_government_channel
Create Date: 2021-05-07 17:04:22.017137
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0355_add_webauthn_table'
down_revision = '0354_government_channel'
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
'webauthn_credential',
sa.Column('credential_id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('aaguid', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('public_key', sa.String(), nullable=False),
sa.Column('user_id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('registration_response', postgresql.JSONB(none_as_null=True, astext_type=sa.Text()), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('credential_id', 'user_id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('webauthn_credential')
# ### end Alembic commands ###