diff --git a/spring-boot-project/spring-boot-autoconfigure/pom.xml b/spring-boot-project/spring-boot-autoconfigure/pom.xml index c696efa1e6..cd8164a215 100755 --- a/spring-boot-project/spring-boot-autoconfigure/pom.xml +++ b/spring-boot-project/spring-boot-autoconfigure/pom.xml @@ -573,36 +573,6 @@ spring-cloud-spring-service-connector true - - org.springframework.social - spring-social-config - true - - - org.springframework.social - spring-social-core - true - - - org.springframework.social - spring-social-web - true - - - org.springframework.social - spring-social-facebook - true - - - org.springframework.social - spring-social-twitter - true - - - org.springframework.social - spring-social-linkedin - true - org.springframework.ws spring-ws-core diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/FacebookAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/FacebookAutoConfiguration.java deleted file mode 100644 index 7b80e1d0e9..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/FacebookAutoConfiguration.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.AutoConfigureBefore; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.context.annotation.ScopedProxyMode; -import org.springframework.social.config.annotation.EnableSocial; -import org.springframework.social.config.annotation.SocialConfigurerAdapter; -import org.springframework.social.connect.Connection; -import org.springframework.social.connect.ConnectionFactory; -import org.springframework.social.connect.ConnectionRepository; -import org.springframework.social.connect.web.GenericConnectionStatusView; -import org.springframework.social.facebook.api.Facebook; -import org.springframework.social.facebook.connect.FacebookConnectionFactory; - -/** - * {@link EnableAutoConfiguration Auto-configuration} for Spring Social connectivity with - * Facebook. - * - * @author Craig Walls - * @since 1.1.0 - */ -@Configuration -@ConditionalOnClass({ SocialConfigurerAdapter.class, FacebookConnectionFactory.class }) -@ConditionalOnProperty(prefix = "spring.social.facebook", name = "app-id") -@AutoConfigureBefore(SocialWebAutoConfiguration.class) -@AutoConfigureAfter(WebMvcAutoConfiguration.class) -public class FacebookAutoConfiguration { - - @Configuration - @EnableSocial - @EnableConfigurationProperties(FacebookProperties.class) - @ConditionalOnWebApplication(type = Type.SERVLET) - protected static class FacebookConfigurerAdapter extends SocialAutoConfigurerAdapter { - - private final FacebookProperties properties; - - protected FacebookConfigurerAdapter(FacebookProperties properties) { - this.properties = properties; - } - - @Bean - @ConditionalOnMissingBean(Facebook.class) - @Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES) - public Facebook facebook(ConnectionRepository repository) { - Connection connection = repository - .findPrimaryConnection(Facebook.class); - return connection != null ? connection.getApi() : null; - } - - @Bean(name = { "connect/facebookConnect", "connect/facebookConnected" }) - @ConditionalOnProperty(prefix = "spring.social", name = "auto-connection-views") - public GenericConnectionStatusView facebookConnectView() { - return new GenericConnectionStatusView("facebook", "Facebook"); - } - - @Override - protected ConnectionFactory createConnectionFactory() { - return new FacebookConnectionFactory(this.properties.getAppId(), - this.properties.getAppSecret()); - } - - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/FacebookProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/FacebookProperties.java deleted file mode 100644 index 37446cdb68..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/FacebookProperties.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * Properties for Spring Social Facebook. - * - * @author Stephane Nicoll - * @since 1.2.0 - */ -@ConfigurationProperties(prefix = "spring.social.facebook") -public class FacebookProperties extends SocialProperties { - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/LinkedInAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/LinkedInAutoConfiguration.java deleted file mode 100644 index 9b7fb62df8..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/LinkedInAutoConfiguration.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.AutoConfigureBefore; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.context.annotation.ScopedProxyMode; -import org.springframework.social.config.annotation.EnableSocial; -import org.springframework.social.config.annotation.SocialConfigurerAdapter; -import org.springframework.social.connect.Connection; -import org.springframework.social.connect.ConnectionFactory; -import org.springframework.social.connect.ConnectionRepository; -import org.springframework.social.connect.web.GenericConnectionStatusView; -import org.springframework.social.linkedin.api.LinkedIn; -import org.springframework.social.linkedin.connect.LinkedInConnectionFactory; - -/** - * {@link EnableAutoConfiguration Auto-configuration} for Spring Social connectivity with - * LinkedIn. - * - * @author Craig Walls - * @since 1.1.0 - */ -@Configuration -@ConditionalOnClass({ SocialConfigurerAdapter.class, LinkedInConnectionFactory.class }) -@ConditionalOnProperty(prefix = "spring.social.linkedin", name = "app-id") -@AutoConfigureBefore(SocialWebAutoConfiguration.class) -@AutoConfigureAfter(WebMvcAutoConfiguration.class) -public class LinkedInAutoConfiguration { - - @Configuration - @EnableSocial - @EnableConfigurationProperties(LinkedInProperties.class) - @ConditionalOnWebApplication(type = Type.SERVLET) - protected static class LinkedInConfigurerAdapter extends SocialAutoConfigurerAdapter { - - private final LinkedInProperties properties; - - protected LinkedInConfigurerAdapter(LinkedInProperties properties) { - this.properties = properties; - } - - @Bean - @ConditionalOnMissingBean(LinkedIn.class) - @Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES) - public LinkedIn linkedin(ConnectionRepository repository) { - Connection connection = repository - .findPrimaryConnection(LinkedIn.class); - return connection != null ? connection.getApi() : null; - } - - @Bean(name = { "connect/linkedinConnect", "connect/linkedinConnected" }) - @ConditionalOnProperty(prefix = "spring.social", name = "auto-connection-views") - public GenericConnectionStatusView linkedInConnectView() { - return new GenericConnectionStatusView("linkedin", "LinkedIn"); - } - - @Override - protected ConnectionFactory createConnectionFactory() { - return new LinkedInConnectionFactory(this.properties.getAppId(), - this.properties.getAppSecret()); - } - - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/LinkedInProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/LinkedInProperties.java deleted file mode 100644 index d83ed58aad..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/LinkedInProperties.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * Properties for Spring Social LinkedIn. - * - * @author Stephane Nicoll - * @since 1.2.0 - */ -@ConfigurationProperties(prefix = "spring.social.linkedin") -public class LinkedInProperties extends SocialProperties { - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialAutoConfigurerAdapter.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialAutoConfigurerAdapter.java deleted file mode 100644 index 6d96012d65..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialAutoConfigurerAdapter.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.springframework.core.env.Environment; -import org.springframework.social.config.annotation.ConnectionFactoryConfigurer; -import org.springframework.social.config.annotation.SocialConfigurerAdapter; -import org.springframework.social.connect.ConnectionFactory; - -/** - * Base class for auto-configured {@link SocialConfigurerAdapter}s. - * - * @author Craig Walls - * @author Phillip Webb - * @since 1.4.0 - */ -public abstract class SocialAutoConfigurerAdapter extends SocialConfigurerAdapter { - - @Override - public void addConnectionFactories(ConnectionFactoryConfigurer configurer, - Environment environment) { - configurer.addConnectionFactory(createConnectionFactory()); - } - - protected abstract ConnectionFactory createConnectionFactory(); - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialProperties.java deleted file mode 100644 index 4fdeb6c008..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialProperties.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * Base {@link ConfigurationProperties properties} for spring social. - * - * @author Stephane Nicoll - * @since 1.4.0 - */ -public abstract class SocialProperties { - - /** - * Your application's OAuth App ID. - */ - private String appId; - - /** - * Your application's OAuth secret. - */ - private String appSecret; - - public String getAppId() { - return this.appId; - } - - public void setAppId(String appId) { - this.appId = appId; - } - - public String getAppSecret() { - return this.appSecret; - } - - public void setAppSecret(String appSecret) { - this.appSecret = appSecret; - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialWebAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialWebAutoConfiguration.java deleted file mode 100644 index 0c3b342de3..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialWebAutoConfiguration.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import java.util.List; - -import org.thymeleaf.spring5.SpringTemplateEngine; - -import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.AutoConfigureBefore; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration; -import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.Ordered; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContext; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.social.UserIdSource; -import org.springframework.social.config.annotation.EnableSocial; -import org.springframework.social.config.annotation.SocialConfigurerAdapter; -import org.springframework.social.connect.ConnectionFactoryLocator; -import org.springframework.social.connect.ConnectionRepository; -import org.springframework.social.connect.UsersConnectionRepository; -import org.springframework.social.connect.web.ConnectController; -import org.springframework.social.connect.web.ConnectInterceptor; -import org.springframework.social.connect.web.DisconnectInterceptor; -import org.springframework.social.connect.web.ProviderSignInController; -import org.springframework.social.connect.web.ProviderSignInInterceptor; -import org.springframework.social.connect.web.SignInAdapter; -import org.springframework.social.connect.web.thymeleaf.SpringSocialDialect; -import org.springframework.util.Assert; -import org.springframework.util.CollectionUtils; -import org.springframework.web.servlet.view.BeanNameViewResolver; - -/** - * {@link EnableAutoConfiguration Auto-configuration} for Spring Social's web connection - * support. - * - * @author Craig Walls - * @since 1.1.0 - */ -@Configuration -@ConditionalOnClass({ ConnectController.class, SocialConfigurerAdapter.class }) -@ConditionalOnBean({ ConnectionFactoryLocator.class, UsersConnectionRepository.class }) -@AutoConfigureBefore(ThymeleafAutoConfiguration.class) -@AutoConfigureAfter(WebMvcAutoConfiguration.class) -public class SocialWebAutoConfiguration { - - @Configuration - @EnableSocial - @ConditionalOnWebApplication(type = Type.SERVLET) - protected static class SocialAutoConfigurationAdapter - extends SocialConfigurerAdapter { - - private final List> connectInterceptors; - - private final List> disconnectInterceptors; - - private final List> signInInterceptors; - - public SocialAutoConfigurationAdapter( - ObjectProvider>> connectInterceptorsProvider, - ObjectProvider>> disconnectInterceptorsProvider, - ObjectProvider>> signInInterceptorsProvider) { - this.connectInterceptors = connectInterceptorsProvider.getIfAvailable(); - this.disconnectInterceptors = disconnectInterceptorsProvider.getIfAvailable(); - this.signInInterceptors = signInInterceptorsProvider.getIfAvailable(); - } - - @Bean - @ConditionalOnMissingBean(ConnectController.class) - public ConnectController connectController( - ConnectionFactoryLocator factoryLocator, - ConnectionRepository repository) { - ConnectController controller = new ConnectController(factoryLocator, - repository); - if (!CollectionUtils.isEmpty(this.connectInterceptors)) { - controller.setConnectInterceptors(this.connectInterceptors); - } - if (!CollectionUtils.isEmpty(this.disconnectInterceptors)) { - controller.setDisconnectInterceptors(this.disconnectInterceptors); - } - return controller; - } - - @Bean - @ConditionalOnMissingBean - @ConditionalOnProperty(prefix = "spring.social", name = "auto-connection-views") - public BeanNameViewResolver beanNameViewResolver() { - BeanNameViewResolver viewResolver = new BeanNameViewResolver(); - viewResolver.setOrder(Ordered.HIGHEST_PRECEDENCE); - return viewResolver; - } - - @Bean - @ConditionalOnBean(SignInAdapter.class) - @ConditionalOnMissingBean - public ProviderSignInController signInController( - ConnectionFactoryLocator factoryLocator, - UsersConnectionRepository usersRepository, SignInAdapter signInAdapter) { - ProviderSignInController controller = new ProviderSignInController( - factoryLocator, usersRepository, signInAdapter); - if (!CollectionUtils.isEmpty(this.signInInterceptors)) { - controller.setSignInInterceptors(this.signInInterceptors); - } - return controller; - } - - } - - @Configuration - @EnableSocial - @ConditionalOnWebApplication(type = Type.SERVLET) - @ConditionalOnMissingClass("org.springframework.security.core.context.SecurityContextHolder") - protected static class AnonymousUserIdSourceConfig extends SocialConfigurerAdapter { - - @Override - public UserIdSource getUserIdSource() { - return () -> "anonymous"; - } - - } - - @Configuration - @EnableSocial - @ConditionalOnWebApplication(type = Type.SERVLET) - @ConditionalOnClass(SecurityContextHolder.class) - protected static class AuthenticationUserIdSourceConfig - extends SocialConfigurerAdapter { - - @Override - public UserIdSource getUserIdSource() { - return new SecurityContextUserIdSource(); - } - - } - - @Configuration - @ConditionalOnClass(SpringTemplateEngine.class) - protected static class SpringSocialThymeleafConfig { - - @Bean - @ConditionalOnMissingBean - public SpringSocialDialect springSocialDialect() { - return new SpringSocialDialect(); - } - - } - - private static class SecurityContextUserIdSource implements UserIdSource { - - @Override - public String getUserId() { - SecurityContext context = SecurityContextHolder.getContext(); - Authentication authentication = context.getAuthentication(); - Assert.state(authentication != null, - "Unable to get a ConnectionRepository: no user signed in"); - return authentication.getName(); - } - - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/TwitterAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/TwitterAutoConfiguration.java deleted file mode 100644 index 61b9cc5c22..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/TwitterAutoConfiguration.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.AutoConfigureBefore; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Scope; -import org.springframework.context.annotation.ScopedProxyMode; -import org.springframework.social.config.annotation.EnableSocial; -import org.springframework.social.config.annotation.SocialConfigurerAdapter; -import org.springframework.social.connect.Connection; -import org.springframework.social.connect.ConnectionFactory; -import org.springframework.social.connect.ConnectionRepository; -import org.springframework.social.connect.web.GenericConnectionStatusView; -import org.springframework.social.twitter.api.Twitter; -import org.springframework.social.twitter.api.impl.TwitterTemplate; -import org.springframework.social.twitter.connect.TwitterConnectionFactory; - -/** - * {@link EnableAutoConfiguration Auto-configuration} for Spring Social connectivity with - * Twitter. - * - * @author Craig Walls - * @since 1.1.0 - */ -@Configuration -@ConditionalOnClass({ SocialConfigurerAdapter.class, TwitterConnectionFactory.class }) -@ConditionalOnProperty(prefix = "spring.social.twitter", name = "app-id") -@AutoConfigureBefore(SocialWebAutoConfiguration.class) -@AutoConfigureAfter(WebMvcAutoConfiguration.class) -public class TwitterAutoConfiguration { - - @Configuration - @EnableSocial - @EnableConfigurationProperties(TwitterProperties.class) - @ConditionalOnWebApplication(type = Type.SERVLET) - protected static class TwitterConfigurerAdapter extends SocialAutoConfigurerAdapter { - - private final TwitterProperties properties; - - protected TwitterConfigurerAdapter(TwitterProperties properties) { - this.properties = properties; - } - - @Bean - @ConditionalOnMissingBean - @Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES) - public Twitter twitter(ConnectionRepository repository) { - Connection connection = repository - .findPrimaryConnection(Twitter.class); - if (connection != null) { - return connection.getApi(); - } - return new TwitterTemplate(this.properties.getAppId(), - this.properties.getAppSecret()); - } - - @Bean(name = { "connect/twitterConnect", "connect/twitterConnected" }) - @ConditionalOnProperty(prefix = "spring.social", name = "auto-connection-views") - public GenericConnectionStatusView twitterConnectView() { - return new GenericConnectionStatusView("twitter", "Twitter"); - } - - @Override - protected ConnectionFactory createConnectionFactory() { - return new TwitterConnectionFactory(this.properties.getAppId(), - this.properties.getAppSecret()); - } - - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/TwitterProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/TwitterProperties.java deleted file mode 100644 index aabf401b8b..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/TwitterProperties.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * Properties for Spring Social Twitter. - * - * @author Stephane Nicoll - * @since 1.2.0 - */ -@ConfigurationProperties(prefix = "spring.social.twitter") -public class TwitterProperties extends SocialProperties { - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/package-info.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/package-info.java deleted file mode 100644 index e78c6a247a..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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. - */ - -/** - * Auto-configuration for Spring Social. - */ -package org.springframework.boot.autoconfigure.social; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index a55d5043ed..1a47f32070 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -433,12 +433,6 @@ "name": "spring.session.redis.flush-mode", "defaultValue": "on-save" }, - { - "name": "spring.social.auto-connection-views", - "type": "java.lang.Boolean", - "description": "Whether to enable the connection status view for supported providers.", - "defaultValue": false - }, { "name": "flyway.baseline-description", "type": "java.lang.String", diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories index 2e140d4d0c..69dfbe391c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories @@ -102,10 +102,6 @@ org.springframework.boot.autoconfigure.security.reactive.ReactiveSecurityAutoCon org.springframework.boot.autoconfigure.sendgrid.SendGridAutoConfiguration,\ org.springframework.boot.autoconfigure.session.SessionAutoConfiguration,\ org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration,\ -org.springframework.boot.autoconfigure.social.SocialWebAutoConfiguration,\ -org.springframework.boot.autoconfigure.social.FacebookAutoConfiguration,\ -org.springframework.boot.autoconfigure.social.LinkedInAutoConfiguration,\ -org.springframework.boot.autoconfigure.social.TwitterAutoConfiguration,\ org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration,\ org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration,\ org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration,\ diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/AbstractSocialAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/AbstractSocialAutoConfigurationTests.java deleted file mode 100644 index c4d56df1ae..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/AbstractSocialAutoConfigurationTests.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.junit.After; - -import org.springframework.beans.factory.NoSuchBeanDefinitionException; -import org.springframework.social.UserIdSource; -import org.springframework.social.connect.ConnectionFactoryLocator; -import org.springframework.social.connect.ConnectionRepository; -import org.springframework.social.connect.UsersConnectionRepository; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.fail; - -/** - * Abstract base class for testing Spring Social auto-configuration. - * - * @author Craig Walls - */ -public abstract class AbstractSocialAutoConfigurationTests { - - protected AnnotationConfigWebApplicationContext context; - - @After - public void close() { - if (this.context != null) { - this.context.close(); - } - } - - protected void assertConnectionFrameworkBeans() { - assertThat(this.context.getBean(UsersConnectionRepository.class)).isNotNull(); - assertThat(this.context.getBean(ConnectionRepository.class)).isNotNull(); - assertThat(this.context.getBean(ConnectionFactoryLocator.class)).isNotNull(); - assertThat(this.context.getBean(UserIdSource.class)).isNotNull(); - } - - protected void assertNoConnectionFrameworkBeans() { - assertMissingBean(UsersConnectionRepository.class); - assertMissingBean(ConnectionRepository.class); - assertMissingBean(ConnectionFactoryLocator.class); - assertMissingBean(UserIdSource.class); - } - - protected void assertMissingBean(Class beanClass) { - try { - assertThat(this.context.getBean(beanClass)).isNotNull(); - fail("Unexpected bean in context of type " + beanClass.getName()); - } - catch (NoSuchBeanDefinitionException ex) { - // Expected - } - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/FacebookAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/FacebookAutoConfigurationTests.java deleted file mode 100644 index 20a5aa2e2e..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/FacebookAutoConfigurationTests.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.junit.Test; - -import org.springframework.boot.context.properties.source.ConfigurationPropertySources; -import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.social.facebook.api.Facebook; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link FacebookAutoConfiguration}. - * - * @author Craig Walls - */ -public class FacebookAutoConfigurationTests extends AbstractSocialAutoConfigurationTests { - - @Test - public void expectedSocialBeansCreated() throws Exception { - this.context = new AnnotationConfigWebApplicationContext(); - TestPropertyValues.of("spring.social.facebook.appId:12345").applyTo(this.context); - TestPropertyValues.of("spring.social.facebook.appSecret:secret") - .applyTo(this.context); - ConfigurationPropertySources.attach(this.context.getEnvironment()); - this.context.register(FacebookAutoConfiguration.class); - this.context.register(SocialWebAutoConfiguration.class); - this.context.refresh(); - assertConnectionFrameworkBeans(); - assertThat(this.context.getBean(Facebook.class)).isNotNull(); - } - - @Test - public void noFacebookBeanCreatedWhenPropertiesArentSet() throws Exception { - this.context = new AnnotationConfigWebApplicationContext(); - this.context.register(FacebookAutoConfiguration.class); - this.context.register(SocialWebAutoConfiguration.class); - this.context.refresh(); - assertNoConnectionFrameworkBeans(); - assertMissingBean(Facebook.class); - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/LinkedInAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/LinkedInAutoConfigurationTests.java deleted file mode 100644 index d325c9a195..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/LinkedInAutoConfigurationTests.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.junit.Test; - -import org.springframework.boot.context.properties.source.ConfigurationPropertySources; -import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.social.linkedin.api.LinkedIn; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link LinkedInAutoConfiguration}. - * - * @author Craig Walls - */ -public class LinkedInAutoConfigurationTests extends AbstractSocialAutoConfigurationTests { - - @Test - public void expectedSocialBeansCreated() throws Exception { - this.context = new AnnotationConfigWebApplicationContext(); - TestPropertyValues.of("spring.social.linkedin.appId:12345").applyTo(this.context); - TestPropertyValues.of("spring.social.linkedin.appSecret:secret") - .applyTo(this.context); - ConfigurationPropertySources.attach(this.context.getEnvironment()); - this.context.register(LinkedInAutoConfiguration.class); - this.context.register(SocialWebAutoConfiguration.class); - this.context.refresh(); - assertConnectionFrameworkBeans(); - assertThat(this.context.getBean(LinkedIn.class)).isNotNull(); - } - - @Test - public void noLinkedInBeanCreatedIfPropertiesArentSet() throws Exception { - this.context = new AnnotationConfigWebApplicationContext(); - this.context.register(LinkedInAutoConfiguration.class); - this.context.register(SocialWebAutoConfiguration.class); - this.context.refresh(); - assertNoConnectionFrameworkBeans(); - assertMissingBean(LinkedIn.class); - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/MultiApiAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/MultiApiAutoConfigurationTests.java deleted file mode 100644 index 3fbfe96ff4..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/MultiApiAutoConfigurationTests.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.junit.Test; - -import org.springframework.boot.context.properties.source.ConfigurationPropertySources; -import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.social.facebook.api.Facebook; -import org.springframework.social.linkedin.api.LinkedIn; -import org.springframework.social.twitter.api.Twitter; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for Spring Social configuration with multiple API providers. - * - * @author Craig Walls - */ -public class MultiApiAutoConfigurationTests extends AbstractSocialAutoConfigurationTests { - - @Test - public void expectTwitterConfigurationOnly() throws Exception { - setupContext("spring.social.twitter.appId:12345", - "spring.social.twitter.appSecret:secret"); - assertConnectionFrameworkBeans(); - assertThat(this.context.getBean(Twitter.class)).isNotNull(); - assertMissingBean(Facebook.class); - assertMissingBean(LinkedIn.class); - } - - @Test - public void expectFacebookConfigurationOnly() throws Exception { - setupContext("spring.social.facebook.appId:12345", - "spring.social.facebook.appSecret:secret"); - assertConnectionFrameworkBeans(); - assertThat(this.context.getBean(Facebook.class)).isNotNull(); - assertMissingBean(Twitter.class); - assertMissingBean(LinkedIn.class); - } - - @Test - public void expectLinkedInConfigurationOnly() throws Exception { - setupContext("spring.social.linkedin.appId:12345", - "spring.social.linkedin.appSecret:secret"); - assertConnectionFrameworkBeans(); - assertThat(this.context.getBean(LinkedIn.class)).isNotNull(); - assertMissingBean(Twitter.class); - assertMissingBean(Facebook.class); - } - - @Test - public void expectFacebookAndLinkedInConfigurationOnly() throws Exception { - setupContext("spring.social.facebook.appId:54321", - "spring.social.facebook.appSecret:shhhhh", - "spring.social.linkedin.appId:12345", - "spring.social.linkedin.appSecret:secret"); - assertConnectionFrameworkBeans(); - assertThat(this.context.getBean(Facebook.class)).isNotNull(); - assertThat(this.context.getBean(LinkedIn.class)).isNotNull(); - assertMissingBean(Twitter.class); - } - - @Test - public void expectFacebookAndTwitterConfigurationOnly() throws Exception { - setupContext("spring.social.facebook.appId:54321", - "spring.social.facebook.appSecret:shhhhh", - "spring.social.twitter.appId:12345", - "spring.social.twitter.appSecret:secret"); - assertConnectionFrameworkBeans(); - assertThat(this.context.getBean(Facebook.class)).isNotNull(); - assertThat(this.context.getBean(Twitter.class)).isNotNull(); - assertMissingBean(LinkedIn.class); - } - - @Test - public void expectLinkedInAndTwitterConfigurationOnly() throws Exception { - setupContext("spring.social.linkedin.appId:54321", - "spring.social.linkedin.appSecret:shhhhh", - "spring.social.twitter.appId:12345", - "spring.social.twitter.appSecret:secret"); - assertConnectionFrameworkBeans(); - assertThat(this.context.getBean(LinkedIn.class)).isNotNull(); - assertThat(this.context.getBean(Twitter.class)).isNotNull(); - assertMissingBean(Facebook.class); - } - - @Test - public void noSocialBeansCreatedWhenPropertiesArentSet() throws Exception { - setupContext(); - assertNoConnectionFrameworkBeans(); - assertMissingBean(Twitter.class); - assertMissingBean(Facebook.class); - assertMissingBean(LinkedIn.class); - } - - private void setupContext(String... environment) { - this.context = new AnnotationConfigWebApplicationContext(); - TestPropertyValues.of(environment).applyTo(this.context); - ConfigurationPropertySources.attach(this.context.getEnvironment()); - this.context.register(TwitterAutoConfiguration.class); - this.context.register(FacebookAutoConfiguration.class); - this.context.register(LinkedInAutoConfiguration.class); - this.context.register(SocialWebAutoConfiguration.class); - this.context.refresh(); - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/TwitterAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/TwitterAutoConfigurationTests.java deleted file mode 100644 index 8737325d9f..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/social/TwitterAutoConfigurationTests.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.autoconfigure.social; - -import org.junit.Test; - -import org.springframework.boot.context.properties.source.ConfigurationPropertySources; -import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.social.twitter.api.Twitter; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link TwitterAutoConfiguration}. - * - * @author Craig Walls - */ -public class TwitterAutoConfigurationTests extends AbstractSocialAutoConfigurationTests { - - @Test - public void expectedSocialBeansCreated() throws Exception { - this.context = new AnnotationConfigWebApplicationContext(); - TestPropertyValues.of("spring.social.twitter.appId:12345").applyTo(this.context); - TestPropertyValues.of("spring.social.twitter.appSecret:secret") - .applyTo(this.context); - ConfigurationPropertySources.attach(this.context.getEnvironment()); - this.context.register(TwitterAutoConfiguration.class); - this.context.register(SocialWebAutoConfiguration.class); - this.context.refresh(); - assertConnectionFrameworkBeans(); - assertThat(this.context.getBean(Twitter.class)).isNotNull(); - } - - @Test - public void noTwitterBeanCreatedWhenPropertiesArentSet() throws Exception { - this.context = new AnnotationConfigWebApplicationContext(); - this.context.register(TwitterAutoConfiguration.class); - this.context.register(SocialWebAutoConfiguration.class); - this.context.refresh(); - assertNoConnectionFrameworkBeans(); - assertMissingBean(Twitter.class); - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/application.properties b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/application.properties index 5a146148b6..a8d63792d0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/application.properties +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/application.properties @@ -1,7 +1 @@ foo: bucket -spring.social.facebook.appId: fbid -spring.social.facebook.appSecret: fbsecret -spring.social.twitter.appId: twid -spring.social.twitter.appSecret: twsecret -spring.social.linkedin.appId: liid -spring.social.linkedin.appSecret: lisecret diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSocialFacebookCompilerAutoConfiguration.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSocialFacebookCompilerAutoConfiguration.java deleted file mode 100644 index 4751e5c5ea..0000000000 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSocialFacebookCompilerAutoConfiguration.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.cli.compiler.autoconfigure; - -import org.codehaus.groovy.ast.ClassNode; -import org.codehaus.groovy.control.CompilationFailedException; -import org.codehaus.groovy.control.customizers.ImportCustomizer; - -import org.springframework.boot.cli.compiler.AstUtils; -import org.springframework.boot.cli.compiler.CompilerAutoConfiguration; -import org.springframework.boot.cli.compiler.DependencyCustomizer; - -/** - * {@link CompilerAutoConfiguration} for Spring Social Facebook. - * - * @author Craig Walls - * @since 1.1.0 - */ -public class SpringSocialFacebookCompilerAutoConfiguration - extends CompilerAutoConfiguration { - - @Override - public boolean matches(ClassNode classNode) { - return AstUtils.hasAtLeastOneFieldOrMethod(classNode, "Facebook"); - } - - @Override - public void applyDependencies(DependencyCustomizer dependencies) - throws CompilationFailedException { - dependencies - .ifAnyMissingClasses("org.springframework.social.facebook.api.Facebook") - .add("spring-boot-starter-social-facebook"); - } - - @Override - public void applyImports(ImportCustomizer imports) throws CompilationFailedException { - imports.addStarImports("org.springframework.social.facebook.api"); - imports.addStarImports("org.springframework.social.config.annotation"); - } - -} diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSocialLinkedInCompilerAutoConfiguration.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSocialLinkedInCompilerAutoConfiguration.java deleted file mode 100644 index bfbe1da2f9..0000000000 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSocialLinkedInCompilerAutoConfiguration.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.cli.compiler.autoconfigure; - -import org.codehaus.groovy.ast.ClassNode; -import org.codehaus.groovy.control.CompilationFailedException; -import org.codehaus.groovy.control.customizers.ImportCustomizer; - -import org.springframework.boot.cli.compiler.AstUtils; -import org.springframework.boot.cli.compiler.CompilerAutoConfiguration; -import org.springframework.boot.cli.compiler.DependencyCustomizer; - -/** - * {@link CompilerAutoConfiguration} for Spring Social LinkedIn. - * - * @author Craig Walls - * @since 1.1.0 - */ -public class SpringSocialLinkedInCompilerAutoConfiguration - extends CompilerAutoConfiguration { - - @Override - public boolean matches(ClassNode classNode) { - return AstUtils.hasAtLeastOneFieldOrMethod(classNode, "LinkedIn"); - } - - @Override - public void applyDependencies(DependencyCustomizer dependencies) - throws CompilationFailedException { - dependencies - .ifAnyMissingClasses("org.springframework.social.linkedin.api.LinkedIn") - .add("spring-boot-starter-social-linkedin"); - } - - @Override - public void applyImports(ImportCustomizer imports) throws CompilationFailedException { - imports.addStarImports("org.springframework.social.linkedin.api"); - imports.addImports("org.springframework.social.config.annotation.EnableSocial"); - } - -} diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSocialTwitterCompilerAutoConfiguration.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSocialTwitterCompilerAutoConfiguration.java deleted file mode 100644 index 3e55ab18ad..0000000000 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSocialTwitterCompilerAutoConfiguration.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2012-2017 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. - * 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.springframework.boot.cli.compiler.autoconfigure; - -import org.codehaus.groovy.ast.ClassNode; -import org.codehaus.groovy.control.CompilationFailedException; -import org.codehaus.groovy.control.customizers.ImportCustomizer; - -import org.springframework.boot.cli.compiler.AstUtils; -import org.springframework.boot.cli.compiler.CompilerAutoConfiguration; -import org.springframework.boot.cli.compiler.DependencyCustomizer; - -/** - * {@link CompilerAutoConfiguration} for Spring Social Twitter. - * - * @author Craig Walls - * @since 1.1.0 - */ -public class SpringSocialTwitterCompilerAutoConfiguration - extends CompilerAutoConfiguration { - - @Override - public boolean matches(ClassNode classNode) { - return AstUtils.hasAtLeastOneFieldOrMethod(classNode, "Twitter"); - } - - @Override - public void applyDependencies(DependencyCustomizer dependencies) - throws CompilationFailedException { - dependencies.ifAnyMissingClasses("org.springframework.social.twitter.api.Twitter") - .add("spring-boot-starter-social-twitter"); - } - - @Override - public void applyImports(ImportCustomizer imports) throws CompilationFailedException { - imports.addStarImports("org.springframework.social.twitter.api"); - imports.addImports("org.springframework.social.config.annotation.EnableSocial"); - } - -} diff --git a/spring-boot-project/spring-boot-cli/src/main/resources/META-INF/services/org.springframework.boot.cli.compiler.CompilerAutoConfiguration b/spring-boot-project/spring-boot-cli/src/main/resources/META-INF/services/org.springframework.boot.cli.compiler.CompilerAutoConfiguration index ea65af15b5..2e41ce700d 100644 --- a/spring-boot-project/spring-boot-cli/src/main/resources/META-INF/services/org.springframework.boot.cli.compiler.CompilerAutoConfiguration +++ b/spring-boot-project/spring-boot-cli/src/main/resources/META-INF/services/org.springframework.boot.cli.compiler.CompilerAutoConfiguration @@ -10,8 +10,5 @@ org.springframework.boot.cli.compiler.autoconfigure.TransactionManagementCompile org.springframework.boot.cli.compiler.autoconfigure.SpringIntegrationCompilerAutoConfiguration org.springframework.boot.cli.compiler.autoconfigure.SpringSecurityCompilerAutoConfiguration org.springframework.boot.cli.compiler.autoconfigure.SpringRetryCompilerAutoConfiguration -org.springframework.boot.cli.compiler.autoconfigure.SpringSocialFacebookCompilerAutoConfiguration -org.springframework.boot.cli.compiler.autoconfigure.SpringSocialLinkedInCompilerAutoConfiguration -org.springframework.boot.cli.compiler.autoconfigure.SpringSocialTwitterCompilerAutoConfiguration org.springframework.boot.cli.compiler.autoconfigure.SpringTestCompilerAutoConfiguration org.springframework.boot.cli.compiler.autoconfigure.SpringWebsocketCompilerAutoConfiguration diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml index 61c054d4ed..0cd1904f49 100644 --- a/spring-boot-project/spring-boot-dependencies/pom.xml +++ b/spring-boot-project/spring-boot-dependencies/pom.xml @@ -156,10 +156,6 @@ 5.0.0.RELEASE 2.0.0.RC2 2.0.0.RC2 - 2.0.0.M4 - 3.0.0.M3 - 2.0.0.M3 - 2.0.0.M4 3.0.0.RELEASE 3.21.0 3.1.0 @@ -478,21 +474,6 @@ spring-boot-starter-security ${revision} - - org.springframework.boot - spring-boot-starter-social-facebook - ${revision} - - - org.springframework.boot - spring-boot-starter-social-linkedin - ${revision} - - - org.springframework.boot - spring-boot-starter-social-twitter - ${revision} - org.springframework.boot spring-boot-starter-test @@ -2702,46 +2683,6 @@ spring-session-jdbc ${spring-session.version} - - org.springframework.social - spring-social-config - ${spring-social.version} - - - org.springframework.social - spring-social-core - ${spring-social.version} - - - org.springframework.social - spring-social-security - ${spring-social.version} - - - org.springframework.social - spring-social-web - ${spring-social.version} - - - org.springframework.social - spring-social-facebook - ${spring-social-facebook.version} - - - org.springframework.social - spring-social-facebook-web - ${spring-social-facebook.version} - - - org.springframework.social - spring-social-linkedin - ${spring-social-linkedin.version} - - - org.springframework.social - spring-social-twitter - ${spring-social-twitter.version} - org.springframework.ws spring-ws-core diff --git a/spring-boot-project/spring-boot-docs/pom.xml b/spring-boot-project/spring-boot-docs/pom.xml index b081f2d8f2..79477b17a0 100644 --- a/spring-boot-project/spring-boot-docs/pom.xml +++ b/spring-boot-project/spring-boot-docs/pom.xml @@ -737,21 +737,6 @@ spring-session-data-redis true - - org.springframework.social - spring-social-facebook - true - - - org.springframework.social - spring-social-linkedin - true - - - org.springframework.social - spring-social-twitter - true - org.springframework.data spring-data-cassandra @@ -827,11 +812,6 @@ spring-security-web true - - org.springframework.social - spring-social-config - true - org.springframework.ws spring-ws-core diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index a836273b9b..3cf00a1103 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -446,21 +446,6 @@ content into your application. Rather, pick only the properties that you need. spring.session.redis.flush-mode=on-save # Sessions flush mode. spring.session.redis.namespace=spring:session # Namespace for keys used to store sessions. - # SPRING SOCIAL ({sc-spring-boot-autoconfigure}/social/SocialWebAutoConfiguration.{sc-ext}[SocialWebAutoConfiguration]) - spring.social.auto-connection-views=false # Whether to enable the connection status view for supported providers. - - # SPRING SOCIAL FACEBOOK ({sc-spring-boot-autoconfigure}/social/FacebookAutoConfiguration.{sc-ext}[FacebookAutoConfiguration]) - spring.social.facebook.app-id= # Your application's Facebook App ID. - spring.social.facebook.app-secret= # Your application's Facebook App Secret. - - # SPRING SOCIAL LINKEDIN ({sc-spring-boot-autoconfigure}/social/LinkedInAutoConfiguration.{sc-ext}[LinkedInAutoConfiguration]) - spring.social.linkedin.app-id= # Your application's LinkedIn App ID. - spring.social.linkedin.app-secret= # Your application's LinkedIn App Secret. - - # SPRING SOCIAL TWITTER ({sc-spring-boot-autoconfigure}/social/TwitterAutoConfiguration.{sc-ext}[TwitterAutoConfiguration]) - spring.social.twitter.app-id= # Your application's Twitter App ID. - spring.social.twitter.app-secret= # Your application's Twitter App Secret. - # THYMELEAF ({sc-spring-boot-autoconfigure}/thymeleaf/ThymeleafAutoConfiguration.{sc-ext}[ThymeleafAutoConfiguration]) spring.thymeleaf.cache=true # Whether to enable template caching. spring.thymeleaf.check-template=true # Whether to check that the template exists before rendering it. diff --git a/spring-boot-project/spring-boot-starters/pom.xml b/spring-boot-project/spring-boot-starters/pom.xml index f0417082b5..5bf466d035 100644 --- a/spring-boot-project/spring-boot-starters/pom.xml +++ b/spring-boot-project/spring-boot-starters/pom.xml @@ -59,9 +59,6 @@ spring-boot-starter-quartz spring-boot-starter-reactor-netty spring-boot-starter-security - spring-boot-starter-social-facebook - spring-boot-starter-social-twitter - spring-boot-starter-social-linkedin spring-boot-starter-test spring-boot-starter-thymeleaf spring-boot-starter-tomcat diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-social-facebook/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-social-facebook/pom.xml deleted file mode 100644 index fe118f3bb3..0000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-social-facebook/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-social-facebook - Spring Boot Social Facebook Starter - Starter for using Spring Social Facebook - - ${basedir}/../../.. - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.social - spring-social-config - - - org.springframework.social - spring-social-core - - - org.springframework.social - spring-social-web - - - org.springframework.social - spring-social-facebook - - - - - - org.basepom.maven - duplicate-finder-maven-plugin - - - duplicate-dependencies - validate - - check - - - - javax.annotation.* - - - - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-social-facebook/src/main/resources/META-INF/spring.provides b/spring-boot-project/spring-boot-starters/spring-boot-starter-social-facebook/src/main/resources/META-INF/spring.provides deleted file mode 100644 index 0dfc2d109d..0000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-social-facebook/src/main/resources/META-INF/spring.provides +++ /dev/null @@ -1 +0,0 @@ -provides: spring-social-facebook \ No newline at end of file diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-social-linkedin/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-social-linkedin/pom.xml deleted file mode 100644 index fd4b74961c..0000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-social-linkedin/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-social-linkedin - Spring Boot Social LinkedIn Starter - Stater for using Spring Social LinkedIn - - ${basedir}/../../.. - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.social - spring-social-config - - - org.springframework.social - spring-social-core - - - org.springframework.social - spring-social-web - - - org.springframework.social - spring-social-linkedin - - - - - - org.basepom.maven - duplicate-finder-maven-plugin - - - duplicate-dependencies - validate - - check - - - - javax.annotation.* - - - - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-social-linkedin/src/main/resources/META-INF/spring.provides b/spring-boot-project/spring-boot-starters/spring-boot-starter-social-linkedin/src/main/resources/META-INF/spring.provides deleted file mode 100644 index 183a3a5a63..0000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-social-linkedin/src/main/resources/META-INF/spring.provides +++ /dev/null @@ -1 +0,0 @@ -provides: spring-social-linkedin \ No newline at end of file diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-social-twitter/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-social-twitter/pom.xml deleted file mode 100644 index 449cbd93b7..0000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-social-twitter/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-social-twitter - Spring Boot Social Twitter Starter - Starter for using Spring Social Twitter - - ${basedir}/../../.. - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.social - spring-social-config - - - org.springframework.social - spring-social-core - - - org.springframework.social - spring-social-web - - - org.springframework.social - spring-social-twitter - - - - - - org.basepom.maven - duplicate-finder-maven-plugin - - - duplicate-dependencies - validate - - check - - - - javax.annotation.* - - - - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-social-twitter/src/main/resources/META-INF/spring.provides b/spring-boot-project/spring-boot-starters/spring-boot-starter-social-twitter/src/main/resources/META-INF/spring.provides deleted file mode 100644 index 0b627cbfbd..0000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-social-twitter/src/main/resources/META-INF/spring.provides +++ /dev/null @@ -1 +0,0 @@ -provides: spring-social-twitter \ No newline at end of file