Skip to content

Refresh token text limit #4456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions backend/alembic/versions/cf90764725d8_larger_refresh_tokens.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""larger refresh tokens

Revision ID: cf90764725d8
Revises: 4794bc13e484
Create Date: 2025-04-04 10:56:39.769294

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "cf90764725d8"
down_revision = "4794bc13e484"
branch_labels = None
depends_on = None


def upgrade() -> None:
op.alter_column("oauth_account", "refresh_token", type_=sa.Text())


def downgrade() -> None:
op.alter_column("oauth_account", "refresh_token", type_=sa.String(length=1024))
1 change: 1 addition & 0 deletions backend/onyx/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def process_result_value(self, value: str | None, dialect: Dialect) -> str | Non
class OAuthAccount(SQLAlchemyBaseOAuthAccountTableUUID, Base):
# even an almost empty token from keycloak will not fit the default 1024 bytes
access_token: Mapped[str] = mapped_column(Text, nullable=False) # type: ignore
refresh_token: Mapped[str] = mapped_column(Text, nullable=False) # type: ignore


class User(SQLAlchemyBaseUserTableUUID, Base):
Expand Down
Loading