API - add routes to manage oauth clients

This commit is contained in:
Sam
2022-05-28 15:36:18 +02:00
parent ca9ba138b3
commit 489710c29d
9 changed files with 564 additions and 21 deletions

View File

@ -30,6 +30,7 @@ def upgrade():
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_oauth2_client_client_id'), 'oauth2_client', ['client_id'], unique=False)
op.create_index(op.f('ix_oauth2_client_user_id'), 'oauth2_client', ['user_id'], unique=False)
op.create_table('oauth2_code',
sa.Column('code', sa.String(length=120), nullable=False),
sa.Column('client_id', sa.String(length=48), nullable=True),
@ -46,6 +47,8 @@ def upgrade():
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('code')
)
op.create_index('ix_oauth2_code_client_id', 'oauth2_code', ['client_id'], unique=False)
op.create_index(op.f('ix_oauth2_code_user_id'), 'oauth2_code', ['user_id'], unique=False)
op.create_table('oauth2_token',
sa.Column('client_id', sa.String(length=48), nullable=True),
sa.Column('token_type', sa.String(length=40), nullable=True),
@ -63,14 +66,19 @@ def upgrade():
sa.UniqueConstraint('access_token')
)
op.create_index(op.f('ix_oauth2_token_refresh_token'), 'oauth2_token', ['refresh_token'], unique=False)
op.create_index(op.f('ix_oauth2_token_user_id'), 'oauth2_token', ['user_id'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_oauth2_token_user_id'), table_name='oauth2_token')
op.drop_index(op.f('ix_oauth2_token_refresh_token'), table_name='oauth2_token')
op.drop_table('oauth2_token')
op.drop_index(op.f('ix_oauth2_code_user_id'), table_name='oauth2_code')
op.drop_index('ix_oauth2_code_client_id', table_name='oauth2_code')
op.drop_table('oauth2_code')
op.drop_index(op.f('ix_oauth2_client_user_id'), table_name='oauth2_client')
op.drop_index(op.f('ix_oauth2_client_client_id'), table_name='oauth2_client')
op.drop_table('oauth2_client')
# ### end Alembic commands ###