From d191bcc8ac57e23e367ec21c588bd08b85daeef8 Mon Sep 17 00:00:00 2001 From: Joe Grandja Date: Thu, 28 Sep 2017 09:01:58 -0400 Subject: [PATCH] Remove ClientRegistrationRepository.findByClientId() Fixes gh-4583 --- .../registration/ClientRegistrationRepository.java | 4 ---- .../InMemoryClientRegistrationRepository.java | 9 --------- 2 files changed, 13 deletions(-) diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/ClientRegistrationRepository.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/ClientRegistrationRepository.java index 14d8acd741..5785792e0b 100644 --- a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/ClientRegistrationRepository.java +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/ClientRegistrationRepository.java @@ -15,8 +15,6 @@ */ package org.springframework.security.oauth2.client.registration; -import java.util.List; - /** * A repository for OAuth 2.0 / OpenID Connect 1.0 {@link ClientRegistration}'s. * @@ -33,8 +31,6 @@ import java.util.List; */ public interface ClientRegistrationRepository { - List findByClientId(String clientId); - ClientRegistration findByRegistrationId(String registrationId); } diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/InMemoryClientRegistrationRepository.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/InMemoryClientRegistrationRepository.java index 44ed6f285b..b561418e86 100644 --- a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/InMemoryClientRegistrationRepository.java +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/registration/InMemoryClientRegistrationRepository.java @@ -21,7 +21,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * A {@link ClientRegistrationRepository} that stores {@link ClientRegistration}(s) in-memory. @@ -47,14 +46,6 @@ public final class InMemoryClientRegistrationRepository implements ClientRegistr this.registrations = Collections.unmodifiableMap(registrationsMap); } - @Override - public List findByClientId(String clientId) { - Assert.hasText(clientId, "clientId cannot be empty"); - return this.registrations.values().stream() - .filter(registration -> registration.getClientId().equals(clientId)) - .collect(Collectors.toList()); - } - @Override public ClientRegistration findByRegistrationId(String registrationId) { Assert.hasText(registrationId, "registrationId cannot be empty");