Skip to content

HttpSecurityLambdaDslReconciler marks more than required #1141

Closed
@BoykoAlex

Description

@BoykoAlex
package net.bohni;

import java.util.stream.Stream;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;

@Configuration
@PropertySource(value= { "classpath:env.properties", "classpath:my-service.properties" }, ignoreResourceNotFound=true)
@EnableAsync
public class MyConfig
{
	@Bean
	Customizer<AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry> authorizeHttpRequestsCustomizer()
	{
		return null;
	}
}

AuthorizeHttpRequestsConfigurer from the method declaration signature is marked. However, it is unlikely needed to be marked. The rewrite recipe seem to only be doing something if there a method call on HttpSecurity detected that could be convrted to the new DSL format. Otherwise the code isn't changed which results in the exception on the IDE side since the edit is empty.

Need to fix either:

  • Reconciler on the STS4 not to mark more than needed
  • HttpSecurityLambdaDsl from rewrite-spring should also replace types not only in the context of method invocations

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions