feat: add encrypted columns for providers, sandbox/agent variables, mcp auth code [LET-4246] (#5187)

add encrypted columns

Co-authored-by: Letta Bot <noreply@letta.com>
This commit is contained in:
jnjpng
2025-10-06 15:25:31 -07:00
committed by Caren Thomas
parent 757bbcac37
commit 7930bfeb0b
4 changed files with 53 additions and 3 deletions

View File

@@ -0,0 +1,39 @@
"""add encrypted columns
Revision ID: b6061da886ee
Revises: 89b595051e48
Create Date: 2025-10-06 14:55:32.554544
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision: str = "b6061da886ee"
down_revision: Union[str, None] = "89b595051e48"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("agent_environment_variables", sa.Column("value_enc", sa.Text(), nullable=True))
op.add_column("mcp_oauth", sa.Column("authorization_code_enc", sa.Text(), nullable=True))
op.add_column("providers", sa.Column("api_key_enc", sa.Text(), nullable=True))
op.add_column("providers", sa.Column("access_key_enc", sa.Text(), nullable=True))
op.add_column("sandbox_environment_variables", sa.Column("value_enc", sa.Text(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("sandbox_environment_variables", "value_enc")
op.drop_column("providers", "access_key_enc")
op.drop_column("providers", "api_key_enc")
op.drop_column("mcp_oauth", "authorization_code_enc")
op.drop_column("agent_environment_variables", "value_enc")
# ### end Alembic commands ###