diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/JdbcOAuth2AuthorizationConsentService.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/JdbcOAuth2AuthorizationConsentService.java index d1234319..ef6a5af1 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/JdbcOAuth2AuthorizationConsentService.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/JdbcOAuth2AuthorizationConsentService.java @@ -56,7 +56,7 @@ import org.springframework.util.StringUtils; * @see RowMapper * @since 0.1.2 */ -public final class JdbcOAuth2AuthorizationConsentService implements OAuth2AuthorizationConsentService { +public class JdbcOAuth2AuthorizationConsentService implements OAuth2AuthorizationConsentService { // @formatter:off private static final String COLUMN_NAMES = "registered_client_id, " @@ -169,7 +169,7 @@ public final class JdbcOAuth2AuthorizationConsentService implements OAuth2Author * @param authorizationConsentRowMapper the {@link RowMapper} used for mapping the current * row in {@code ResultSet} to {@link OAuth2AuthorizationConsent} */ - public void setAuthorizationConsentRowMapper(RowMapper authorizationConsentRowMapper) { + public final void setAuthorizationConsentRowMapper(RowMapper authorizationConsentRowMapper) { Assert.notNull(authorizationConsentRowMapper, "authorizationConsentRowMapper cannot be null"); this.authorizationConsentRowMapper = authorizationConsentRowMapper; } @@ -182,12 +182,24 @@ public final class JdbcOAuth2AuthorizationConsentService implements OAuth2Author * @param authorizationConsentParametersMapper the {@code Function} used for mapping * {@link OAuth2AuthorizationConsent} to a {@code List} of {@link SqlParameterValue} */ - public void setAuthorizationConsentParametersMapper( + public final void setAuthorizationConsentParametersMapper( Function> authorizationConsentParametersMapper) { Assert.notNull(authorizationConsentParametersMapper, "authorizationConsentParametersMapper cannot be null"); this.authorizationConsentParametersMapper = authorizationConsentParametersMapper; } + protected final JdbcOperations getJdbcOperations() { + return this.jdbcOperations; + } + + protected final RowMapper getAuthorizationConsentRowMapper() { + return this.authorizationConsentRowMapper; + } + + protected final Function> getAuthorizationConsentParametersMapper() { + return this.authorizationConsentParametersMapper; + } + /** * The default {@link RowMapper} that maps the current row in * {@code ResultSet} to {@link OAuth2AuthorizationConsent}. @@ -223,6 +235,11 @@ public final class JdbcOAuth2AuthorizationConsentService implements OAuth2Author } return builder.build(); } + + protected final RegisteredClientRepository getRegisteredClientRepository() { + return this.registeredClientRepository; + } + } /** @@ -244,6 +261,7 @@ public final class JdbcOAuth2AuthorizationConsentService implements OAuth2Author parameters.add(new SqlParameterValue(Types.VARCHAR, StringUtils.collectionToDelimitedString(authorities, ","))); return parameters; } + } }