Enabling CORS with the E-SYSTEMS TECH CORS framework

Thought tags

Documentation coming soon.

Thought hot deployable components

Our framework supports hot deployable components that may carry CORS configuration elements inside their bundles. This is supported to provide an easy method for adding services that relay on CORS to make their functionality available. Further, developers are able to enable basic configuration along with their code for a minimum working environment along with the ability to send complements without replacing modules that could cause service interruption. Finally, this also provides a path to configure CORS as other properties in Liferay, through components – facilitating the achievemen of a uniform style for configuration elements within bundles.


import org.osgi.service.component.annotations.Component;

import tech.esystems.liferay.sec.cors.CorsOriginKeys;

@Component(
	immediate = true,
	property = {
			CorsOriginKeys.PROPERTY + "=" + "https://example.com/" ,
			CorsOriginKeys.PROPERTY + "=" + "https://sample.com/" ,
			CorsOriginKeys.PROPERTY + "=" + "https://other.com:480/?gtbev=57" ,
			CorsOriginKeys.PROPERTY + "=" + "http://example.com/, https://yetAnother.com/" 
	},
	service = Object.class)
public class Origins { //The class name does not matter

}

Or


import org.osgi.service.component.annotations.Component;

@Component(
	immediate = true,
	property = {
			"tech.esystems.cors.origin=" + "https://example.com/" ,
			"tech.esystems.cors.origin=" + "https://sample.com/" ,
			"tech.esystems.cors.origin=" + "https://other.com:480/?gtbev=57" ,
			"tech.esystems.cors.origin=" + "http://example.com/, https://yetAnother.com/" 
	},
	service = Object.class)
public class Origins {

}


Please note that any element configured as a CORS parameter will be cleaned to only contain: protocol, host and port number. If the port number is not specified, the systems will use the default port for that protocol, which is mandatory.

Marcadores
osgi java cors
Mais Recente
Evolve Promotional video 10 de março de 19
Hello OSGi 9 de março de 19
Styling Custom Portlets 27 de dezembro de 18
Using JSON  7 de novembro de 18
Image to Base64 3 de setembro de 18
Zipping in Java 20 de agosto de 18