Skip to content

JdbcOAuth2AuthorizationService supports clob and text datatype for token columns #491

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

Closed
wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 12, 2021

Use CLOB instead of BLOB. With CLOB type the underlying schema can store varchars and clobs as well (if this is supported by the database)

Closes gh-480

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 12, 2021
@ghost ghost marked this pull request as ready for review November 15, 2021 14:39
@jgrandja jgrandja self-assigned this Nov 15, 2021
@jgrandja jgrandja added status: duplicate A duplicate of another issue type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 15, 2021
@jgrandja jgrandja added this to the 0.2.1 milestone Nov 15, 2021
Copy link
Collaborator

@jgrandja jgrandja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @ovidiupopa91.

The changes do work for Postgres but doesn't work anymore for oauth2_authorization tables that have already defined blob. The changes will force applications to update the schema.

We'll need to come up with a backwards compatible strategy. For now, I'm going to push this to the 0.2.2 release to allow for more time.

@jgrandja jgrandja modified the milestones: 0.2.1, 0.2.2 Nov 26, 2021
@jgrandja jgrandja changed the title Change blob datatype to varchar when saving Oauth2Authorization to the database Change blob datatype to clob when saving Oauth2Authorization to the database Jan 6, 2022
@jgrandja
Copy link
Collaborator

Hi @ovidiupopa91 and Happy New year! I hope you had a relaxing break :)

Just touching base to see how the updates are coming along?

@ghost
Copy link
Author

ghost commented Jan 11, 2022

hi @jgrandja . Happy New Year to you too! Actually, this is my first day back. I will check today if anything else needs to be done (as far as I can remember the implementation is done, and all tests are passing except one or two).

@jgrandja
Copy link
Collaborator

Welcome back @ovidiupopa91 !

Just a heads up that more changes will be required. My suggestion to change the column types to varchar will not work. Please see gh-550 and gh-557 for additional details.

We'll need to ensure that data items that have variable length data (e.g. access_token_value, access_token_metadata, attributes, etc.) are defined with a standard sql type that will allow for variable length without restricting size, e.g clob or text.

Can you look into which standard sql type would work for at least mysql and postgres and we can decide from there. Thanks!

@ghost
Copy link
Author

ghost commented Jan 14, 2022

hi @jgrandja . Based on postgresql datatypes and mysql datatypes text sql data type should work for mysql and postgresql.

I will change the schema to use text instead of clob for all columns that might have variable length data.

@jgrandja
Copy link
Collaborator

Thanks for looking into this @ovidiupopa91. Although text is not a standard sql type, it seems to be used by a few well-known vendors so let's go with it.

I will change the schema to use text instead of clob for all columns that might have variable length data.

Only change the columns that have blob defined to text in this PR. For the other columns, e.g. access_token_metadata, attributes, etc. can you submit a new PR?

@ghost
Copy link
Author

ghost commented Jan 19, 2022

hi @jgrandja . I've pushed the updated implementation. Do you think it's still necessary to have a different file where the token columns are defined as text?

Copy link
Collaborator

@jgrandja jgrandja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @ovidiupopa91. Please see review comments.

@jgrandja
Copy link
Collaborator

@ovidiupopa91 Will you be able to submit the updates by tomorrow? I'd like to get this into the release this Wed. If you don't have time, no worries, I can submit it. Please let me know.

@ghost
Copy link
Author

ghost commented Jan 24, 2022

@ovidiupopa91 Will you be able to submit the updates by tomorrow? I'd like to get this into the release this Wed. If you don't have time, no worries, I can submit it. Please let me know.

hi @jgrandja . I've just pushed the changes. Sorry for the delay but I was quite backlogged in the last couple of weeks.
FYI, I've decided to keep oauth2-authorization-schema-postgres.sql because HSQL is not supporting text data type. The alternative would be to create the type TEXT before the tests are running.

@ghost ghost requested a review from jgrandja January 24, 2022 11:05
@jgrandja
Copy link
Collaborator

Thanks @ovidiupopa91 ! I'll look at this tomorrow and get it merged.

@jgrandja jgrandja changed the title Change blob datatype to clob when saving Oauth2Authorization to the database JdbcOAuth2AuthorizationService supports clob and text datatype for token columns Jan 25, 2022
jgrandja added a commit that referenced this pull request Jan 25, 2022
@jgrandja
Copy link
Collaborator

Thanks for all the updates @ovidiupopa91.

FYI, I added a polish commit and just merged this into main.

@jgrandja jgrandja closed this Jan 25, 2022
@ghost ghost deleted the gh-480 branch January 25, 2022 19:20
@ghost
Copy link
Author

ghost commented Jan 25, 2022

Great @jgrandja . Let me know when you have anything else that I can take a look at. Thanks!

@jgrandja
Copy link
Collaborator

For sure @ovidiupopa91. I'll get back to you soon.

@jgrandja
Copy link
Collaborator

Hi @ovidiupopa91. Would you be interested in gh-417 or gh-616?

@ghost
Copy link
Author

ghost commented Feb 19, 2022

Hi @ovidiupopa91. Would you be interested in gh-417 or gh-616?

Hi @jgrandja . I can take a look and fix both of them if that's ok with you.

@jgrandja
Copy link
Collaborator

Sounds good @ovidiupopa91 ! Please respond on both issues and I'll assign to you.

doba16 pushed a commit to doba16/spring-authorization-server that referenced this pull request Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JdbcOAuth2AuthorizationService should support clob and text datatype for token columns
3 participants