【问题标题】:Kotlin spring security configKotlin 春季安全配置
【发布时间】:2015-12-05 11:57:25
【问题描述】:

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

编辑:

permitAll 方法的签名,来自流行的 Spring Security 框架:

public ExpressionInterceptUrlRegistry permitAll() {
    return access(permitAll);
}

我错过了什么还是这是一个错误?

【问题讨论】:

  • 能否提供permitAll的函数签名(升级前)?
  • @mfulton26 啊,当然可以。添加了谢谢。

标签: java spring spring-security kotlin


【解决方案1】:

这是 Kotlin 1.0-beta3595 中的一个错误,一直是 logged here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-12-22
    • 2021-08-20
    • 2014-02-02
    • 2012-12-13
    • 2017-11-30
    • 2021-05-12
    相关资源
    最近更新 更多