mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-05 08:40:29 -04:00
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:
committed by
Leo Hemsted
parent
bb6cbf7a65
commit
3798a3bd1d
37
migrations/versions/0355_add_webauthn_table.py
Normal file
37
migrations/versions/0355_add_webauthn_table.py
Normal 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 ###
|
||||
Reference in New Issue
Block a user