Kotlin spring Security Configuration

After upgrading to Kotlin 1.0.0-beta-3595 from 1.0.0-beta-242 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:

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

Edit:

The signature of the allowAll method, which is from the popular Spring security framework:

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

Am I missing something or is this a mistake?

+5
source share
1 answer

This was a bug in Kotlin 1.0-beta3595 and was registered here .

+1
source

Source: https://habr.com/ru/post/1237454/


All Articles