从 1.0.0-beta-242
升级到 Kotlin 1.0.0-beta-3595
后,以下代码无法编译:
@Throws(Exception::class)
override fun configure(http: HttpSecurity)
{
http.addFilterBefore(AuthenticationFilter(authenticationManager()), BasicAuthenticationFilter::class.java)
http.csrf().disable()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and().authorizeRequests()
.antMatchers("/authorization/**", "/public/**").permitAll()
.antMatchers("/**").authenticated()
}
返回的错误是:
SecurityAssembly.kt: (48, 65): Unresolved reference: permitAll
编辑:
来自流行的 Spring Security 框架的 permitAll 方法的签名是:
public ExpressionInterceptUrlRegistry permitAll() {
return access(permitAll);
}
我是不是遗漏了什么或者这是一个错误?
最佳答案
这是 Kotlin 1.0-beta3595 中的一个错误,已被 logged here .
关于java - Kotlin spring 安全配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34104631/