Jasper Blues
Jasper Blues

Reputation: 28756

Kotlin spring security config

After upgrading to Kotlin 1.0.0-beta-3595 from 1.0.0-beta-242 the following code does not compile:

@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()
}

Error returned is:

SecurityAssembly.kt: (48, 65): Unresolved reference: permitAll

Edit:

The signature of the permitAll method, which is from the popular Spring Security framework is:

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

Am I missing something or is this a bug?

Upvotes: 5

Views: 1789

Answers (1)

Jasper Blues
Jasper Blues

Reputation: 28756

This was a bug in Kotlin 1.0-beta3595, and has been logged here.

Upvotes: 1

Related Questions