Remove deprecations in AuthorizationRequestRepository

Closes gh-11519
This commit is contained in:
Joe Grandja 2022-07-15 08:07:02 -04:00
parent e12823095f
commit 0e291a3295
2 changed files with 6 additions and 26 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -56,19 +56,6 @@ public interface AuthorizationRequestRepository<T extends OAuth2AuthorizationReq
*/
void saveAuthorizationRequest(T authorizationRequest, HttpServletRequest request, HttpServletResponse response);
/**
* Removes and returns the {@link OAuth2AuthorizationRequest} associated to the
* provided {@code HttpServletRequest} or if not available returns {@code null}.
* @param request the {@code HttpServletRequest}
* @return the removed {@link OAuth2AuthorizationRequest} or {@code null} if not
* available
* @deprecated Use
* {@link #removeAuthorizationRequest(HttpServletRequest, HttpServletResponse)}
* instead
*/
@Deprecated
T removeAuthorizationRequest(HttpServletRequest request);
/**
* Removes and returns the {@link OAuth2AuthorizationRequest} associated to the
* provided {@code HttpServletRequest} and {@code HttpServletResponse} or if not
@ -78,8 +65,6 @@ public interface AuthorizationRequestRepository<T extends OAuth2AuthorizationReq
* @return the {@link OAuth2AuthorizationRequest} or {@code null} if not available
* @since 5.1
*/
default T removeAuthorizationRequest(HttpServletRequest request, HttpServletResponse response) {
return removeAuthorizationRequest(request);
}
T removeAuthorizationRequest(HttpServletRequest request, HttpServletResponse response);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -81,8 +81,10 @@ public final class HttpSessionOAuth2AuthorizationRequestRepository
}
@Override
public OAuth2AuthorizationRequest removeAuthorizationRequest(HttpServletRequest request) {
public OAuth2AuthorizationRequest removeAuthorizationRequest(HttpServletRequest request,
HttpServletResponse response) {
Assert.notNull(request, "request cannot be null");
Assert.notNull(response, "response cannot be null");
String stateParameter = this.getStateParameter(request);
if (stateParameter == null) {
return null;
@ -102,13 +104,6 @@ public final class HttpSessionOAuth2AuthorizationRequestRepository
return originalRequest;
}
@Override
public OAuth2AuthorizationRequest removeAuthorizationRequest(HttpServletRequest request,
HttpServletResponse response) {
Assert.notNull(response, "response cannot be null");
return this.removeAuthorizationRequest(request);
}
/**
* Gets the state parameter from the {@link HttpServletRequest}
* @param request the request to use