I am using Authlib (1.6.5) with Flask (3.1.2) and SQLAlchemy (2.0.43), extending the provided sqla_mixins.
When migrating to a database backend respecting the string maxlength (e.g. migrating from sqlite to postgres) I noticed that both access_token and refresh_token of authlib.integrations.sqla_oauth2.Oauth2TokenMixin (https://github.com/authlib/authlib/blob/main/authlib/integrations/sqla_oauth2/tokens_mixins.py#L51) are defined as String(255).
But my tokens are around 1000 bytes long, breaking the migration attempt.
As there is no actual maximal length for tokens (afaik), shouldn't this be of type Text()?
I can locally overwrite the token-types in my code, but wanted to report this as a problem for everyone using sqlalchemy.
I am using Authlib (1.6.5) with Flask (3.1.2) and SQLAlchemy (2.0.43), extending the provided sqla_mixins.
When migrating to a database backend respecting the string maxlength (e.g. migrating from sqlite to postgres) I noticed that both
access_tokenandrefresh_tokenofauthlib.integrations.sqla_oauth2.Oauth2TokenMixin(https://github.com/authlib/authlib/blob/main/authlib/integrations/sqla_oauth2/tokens_mixins.py#L51) are defined asString(255).But my tokens are around 1000 bytes long, breaking the migration attempt.
As there is no actual maximal length for tokens (afaik), shouldn't this be of type
Text()?I can locally overwrite the token-types in my code, but wanted to report this as a problem for everyone using sqlalchemy.