From 692ce0cd91d3181aed3a5410203444e2bc94c76e Mon Sep 17 00:00:00 2001 From: Alexander Schwartz Date: Thu, 23 Jun 2022 16:25:29 +0200 Subject: [PATCH] Moving ClientStorageProvider to the legacy modules This prepares the move of CachedObject and CacheableStorageProviderModel Closes #12531 fixup! Moving ClientStorageProvider to the legacy modules --- .../main/module.xml | 3 ++ .../keycloak-services/main/module.xml | 3 -- .../main/module.xml | 3 ++ .../keycloak-services/main/module.xml | 3 -- .../org/keycloak/models/jpa/RealmAdapter.java | 2 +- .../models/cache/CachedRealmModel.java | 3 +- .../storage/ClientStorageManager.java | 3 +- .../client/AbstractClientStorageAdapter.java | 0 .../AbstractReadOnlyClientScopeAdapter.java | 0 .../AbstractReadOnlyClientStorageAdapter.java | 0 .../client/ClientStorageProviderFactory.java | 0 .../client/ClientStorageProviderSpi.java | 0 ...pportedOperationsClientStorageAdapter.java | 0 .../services/org.keycloak.provider.Spi | 1 + .../admin/ClientStorageProviderResource.java | 0 .../OpenshiftClientStorageProvider.java | 0 ...OpenshiftClientStorageProviderFactory.java | 0 .../openshift/OpenshiftSAClientAdapter.java | 0 ...torage.client.ClientStorageProviderFactory | 0 .../org/keycloak/models/LegacyRealmModel.java | 50 +++++++++++++++++++ .../storage/client/ClientStorageProvider.java | 0 .../client/ClientStorageProviderModel.java | 0 .../models/map/user/MapUserProvider.java | 30 ----------- .../services/org.keycloak.provider.Spi | 1 - .../java/org/keycloak/models/RealmModel.java | 22 -------- services/pom.xml | 4 -- .../FacebookIdentityProviderConfig.java | 2 - .../DefaultHttpClientFactoryTest.java | 3 +- 28 files changed, 63 insertions(+), 70 deletions(-) rename {server-spi-private => model/legacy-private}/src/main/java/org/keycloak/models/cache/CachedRealmModel.java (94%) rename {server-spi-private => model/legacy-private}/src/main/java/org/keycloak/storage/client/AbstractClientStorageAdapter.java (100%) rename {server-spi-private => model/legacy-private}/src/main/java/org/keycloak/storage/client/AbstractReadOnlyClientScopeAdapter.java (100%) rename {server-spi-private => model/legacy-private}/src/main/java/org/keycloak/storage/client/AbstractReadOnlyClientStorageAdapter.java (100%) rename {server-spi-private => model/legacy-private}/src/main/java/org/keycloak/storage/client/ClientStorageProviderFactory.java (100%) rename {server-spi-private => model/legacy-private}/src/main/java/org/keycloak/storage/client/ClientStorageProviderSpi.java (100%) rename {server-spi-private => model/legacy-private}/src/main/java/org/keycloak/storage/client/UnsupportedOperationsClientStorageAdapter.java (100%) rename {services => model/legacy-services}/src/main/java/org/keycloak/services/resources/admin/ClientStorageProviderResource.java (100%) rename {services => model/legacy-services}/src/main/java/org/keycloak/storage/openshift/OpenshiftClientStorageProvider.java (100%) rename {services => model/legacy-services}/src/main/java/org/keycloak/storage/openshift/OpenshiftClientStorageProviderFactory.java (100%) rename {services => model/legacy-services}/src/main/java/org/keycloak/storage/openshift/OpenshiftSAClientAdapter.java (100%) rename {services => model/legacy-services}/src/main/resources/META-INF/services/org.keycloak.storage.client.ClientStorageProviderFactory (100%) create mode 100644 model/legacy/src/main/java/org/keycloak/models/LegacyRealmModel.java rename {server-spi => model/legacy}/src/main/java/org/keycloak/storage/client/ClientStorageProvider.java (100%) rename {server-spi => model/legacy}/src/main/java/org/keycloak/storage/client/ClientStorageProviderModel.java (100%) diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-model-legacy-services/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-model-legacy-services/main/module.xml index 2977d0ab67..ffb6b94fd5 100755 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-model-legacy-services/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-model-legacy-services/main/module.xml @@ -39,6 +39,9 @@ + + + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-services/main/module.xml b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-services/main/module.xml index f684415ff7..5a59a5c2c6 100755 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-services/main/module.xml +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-services/main/module.xml @@ -48,9 +48,6 @@ - - - diff --git a/distribution/galleon-feature-packs/server-galleon-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-model-legacy-services/main/module.xml b/distribution/galleon-feature-packs/server-galleon-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-model-legacy-services/main/module.xml index 2977d0ab67..ffb6b94fd5 100755 --- a/distribution/galleon-feature-packs/server-galleon-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-model-legacy-services/main/module.xml +++ b/distribution/galleon-feature-packs/server-galleon-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-model-legacy-services/main/module.xml @@ -39,6 +39,9 @@ + + + diff --git a/distribution/galleon-feature-packs/server-galleon-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-services/main/module.xml b/distribution/galleon-feature-packs/server-galleon-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-services/main/module.xml index f684415ff7..5a59a5c2c6 100755 --- a/distribution/galleon-feature-packs/server-galleon-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-services/main/module.xml +++ b/distribution/galleon-feature-packs/server-galleon-pack/src/main/resources/modules/system/layers/keycloak/org/keycloak/keycloak-services/main/module.xml @@ -48,9 +48,6 @@ - - - diff --git a/model/jpa/src/main/java/org/keycloak/models/jpa/RealmAdapter.java b/model/jpa/src/main/java/org/keycloak/models/jpa/RealmAdapter.java index b7ec4e51c0..41fe39dd30 100755 --- a/model/jpa/src/main/java/org/keycloak/models/jpa/RealmAdapter.java +++ b/model/jpa/src/main/java/org/keycloak/models/jpa/RealmAdapter.java @@ -43,7 +43,7 @@ import static org.keycloak.utils.StreamsUtil.closing; * @author Bill Burke * @version $Revision: 1 $ */ -public class RealmAdapter implements RealmModel, JpaModel { +public class RealmAdapter implements LegacyRealmModel, JpaModel { protected static final Logger logger = Logger.getLogger(RealmAdapter.class); protected RealmEntity realm; protected EntityManager em; diff --git a/server-spi-private/src/main/java/org/keycloak/models/cache/CachedRealmModel.java b/model/legacy-private/src/main/java/org/keycloak/models/cache/CachedRealmModel.java similarity index 94% rename from server-spi-private/src/main/java/org/keycloak/models/cache/CachedRealmModel.java rename to model/legacy-private/src/main/java/org/keycloak/models/cache/CachedRealmModel.java index 09111cc4bd..a20a4763d3 100644 --- a/server-spi-private/src/main/java/org/keycloak/models/cache/CachedRealmModel.java +++ b/model/legacy-private/src/main/java/org/keycloak/models/cache/CachedRealmModel.java @@ -17,6 +17,7 @@ package org.keycloak.models.cache; import org.keycloak.models.KeycloakSession; +import org.keycloak.models.LegacyRealmModel; import org.keycloak.models.RealmModel; import org.keycloak.provider.ProviderEvent; @@ -28,7 +29,7 @@ import java.util.concurrent.ConcurrentHashMap; * @author Bill Burke * @version $Revision: 1 $ */ -public interface CachedRealmModel extends RealmModel { +public interface CachedRealmModel extends LegacyRealmModel { interface RealmCachedEvent extends ProviderEvent { CachedRealmModel getRealm(); diff --git a/model/legacy-private/src/main/java/org/keycloak/storage/ClientStorageManager.java b/model/legacy-private/src/main/java/org/keycloak/storage/ClientStorageManager.java index b5e7fe48c7..f3f6591292 100644 --- a/model/legacy-private/src/main/java/org/keycloak/storage/ClientStorageManager.java +++ b/model/legacy-private/src/main/java/org/keycloak/storage/ClientStorageManager.java @@ -23,6 +23,7 @@ import org.keycloak.component.ComponentModel; import org.keycloak.models.ClientModel; import org.keycloak.models.ClientProvider; import org.keycloak.models.KeycloakSession; +import org.keycloak.models.LegacyRealmModel; import org.keycloak.models.ModelException; import org.keycloak.models.RealmModel; import org.keycloak.storage.client.ClientLookupProvider; @@ -78,7 +79,7 @@ public class ClientStorageManager implements ClientProvider { private static Stream getStorageProviders(RealmModel realm, KeycloakSession session, Class type) { - return realm.getClientStorageProvidersStream() + return ((LegacyRealmModel) realm).getClientStorageProvidersStream() .filter(model -> { ClientStorageProviderFactory factory = getClientStorageProviderFactory(model, session); if (factory == null) { diff --git a/server-spi-private/src/main/java/org/keycloak/storage/client/AbstractClientStorageAdapter.java b/model/legacy-private/src/main/java/org/keycloak/storage/client/AbstractClientStorageAdapter.java similarity index 100% rename from server-spi-private/src/main/java/org/keycloak/storage/client/AbstractClientStorageAdapter.java rename to model/legacy-private/src/main/java/org/keycloak/storage/client/AbstractClientStorageAdapter.java diff --git a/server-spi-private/src/main/java/org/keycloak/storage/client/AbstractReadOnlyClientScopeAdapter.java b/model/legacy-private/src/main/java/org/keycloak/storage/client/AbstractReadOnlyClientScopeAdapter.java similarity index 100% rename from server-spi-private/src/main/java/org/keycloak/storage/client/AbstractReadOnlyClientScopeAdapter.java rename to model/legacy-private/src/main/java/org/keycloak/storage/client/AbstractReadOnlyClientScopeAdapter.java diff --git a/server-spi-private/src/main/java/org/keycloak/storage/client/AbstractReadOnlyClientStorageAdapter.java b/model/legacy-private/src/main/java/org/keycloak/storage/client/AbstractReadOnlyClientStorageAdapter.java similarity index 100% rename from server-spi-private/src/main/java/org/keycloak/storage/client/AbstractReadOnlyClientStorageAdapter.java rename to model/legacy-private/src/main/java/org/keycloak/storage/client/AbstractReadOnlyClientStorageAdapter.java diff --git a/server-spi-private/src/main/java/org/keycloak/storage/client/ClientStorageProviderFactory.java b/model/legacy-private/src/main/java/org/keycloak/storage/client/ClientStorageProviderFactory.java similarity index 100% rename from server-spi-private/src/main/java/org/keycloak/storage/client/ClientStorageProviderFactory.java rename to model/legacy-private/src/main/java/org/keycloak/storage/client/ClientStorageProviderFactory.java diff --git a/server-spi-private/src/main/java/org/keycloak/storage/client/ClientStorageProviderSpi.java b/model/legacy-private/src/main/java/org/keycloak/storage/client/ClientStorageProviderSpi.java similarity index 100% rename from server-spi-private/src/main/java/org/keycloak/storage/client/ClientStorageProviderSpi.java rename to model/legacy-private/src/main/java/org/keycloak/storage/client/ClientStorageProviderSpi.java diff --git a/server-spi-private/src/main/java/org/keycloak/storage/client/UnsupportedOperationsClientStorageAdapter.java b/model/legacy-private/src/main/java/org/keycloak/storage/client/UnsupportedOperationsClientStorageAdapter.java similarity index 100% rename from server-spi-private/src/main/java/org/keycloak/storage/client/UnsupportedOperationsClientStorageAdapter.java rename to model/legacy-private/src/main/java/org/keycloak/storage/client/UnsupportedOperationsClientStorageAdapter.java diff --git a/model/legacy-private/src/main/resources/META-INF/services/org.keycloak.provider.Spi b/model/legacy-private/src/main/resources/META-INF/services/org.keycloak.provider.Spi index 470270596a..511cd93eb5 100644 --- a/model/legacy-private/src/main/resources/META-INF/services/org.keycloak.provider.Spi +++ b/model/legacy-private/src/main/resources/META-INF/services/org.keycloak.provider.Spi @@ -17,3 +17,4 @@ org.keycloak.models.cache.CacheUserProviderSpi org.keycloak.models.cache.CacheRealmProviderSpi +org.keycloak.storage.client.ClientStorageProviderSpi diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientStorageProviderResource.java b/model/legacy-services/src/main/java/org/keycloak/services/resources/admin/ClientStorageProviderResource.java similarity index 100% rename from services/src/main/java/org/keycloak/services/resources/admin/ClientStorageProviderResource.java rename to model/legacy-services/src/main/java/org/keycloak/services/resources/admin/ClientStorageProviderResource.java diff --git a/services/src/main/java/org/keycloak/storage/openshift/OpenshiftClientStorageProvider.java b/model/legacy-services/src/main/java/org/keycloak/storage/openshift/OpenshiftClientStorageProvider.java similarity index 100% rename from services/src/main/java/org/keycloak/storage/openshift/OpenshiftClientStorageProvider.java rename to model/legacy-services/src/main/java/org/keycloak/storage/openshift/OpenshiftClientStorageProvider.java diff --git a/services/src/main/java/org/keycloak/storage/openshift/OpenshiftClientStorageProviderFactory.java b/model/legacy-services/src/main/java/org/keycloak/storage/openshift/OpenshiftClientStorageProviderFactory.java similarity index 100% rename from services/src/main/java/org/keycloak/storage/openshift/OpenshiftClientStorageProviderFactory.java rename to model/legacy-services/src/main/java/org/keycloak/storage/openshift/OpenshiftClientStorageProviderFactory.java diff --git a/services/src/main/java/org/keycloak/storage/openshift/OpenshiftSAClientAdapter.java b/model/legacy-services/src/main/java/org/keycloak/storage/openshift/OpenshiftSAClientAdapter.java similarity index 100% rename from services/src/main/java/org/keycloak/storage/openshift/OpenshiftSAClientAdapter.java rename to model/legacy-services/src/main/java/org/keycloak/storage/openshift/OpenshiftSAClientAdapter.java diff --git a/services/src/main/resources/META-INF/services/org.keycloak.storage.client.ClientStorageProviderFactory b/model/legacy-services/src/main/resources/META-INF/services/org.keycloak.storage.client.ClientStorageProviderFactory similarity index 100% rename from services/src/main/resources/META-INF/services/org.keycloak.storage.client.ClientStorageProviderFactory rename to model/legacy-services/src/main/resources/META-INF/services/org.keycloak.storage.client.ClientStorageProviderFactory diff --git a/model/legacy/src/main/java/org/keycloak/models/LegacyRealmModel.java b/model/legacy/src/main/java/org/keycloak/models/LegacyRealmModel.java new file mode 100644 index 0000000000..abc92f50c6 --- /dev/null +++ b/model/legacy/src/main/java/org/keycloak/models/LegacyRealmModel.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.keycloak.models; + +import org.keycloak.models.RealmModel; +import org.keycloak.storage.client.ClientStorageProvider; +import org.keycloak.storage.client.ClientStorageProviderModel; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * @author Alexander Schwartz + */ +public interface LegacyRealmModel extends RealmModel { + /** + * @deprecated Use {@link #getClientStorageProvidersStream() getClientStorageProvidersStream} instead. + */ + @Deprecated + default List getClientStorageProviders() { + return getClientStorageProvidersStream().collect(Collectors.toList()); + } + + /** + * Returns sorted {@link ClientStorageProviderModel ClientStorageProviderModel} as a stream. + * It should be used with forEachOrdered if the ordering is required. + * @return Sorted stream of {@link ClientStorageProviderModel}. Never returns {@code null}. + */ + default Stream getClientStorageProvidersStream() { + return getComponentsStream(getId(), ClientStorageProvider.class.getName()) + .map(ClientStorageProviderModel::new) + .sorted(ClientStorageProviderModel.comparator); + } +} diff --git a/server-spi/src/main/java/org/keycloak/storage/client/ClientStorageProvider.java b/model/legacy/src/main/java/org/keycloak/storage/client/ClientStorageProvider.java similarity index 100% rename from server-spi/src/main/java/org/keycloak/storage/client/ClientStorageProvider.java rename to model/legacy/src/main/java/org/keycloak/storage/client/ClientStorageProvider.java diff --git a/server-spi/src/main/java/org/keycloak/storage/client/ClientStorageProviderModel.java b/model/legacy/src/main/java/org/keycloak/storage/client/ClientStorageProviderModel.java similarity index 100% rename from server-spi/src/main/java/org/keycloak/storage/client/ClientStorageProviderModel.java rename to model/legacy/src/main/java/org/keycloak/storage/client/ClientStorageProviderModel.java diff --git a/model/map/src/main/java/org/keycloak/models/map/user/MapUserProvider.java b/model/map/src/main/java/org/keycloak/models/map/user/MapUserProvider.java index 3c9143a88f..ee07723f33 100644 --- a/model/map/src/main/java/org/keycloak/models/map/user/MapUserProvider.java +++ b/model/map/src/main/java/org/keycloak/models/map/user/MapUserProvider.java @@ -54,8 +54,6 @@ import org.keycloak.models.map.storage.MapStorage; import org.keycloak.models.map.storage.ModelCriteriaBuilder.Operator; import org.keycloak.models.map.storage.criteria.DefaultModelCriteria; import org.keycloak.models.utils.KeycloakModelUtils; -import org.keycloak.storage.StorageId; -import org.keycloak.storage.client.ClientStorageProvider; import java.util.Collection; import java.util.EnumMap; @@ -66,7 +64,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.Set; -import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -465,33 +462,6 @@ public class MapUserProvider implements UserProvider.Streams { @Override public void preRemove(RealmModel realm, ComponentModel component) { - String componentId = component.getId(); - LOG.tracef("preRemove[ComponentModel](%s, %s)%s", realm, componentId, getShortStackTrace()); - if (component.getProviderType().equals(ClientStorageProvider.class.getName())) { - DefaultModelCriteria mcb = criteria(); - mcb = mcb.compare(SearchableFields.REALM_ID, Operator.EQ, realm.getId()) - .compare(SearchableFields.CONSENT_CLIENT_FEDERATION_LINK, Operator.EQ, componentId); - - try (Stream s = tx.read(withCriteria(mcb))) { - String providerIdS = new StorageId(componentId, "").getId(); - s.forEach(removeConsentsForExternalClient(providerIdS)); - } - } - } - - private Consumer removeConsentsForExternalClient(String idPrefix) { - return userEntity -> { - Set userConsents = userEntity.getUserConsents(); - if (userConsents == null || userConsents.isEmpty()) return; - List consentClientIds = userConsents.stream() - .map(MapUserConsentEntity::getClientId) - .filter(clientId -> clientId != null && clientId.startsWith(idPrefix)) - .collect(Collectors.toList()); - - if (! consentClientIds.isEmpty()) { - consentClientIds.forEach(userEntity::removeUserConsent); - } - }; } @Override diff --git a/server-spi-private/src/main/resources/META-INF/services/org.keycloak.provider.Spi b/server-spi-private/src/main/resources/META-INF/services/org.keycloak.provider.Spi index b4bb5345dc..9c3ce1a594 100755 --- a/server-spi-private/src/main/resources/META-INF/services/org.keycloak.provider.Spi +++ b/server-spi-private/src/main/resources/META-INF/services/org.keycloak.provider.Spi @@ -78,7 +78,6 @@ org.keycloak.credential.CredentialSpi org.keycloak.keys.PublicKeyStorageSpi org.keycloak.keys.KeySpi org.keycloak.storage.DatastoreSpi -org.keycloak.storage.client.ClientStorageProviderSpi org.keycloak.storage.clientscope.ClientScopeStorageProviderSpi org.keycloak.storage.role.RoleStorageProviderSpi org.keycloak.storage.group.GroupStorageProviderSpi diff --git a/server-spi/src/main/java/org/keycloak/models/RealmModel.java b/server-spi/src/main/java/org/keycloak/models/RealmModel.java index a7668f897a..528ca05beb 100755 --- a/server-spi/src/main/java/org/keycloak/models/RealmModel.java +++ b/server-spi/src/main/java/org/keycloak/models/RealmModel.java @@ -20,12 +20,9 @@ package org.keycloak.models; import java.util.Comparator; import org.keycloak.common.enums.SslRequired; import org.keycloak.component.ComponentModel; -import org.keycloak.credential.CredentialInput; import org.keycloak.provider.Provider; import org.keycloak.provider.ProviderEvent; import org.keycloak.storage.SearchableModelField; -import org.keycloak.storage.client.ClientStorageProvider; -import org.keycloak.storage.client.ClientStorageProviderModel; import org.keycloak.storage.role.RoleStorageProvider; import org.keycloak.storage.role.RoleStorageProviderModel; @@ -661,25 +658,6 @@ public interface RealmModel extends RoleContainerModel { ComponentModel getComponent(String id); - /** - * @deprecated Use {@link #getClientStorageProvidersStream() getClientStorageProvidersStream} instead. - */ - @Deprecated - default List getClientStorageProviders() { - return getClientStorageProvidersStream().collect(Collectors.toList()); - } - - /** - * Returns sorted {@link ClientStorageProviderModel ClientStorageProviderModel} as a stream. - * It should be used with forEachOrdered if the ordering is required. - * @return Sorted stream of {@link ClientStorageProviderModel}. Never returns {@code null}. - */ - default Stream getClientStorageProvidersStream() { - return getComponentsStream(getId(), ClientStorageProvider.class.getName()) - .map(ClientStorageProviderModel::new) - .sorted(ClientStorageProviderModel.comparator); - } - /** * @deprecated Use {@link #getRoleStorageProvidersStream() getRoleStorageProvidersStream} instead. */ diff --git a/services/pom.xml b/services/pom.xml index 5110042cba..dd1d8cd6ec 100755 --- a/services/pom.xml +++ b/services/pom.xml @@ -183,10 +183,6 @@ - - com.openshift - openshift-restclient-java - com.webauthn4j webauthn4j-core diff --git a/services/src/main/java/org/keycloak/social/facebook/FacebookIdentityProviderConfig.java b/services/src/main/java/org/keycloak/social/facebook/FacebookIdentityProviderConfig.java index cdf50ff6cc..116ec39c21 100755 --- a/services/src/main/java/org/keycloak/social/facebook/FacebookIdentityProviderConfig.java +++ b/services/src/main/java/org/keycloak/social/facebook/FacebookIdentityProviderConfig.java @@ -2,10 +2,8 @@ package org.keycloak.social.facebook; import java.util.Optional; -import org.apache.commons.lang.StringUtils; import org.keycloak.broker.oidc.OIDCIdentityProviderConfig; import org.keycloak.models.IdentityProviderModel; -import org.keycloak.saml.common.util.StringUtil; public class FacebookIdentityProviderConfig extends OIDCIdentityProviderConfig { diff --git a/services/src/test/java/org/keycloak/connections/httpclient/DefaultHttpClientFactoryTest.java b/services/src/test/java/org/keycloak/connections/httpclient/DefaultHttpClientFactoryTest.java index 2b4a7371c1..a242a913af 100644 --- a/services/src/test/java/org/keycloak/connections/httpclient/DefaultHttpClientFactoryTest.java +++ b/services/src/test/java/org/keycloak/connections/httpclient/DefaultHttpClientFactoryTest.java @@ -30,7 +30,6 @@ import java.util.Properties; import javax.net.ssl.SSLPeerUnverifiedException; -import org.apache.commons.lang.StringUtils; import org.apache.http.HttpStatus; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; @@ -95,7 +94,7 @@ public class DefaultHttpClientFactoryTest { StringBuilder sb = new StringBuilder(); sb.append("{"); - sb.append(StringUtils.join(params, ',')); + sb.append(String.join(",", params)); sb.append("}"); return sb.toString();