宣布 Reactor Core 3.1 首个发布候选版

发布 | Simon Baslé | 2017 年 9 月 18 日 | ...

我代表 Reactor 团队很高兴地宣布 reactor-core 3.1.0.RC1 已发布 ?. 这是 3.1 版本在月底前正式发布 (GA release) 的最后重要一步,也是将支持 Spring 5 的长期支持版本!

此外,还有一系列相关的版本发布,它们都整合在 Bismuth-M4 Release Train 和 BOM 中

  • reactor-test, reactor-extra, reactor-adapterreactor-logback 都已更新至 3.1.0.RC1
  • reactor-netty 在新的 0.7.0.M2 里程碑版本中有大量更新和错误修复
  • reactor-kafka 已发布其 1.0.0.M4 里程碑版本

要获取此版本,最佳方法是使用 BOM,如参考指南 此处 所述。请确保阅读有关 里程碑 的部分(将其转为Bismuth-M4…)。

Spring Cloud Data Flow 1.3.0.M2 发布

发布 | Glenn Renfro | 2017 年 9 月 18 日 | ...

我们很高兴地宣布 Spring Cloud Data Flow 及其相关项目生态系统的 1.3.0. M2 版本发布。

本地服务器:入门指南

Dashboard / Flo

在 Dashboard/Flo 1.3 系列的第二个版本中,我们解决了支持流和任务/批处理操作的核心功能。

Angular4 的基础设施升级 的基础上,流和任务/批处理工作流程现在拥有现代化的外观和感觉,并提供了易用性改进。

文档测试覆盖率webpack bundle-analyzer都经历了显著的…

介绍 Spring Shell 2.0M1!

版本发布 | Eric Bottard | 2017 年 9 月 18 日 | ...

我们很高兴地宣布 Spring Shell 2.x 的第一个里程碑版本!

历时两年打造,Spring Shell 2 是 Spring Shell 的完全重写,利用了更新的组件(如 JLine 3)并采用了更好的模块化。Spring Shell 2 在构建时也考虑到了 Spring Boot,利用了自动配置和其他 Boot 功能。

内部架构现在使用可插拔模型来发现哪些方法可以转换为命令,如何将用户输入解析为参数值以及如何处理返回值。这与 Spring MVC 等采取的方法非常相似,并允许以以前不可能的方式扩展框架。不过,Spring Shell 的用户通常不会关心这些,只会处理新的“标准”命令 API

Spring Boot 2.0 M4 中的安全变更

工程 | Madhura Bhave | 2017 年 9 月 15 日 | ...

Spring Boot 2.0 的 Milestone 4 为 Spring Boot 提供的安全自动配置带来了重要更改。

问题陈述

在 Spring Boot 1.x 中,默认自动配置使用基本身份验证保护了所有应用程序端点。如果类路径中存在 actuator,则会有一个单独的安全配置应用于 actuator 端点。这两种自动配置的开启和关闭方式是完全独立的。因此,想要提供自定义安全的用户发现自己与 WebSecurityConfigurerAdapters 的顺序问题作斗争。

此外,对于执行器端点,management.security.enabled 的效果…

Spring Security 5.0.0 M4 发布

发布 | Rob Winch | 2017 年 9 月 15 日 | ...

我谨代表社区,很高兴地宣布 Spring Security 5.0.0 M4 的发布。此版本包含错误修复、新功能,并基于 Spring Framework 5.0.0 RC4。您可以在 更改日志 中找到完整详细信息。此版本的主要亮点包括:

OAuth2 / OIDC

OAuth2 登录 Java 配置

HttpSecurity.oauth2Login() DSL 有许多改进。

您现在可以使用自定义的 AuthorizationGrantTokenExchangerSecurityTokenRepository<AccessToken> 实现来配置Token Endpoint,如下所示:

protected void configure(HttpSecurity http) throws Exception {
  http
    .authorizeRequests()
      .anyRequest().authenticated()
      .and()
    .oauth2Login()
      .tokenEndpoint()
        .authorizationCodeTokenExchanger(this.authorizationCodeTokenExchanger())
	.accessTokenRepository(this.accessTokenRepository());
}

我们还增加了自定义授权端点重定向端点的请求路径的能力。

protected void configure(HttpSecurity http) throws Exception {
  http
    .authorizeRequests()
      .anyRequest().authenticated()
      .and()
    .oauth2Login()
      .authorizationEndpoint()
        .requestMatcher(new AntPathRequestMatcher("/custom-path/{clientAlias}"))
        .and()
      .redirectionEndpoint()
        .requestMatcher(new AntPathRequestMatcher("/custom-path/callback/{clientAlias}"));
}

与 Spring Security 中的所有 AbstractAuthenticationProcessingFilter 一样,您还可以设置自定义的 AuthenticationSuccessHandlerAuthenticationFailureHandler

protected void configure(HttpSecurity http) throws Exception {
  http
    .authorizeRequests()
      .anyRequest().authenticated()
      .and()
     .oauth2Login()
       .successHandler(this.customAuthenticationSuccessHandler())
       .failureHandler(this.customAuthenticationFailureHandler());
}

安全令牌存储库

我们引入了 SecurityTokenRepository<T extends SecurityToken> 抽象,它负责 SecurityToken 的持久化。

初始实现 InMemoryAccessTokenRepository 提供了 AccessToken 的持久化。在即将发布的版本中,我们还将提供支持Refresh Token持久化的实现。

ID Token 和 Claims

IdToken 中引入了一些小的改进,以及 JwtClaimAccessorStandardClaimAccessorIdTokenClaimAccessor 的一些最终实现细节,它们提供了对关联构造中的 claims 的便捷访问,例如 JwtIdTokenUserInfo

授权请求改进

我们增加了 AuthorizationRequestRepository授权请求持久化到 Cookie 的能力。当前的默认实现将其持久化到 HttpSession,但是,可以提供自定义实现来将其持久化到 Cookie

还添加了对 AuthorizationCodeRequestRedirectFilterredirect-uri 中配置的 URI 变量的支持。

OAuth2 客户端属性

对 OAuth 2.0 客户端的配置属性进行了一些小的更新。下面的配置概述了当前的结构。您会注意到支持配置多个客户端,例如 google、github、okta 等。

security:
  oauth2:
    client:
      google:
        client-id: your-app-client-id
        client-secret: your-app-client-secret
        client-authentication-method: basic
        authorization-grant-type: authorization_code
        redirect-uri: "{scheme}://{serverName}:{serverPort}{contextPath}/oauth2/authorize/code/{clientAlias}"
        scope: openid, profile, email, address, phone
        authorization-uri: "https://#/o/oauth2/v2/auth"
        token-uri: "https://www.googleapis.com/oauth2/v4/token"
        user-info-uri: "https://www.googleapis.com/oauth2/v3/userinfo"
        user-name-attribute-name: "sub"
        jwk-set-uri: "https://www.googleapis.com/oauth2/v3/certs"
        client-name: Google
        client-alias: google
      github:
        ...
      okta:
        ...

有关使用新的 Spring Security OAuth 2.0 / OpenID Connect 1.0 登录功能的完整示例,请参阅 Spring Security 示例中的 oauth2login。该指南将引导您完成使用外部 OAuth 2.0 或 OpenID Connect 1.0 提供程序设置示例应用程序进行 OAuth 2.0 登录的步骤。

响应式安全

响应式方法安全

Spring Security 的响应式支持现在通过利用 Reactor 的 Context 来支持方法安全。以下是主要亮点,您可以在 samples/javaconfig/hellowebflux-method 中找到一个完整的示例。

第一步是使用 @EnableReactiveMethodSecurity 来启用对 @PreAuthorize@PostAuthorize 注解的支持。此步骤可确保对象得到正确代理。

@EnableWebFluxSecurity
@EnableReactiveMethodSecurity
public class SecurityConfig {

下一步是创建一个用 @PreAuthorize@PostAuthorize 注解的服务。例如:

@PreAuthorize("hasRole('ADMIN')")
public Mono<String> findMessage() {

Spring Security 的 WebFlux 支持将确保 Reactor Context 将填充当前用户,用于确定是否授予或拒绝访问。

Spring Security 的标准 @WithMockUser相关注解 已更新为支持响应式方法安全。例如:

@RunWith(SpringRunner.class)
// ...
public class HelloWorldMessageServiceTests {
  @Autowired
  HelloWorldMessageService messages;

@Test public void messagesWhenNotAuthenticatedThenDenied() { StepVerifier.create(this.messages.findMessage()) .expectError(AccessDeniedException.class) .verify(); }

@Test @WithMockUser public void messagesWhenUserThenDenied() { StepVerifier.create(this.messages.findMessage()) .expectError(AccessDeniedException.class) .verify(); }

@Test @WithMockUser(roles = "ADMIN") public void messagesWhenAdminThenOk() { StepVerifier.create(this.messages.findMessage()) .expectNext("Hello World!") .verifyComplete(); } }

测试支持也很好地支持 TestWebClient。例如:

@RunWith(SpringRunner.class)
// ...
public class HelloWebfluxMethodApplicationTests {
  @Autowired
  ApplicationContext context;

WebTestClient rest;

@Before public void setup() { this.rest…

Spring Session MongoDB 2.0.0.M3 发布

工程 | Greg L. Turnquist | 2017 年 9 月 15 日 | ...

亲爱的Spring社区,

Spring Session MongoDB 2.0.0.M3 已发布。它基于

在此版本中,我们添加了一些新功能,以简化在 Spring WebFlux 应用程序中使用它的过程。

@EnableMongoWebSession
public class SpringWebFluxConfig {

}

您所要做的就是将 @EnableMongoWebSession 应用于您的任何 Spring 配置类,以激活对 MongoDB 的会话支持。此外,您必须提供一个 ReactorMongoOperations Spring bean,但如果您使用的是 Spring Boot 的 spring-boot-starter-data-mongodb-reactive

Spring Session 2.0.0 M4

发布 | Rob Winch | 2017 年 9 月 15 日 | ...

我谨代表社区,很高兴地宣布 Spring Session 2.0.0.M4 的发布。此版本主要侧重于改进 WebFlux 支持。主要亮点包括:

简化的 WebFlux 配置

为 WebFlux 配置 Spring Session 已简化为:

@Configuration
@EnableSpringWebSession
public class HelloWebfluxSessionConfig {

  @Bean
  public MapReactorSessionRepository reactorSessionRepository() {
    return new MapReactorSessionRepository(new ConcurrentHashMap<>());
  }
}

您还可以通过添加 WebSessionIdResolver Bean 来切换解析会话 ID 的策略。例如,要从使用 cookie 解析会话 ID 切换到使用 header,您可以使用 Spring Framework 的新 HeaderWebSessionIdResolver

Spring Boot 2.0.0 M4 现已发布

发布 | Stéphane Nicoll | 2017 年 9 月 15 日 | ...

紧随 最新的 Spring Framework 5 版本候选版 之后,Spring Boot 2.0 M4 现已在 我们的 milestone repository 中提供。此版本解决了 150 个问题和拉取请求,是迈向 2.0 GA 的重要一步。感谢所有贡献者!

此里程碑提供了一系列小的调整和增强,以及三个主要变更:

有关更改的完整列表和升级说明,请参阅 WIKI 上的 Spring Boot 2.0.0.M4 发行说明。我们在更新参考文档方面有点落后,所以请考虑使用 快照版本

Spring Cloud Stream Ditmars/1.3 Release Candidate 发布公告

发布 | Gary Russell | 2017年9月14日 | ...

我们很高兴地宣布,Spring Cloud Stream Ditmars.RC1 release candidate 已在 Spring Milestone 仓库中可用。 发布说明 包含与 Spring Boot、Spring Cloud、Spring AMQP 和 Spring for Apache Kafka 的版本兼容性相关的信息。

Kafka Streams for Apache Kafka

此版本旨在推广 Apache Kafka 的 Kafka Streams 支持作为 Apache Kafka 绑定程序实现中的一个顶级项目。随着 Apache Kafka 的 Kafka Streams 被定位为一等公民,开发人员现在可以通过…

获取 Spring 新闻通讯

通过 Spring 新闻通讯保持联系

订阅

领先一步

VMware 提供培训和认证,助您加速进步。

了解更多

获得支持

Tanzu Spring 提供 OpenJDK™、Spring 和 Apache Tomcat® 的支持和二进制文件,只需一份简单的订阅。

了解更多

即将举行的活动

查看 Spring 社区所有即将举行的活动。

查看所有