Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document CORS support for the IntegrationGraphController [INT-4035] #7980

Closed
spring-operator opened this issue May 23, 2016 · 1 comment
Closed

Comments

@spring-operator
Copy link
Contributor

spring-operator commented May 23, 2016

Artem Bilan opened INT-4035 and commented

The Integration Graph can be accessed from any any Web application as an embedded content, e.g. Spring-Flo project can use the result JSON representation to draw the real graph from Spring Integration runtime.

Therefore our REST resource should provide the CORS options to let trusted domains to get access to the data.

Also see Spring Framework Reference Manual for more information.


Issue Links:

Referenced from: pull request #1810

@spring-operator
Copy link
Contributor Author

spring-operator commented May 23, 2016

Artem Bilan commented

The issue comes to the Documentation purpose.
No reason to introduce anything new, since regular Spring MVC provides everything what we need, e.g. XML config may looks like:

<mvc:annotation-driven />

<mvc:cors>
	<mvc:mapping path="/foo/**"
				 allowed-origins="http://foo.bar.com"
				 allowed-methods="GET" />
</mvc:cors>

<graph-controller path="/foo" />

The Java Config is pretty simple as well:

@Configuration
@EnableWebMvc
@EnableIntegration
@EnableIntegrationGraphController(path = "/testIntegration")
public class ContextConfiguration extends WebMvcConfigurerAdapter {

	@Override
	public void addCorsMappings(CorsRegistry registry) {
		registry.addMapping("/testIntegration/**")
				.allowedOrigins("http://foo.bar.com")
				.allowedMethods(HttpMethod.GET.name());
        }

}

See #7955 about the general Integration Graph documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants