Write new secret manager using existing RSA logic
This commit is contained in:
@ -0,0 +1,44 @@
|
||||
"""Implement db structures for internal password manager
|
||||
|
||||
Revision ID: 84356d0ea85f
|
||||
Revises: 6c148590471f
|
||||
Create Date: 2025-06-21 07:21:02.257865
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '84356d0ea85f'
|
||||
down_revision: Union[str, None] = '6c148590471f'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('groups',
|
||||
sa.Column('id', sa.Uuid(), nullable=False),
|
||||
sa.Column('name', sa.String(), nullable=False),
|
||||
sa.Column('parent_id', sa.Uuid(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['parent_id'], ['groups.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
with op.batch_alter_table('password_db', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('client_id', sa.Uuid(), nullable=True))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('password_db', schema=None) as batch_op:
|
||||
batch_op.drop_column('client_id')
|
||||
|
||||
op.drop_table('groups')
|
||||
# ### end Alembic commands ###
|
||||
@ -0,0 +1,48 @@
|
||||
"""Implement managed secrets
|
||||
|
||||
Revision ID: c34707a1ea3a
|
||||
Revises: 84356d0ea85f
|
||||
Create Date: 2025-06-21 07:38:12.994535
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'c34707a1ea3a'
|
||||
down_revision: Union[str, None] = '84356d0ea85f'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('managed_secrets',
|
||||
sa.Column('id', sa.Uuid(), nullable=False),
|
||||
sa.Column('name', sa.String(), nullable=False),
|
||||
sa.Column('is_deleted', sa.Boolean(), nullable=False),
|
||||
sa.Column('group_id', sa.Uuid(), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=False),
|
||||
sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=True),
|
||||
sa.Column('deleted_at', sa.DateTime(timezone=True), nullable=True),
|
||||
sa.ForeignKeyConstraint(['group_id'], ['groups.id'], ondelete='SET NULL'),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
with op.batch_alter_table('groups', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('description', sa.String(), nullable=True))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('groups', schema=None) as batch_op:
|
||||
batch_op.drop_column('description')
|
||||
|
||||
op.drop_table('managed_secrets')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user