Skip to content

Use LobHandler in JdbcOAuth2AuthorizedClientService #9070

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

Conversation

candrews
Copy link
Contributor

@candrews candrews commented Oct 1, 2020

LobHandler provides an abstraction for handling large binary fields and large text
fields in specific databases, no matter if represented as simple types or
Large OBjects.

Its use provides compatibility with many databases eliminating the need
for custom OAuth2AuthorizedClientParametersMapper and
OAuth2AuthorizedClientRowMapper implementations.

This change brings JdbcOAuth2AuthorizedClientService into alignment with the best practices documented by Spring Framework at https://docs.spring.io/spring-framework/docs/5.2.9.RELEASE/spring-framework-reference/data-access.html#jdbc-lob

The problem that this PR fixes has been raised in a number of issues, including:
#9023
#8862
#8539

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 1, 2020
@candrews candrews force-pushed the JdbcOAuth2AuthorizedClientService-LobHandler branch from 6542724 to 1c86e74 Compare October 1, 2020 19:02
@candrews
Copy link
Contributor Author

@jgrandja could you please take a look at this PR? I'm eager to work with you to get it merged - thank you!

@jgrandja
Copy link
Contributor

Apologies for the delay @candrews. I've been very busy with the new Spring Authorization Server.

I'll review this early next week. Thanks for your patience.

@jgrandja jgrandja added in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 15, 2020
Copy link
Contributor

@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 @candrews !

I left some feedback for you. The requested changes are minor so this is close to being merged.

Can you please add Closes gh-9070 at the end of the commit message for the LobHandler and Issue gh-9070 at the end of the commit message for the Postgres.sql.

Also, please rebase on master.

@jgrandja jgrandja added this to the 5.5.0-M1 milestone Oct 21, 2020
LobHandler provides an abstraction for handling large binary fields and large text
fields in specific databases, no matter if represented as simple types or
Large OBjects.

Its use provides compatibility with many databases eliminating the need
for custom OAuth2AuthorizedClientParametersMapper and
OAuth2AuthorizedClientRowMapper implementations.

Closes spring-projectsgh-9070
…vice

Postgres doesn't have a BLOB type, but it does have an equivalent BYTEA
type.
This approach and naming convention follows the convention established
in Spring Session JDBC which has sql for each RDBMS with files names in
the pattern *-{dbname}.sql, for example:
schema-db2.sql
schema-derby.sql
schema-h2.sql
schema-mysql.sql
schema-postgresql.sql

See https://github.com/spring-projects/spring-session/tree/2.3.1.RELEASE/spring-session-jdbc/src/main/resources/org/springframework/session/jdbc

Issue spring-projectsgh-9070
@candrews candrews force-pushed the JdbcOAuth2AuthorizedClientService-LobHandler branch from 1c86e74 to 2595267 Compare October 21, 2020 14:23
@jgrandja jgrandja closed this in 05dc326 Oct 22, 2020
jgrandja pushed a commit that referenced this pull request Oct 22, 2020
…vice

Postgres doesn't have a BLOB type, but it does have an equivalent BYTEA
type.
This approach and naming convention follows the convention established
in Spring Session JDBC which has sql for each RDBMS with files names in
the pattern *-{dbname}.sql, for example:
schema-db2.sql
schema-derby.sql
schema-h2.sql
schema-mysql.sql
schema-postgresql.sql

See https://github.com/spring-projects/spring-session/tree/2.3.1.RELEASE/spring-session-jdbc/src/main/resources/org/springframework/session/jdbc

Issue gh-9070
@jgrandja
Copy link
Contributor

Thank you for this valuable enhancement @candrews ! This is now in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants