Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 852
Jasper Blues Avatar asked Nov 10 '22 00:11

Jasper Blues


1 Answers

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

like image 131
Jasper Blues Avatar answered Nov 15 '22 06:11

Jasper Blues