• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ProxyRequestHelper类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper的典型用法代码示例。如果您正苦于以下问题:Java ProxyRequestHelper类的具体用法?Java ProxyRequestHelper怎么用?Java ProxyRequestHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ProxyRequestHelper类属于org.springframework.cloud.netflix.zuul.filters包,在下文中一共展示了ProxyRequestHelper类的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: sensitiveHeadersOverride

点赞 3

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Test
public void sensitiveHeadersOverride() throws Exception {
	this.properties.setPrefix("/api");
	this.properties.setStripPrefix(true);
	this.properties.setSensitiveHeaders(Collections.singleton("x-bar"));
	this.request.setRequestURI("/api/foo/1");
	ZuulRoute route = new ZuulRoute("/foo/**", "foo");
	route.setSensitiveHeaders(Collections.singleton("x-foo"));
	this.routeLocator.addRoute(route);
	this.filter.run();
	RequestContext ctx = RequestContext.getCurrentContext();
	@SuppressWarnings("unchecked")
	Set<String> sensitiveHeaders = (Set<String>) ctx
			.get(ProxyRequestHelper.IGNORED_HEADERS);
	assertTrue("sensitiveHeaders is wrong: " + sensitiveHeaders,
			sensitiveHeaders.containsAll(Collections.singletonList("x-foo")));
	assertFalse("sensitiveHeaders is wrong: " + sensitiveHeaders,
			sensitiveHeaders.contains("Cookie"));
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:20,
代码来源:PreDecorationFilterTests.java

示例2: sensitiveHeadersOverrideEmpty

点赞 3

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Test
public void sensitiveHeadersOverrideEmpty() throws Exception {
	this.properties.setPrefix("/api");
	this.properties.setStripPrefix(true);
	this.properties.setSensitiveHeaders(Collections.singleton("x-bar"));
	this.request.setRequestURI("/api/foo/1");
	ZuulRoute route = new ZuulRoute("/foo/**", "foo");
	route.setSensitiveHeaders(Collections.<String>emptySet());
	this.routeLocator.addRoute(route);
	this.filter.run();
	RequestContext ctx = RequestContext.getCurrentContext();
	@SuppressWarnings("unchecked")
	Set<String> sensitiveHeaders = (Set<String>) ctx
			.get(ProxyRequestHelper.IGNORED_HEADERS);
	assertTrue("sensitiveHeaders is wrong: " + sensitiveHeaders,
			sensitiveHeaders.isEmpty());
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:18,
代码来源:PreDecorationFilterTests.java

示例3: sensitiveHeadersDefaults

点赞 3

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Test
public void sensitiveHeadersDefaults() throws Exception {
	this.properties.setPrefix("/api");
	this.properties.setStripPrefix(true);
	this.properties.setSensitiveHeaders(Collections.singleton("x-bar"));
	this.request.setRequestURI("/api/foo/1");
	this.routeLocator.addRoute("/foo/**", "foo");
	this.filter.run();
	RequestContext ctx = RequestContext.getCurrentContext();
	@SuppressWarnings("unchecked")
	Set<String> sensitiveHeaders = (Set<String>) ctx
			.get(ProxyRequestHelper.IGNORED_HEADERS);
	assertTrue("sensitiveHeaders is wrong: " + sensitiveHeaders,
			sensitiveHeaders.containsAll(Collections.singletonList("x-bar")));
	assertFalse("sensitiveHeaders is wrong", sensitiveHeaders.contains("Cookie"));
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:17,
代码来源:PreDecorationFilterTests.java

示例4: sensitiveHeadersOverrideCaseInsensitive

点赞 3

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Test
public void sensitiveHeadersOverrideCaseInsensitive() throws Exception {
	this.properties.setPrefix("/api");
	this.properties.setStripPrefix(true);
	this.properties.setSensitiveHeaders(Collections.singleton("X-bAr"));
	this.request.setRequestURI("/api/foo/1");
	ZuulRoute route = new ZuulRoute("/foo/**", "foo");
	route.setSensitiveHeaders(Collections.singleton("X-Foo"));
	this.routeLocator.addRoute(route);
	this.filter.run();
	RequestContext ctx = RequestContext.getCurrentContext();
	@SuppressWarnings("unchecked")
	Set<String> sensitiveHeaders = (Set<String>) ctx
			.get(ProxyRequestHelper.IGNORED_HEADERS);
	assertTrue("sensitiveHeaders is wrong: " + sensitiveHeaders,
			sensitiveHeaders.containsAll(Collections.singletonList("x-foo")));
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:18,
代码来源:PreDecorationFilterTests.java

示例5: ignoredHeadersAlreadySetInRequestContextDontGetOverridden

点赞 3

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Test
public void ignoredHeadersAlreadySetInRequestContextDontGetOverridden()
		throws Exception {
	this.properties.setPrefix("/api");
	this.properties.setStripPrefix(true);
	this.properties.setSensitiveHeaders(Collections.singleton("x-bar"));
	this.request.setRequestURI("/api/foo/1");
	this.routeLocator.addRoute("/foo/**", "foo");
	RequestContext ctx = RequestContext.getCurrentContext();
	ctx.set(ProxyRequestHelper.IGNORED_HEADERS,
			new HashSet<>(Arrays.asList("x-foo")));
	this.filter.run();
	@SuppressWarnings("unchecked")
	Set<String> sensitiveHeaders = (Set<String>) ctx
			.get(ProxyRequestHelper.IGNORED_HEADERS);
	assertTrue("sensitiveHeaders is wrong: " + sensitiveHeaders,
			sensitiveHeaders.containsAll(Arrays.asList("x-bar", "x-foo")));
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:19,
代码来源:PreDecorationFilterTests.java

示例6: ContentFetchCommand

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
public ContentFetchCommand(String location, RequestContext requestContext, RestTemplate restTemplate) {
    super(HystrixCommandGroupKey.Factory.asKey("content-fetch"));
    this.location = location;
    this.requestContext = requestContext;
    this.restTemplate = restTemplate;
    helper = new ProxyRequestHelper();
}
 

开发者ID:acesinc,
项目名称:convergent-ui,
代码行数:8,
代码来源:ContentFetchCommand.java

示例7: ribbonRoutingFilter

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Bean
public RibbonRoutingFilter ribbonRoutingFilter(ProxyRequestHelper helper,
		RibbonCommandFactory<?> ribbonCommandFactory) {
	RibbonRoutingFilter filter = new RibbonRoutingFilter(helper, ribbonCommandFactory,
			this.requestCustomizers);
	return filter;
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:8,
代码来源:ZuulProxyAutoConfiguration.java

示例8: simpleHostRoutingFilter

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean({SimpleHostRoutingFilter.class, CloseableHttpClient.class})
public SimpleHostRoutingFilter simpleHostRoutingFilter(ProxyRequestHelper helper,
		ZuulProperties zuulProperties,
		ApacheHttpClientConnectionManagerFactory connectionManagerFactory,
		ApacheHttpClientFactory httpClientFactory) {
	return new SimpleHostRoutingFilter(helper, zuulProperties,
			connectionManagerFactory, httpClientFactory);
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:10,
代码来源:ZuulProxyAutoConfiguration.java

示例9: simpleHostRoutingFilter2

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean({SimpleHostRoutingFilter.class})
public SimpleHostRoutingFilter simpleHostRoutingFilter2(ProxyRequestHelper helper,
													   ZuulProperties zuulProperties,
													   CloseableHttpClient httpClient) {
	return new SimpleHostRoutingFilter(helper, zuulProperties,
			httpClient);
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:9,
代码来源:ZuulProxyAutoConfiguration.java

示例10: proxyRequestHelper

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Bean
public ProxyRequestHelper proxyRequestHelper(ZuulProperties zuulProperties) {
	ProxyRequestHelper helper = new ProxyRequestHelper();
	helper.setIgnoredHeaders(zuulProperties.getIgnoredHeaders());
	helper.setTraceRequestBody(zuulProperties.isTraceRequestBody());
	return helper;
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:8,
代码来源:ZuulProxyAutoConfiguration.java

示例11: PreDecorationFilter

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
public PreDecorationFilter(RouteLocator routeLocator, String dispatcherServletPath, ZuulProperties properties,
		ProxyRequestHelper proxyRequestHelper) {
	this.routeLocator = routeLocator;
	this.properties = properties;
	this.urlPathHelper.setRemoveSemicolonContent(properties.isRemoveSemicolonContent());
	this.dispatcherServletPath = dispatcherServletPath;
	this.proxyRequestHelper = proxyRequestHelper;
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:9,
代码来源:PreDecorationFilter.java

示例12: SimpleHostRoutingFilter

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
public SimpleHostRoutingFilter(ProxyRequestHelper helper, ZuulProperties properties,
		ApacheHttpClientConnectionManagerFactory connectionManagerFactory,
		ApacheHttpClientFactory httpClientFactory) {
	this.helper = helper;
	this.hostProperties = properties.getHost();
	this.sslHostnameValidationEnabled = properties.isSslHostnameValidationEnabled();
	this.forceOriginalQueryStringEncoding = properties
			.isForceOriginalQueryStringEncoding();
	this.connectionManagerFactory = connectionManagerFactory;
	this.httpClientFactory = httpClientFactory;
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:12,
代码来源:SimpleHostRoutingFilter.java

示例13: RibbonRoutingFilter

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
public RibbonRoutingFilter(ProxyRequestHelper helper,
						   RibbonCommandFactory<?> ribbonCommandFactory,
						   List<RibbonRequestCustomizer> requestCustomizers) {
	this.helper = helper;
	this.ribbonCommandFactory = ribbonCommandFactory;
	this.requestCustomizers = requestCustomizers;
	// To support Servlet API 3.1 we need to check if getContentLengthLong exists
	// Spring 5 minimum support is 3.0, so this stays
	try {
		HttpServletRequest.class.getMethod("getContentLengthLong");
	} catch(NoSuchMethodException e) {
		useServlet31 = false;
	}
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:15,
代码来源:RibbonRoutingFilter.java

示例14: sensitiveHeadersCaseInsensitive

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Test
public void sensitiveHeadersCaseInsensitive() throws Exception {
	this.properties.setPrefix("/api");
	this.properties.setStripPrefix(true);
	this.properties.setSensitiveHeaders(Collections.singleton("X-bAr"));
	this.request.setRequestURI("/api/foo/1");
	this.routeLocator.addRoute("/foo/**", "foo");
	this.filter.run();
	RequestContext ctx = RequestContext.getCurrentContext();
	@SuppressWarnings("unchecked")
	Set<String> sensitiveHeaders = (Set<String>) ctx
			.get(ProxyRequestHelper.IGNORED_HEADERS);
	assertTrue("sensitiveHeaders is wrong: " + sensitiveHeaders,
			sensitiveHeaders.containsAll(Collections.singletonList("x-bar")));
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:16,
代码来源:PreDecorationFilterTests.java

示例15: transformationRequestHelper

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Bean
public TransformationRequestHelper transformationRequestHelper(final ProxyRequestHelper proxyRequestHelper) {
    return new TransformationRequestHelper(proxyRequestHelper);
}
 

开发者ID:marcosbarbero,
项目名称:spring-cloud-starter-zuul-transformation,
代码行数:5,
代码来源:TransformationAutoConfiguration.java

示例16: TransformationRequestHelper

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
public TransformationRequestHelper(ProxyRequestHelper requestHelper) {
    TransformationRequestHelper.requestHelper = requestHelper;
}
 

开发者ID:marcosbarbero,
项目名称:spring-cloud-starter-zuul-transformation,
代码行数:4,
代码来源:TransformationRequestHelper.java

示例17: authenticationHeaderFilter

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Bean
public AuthenticationHeaderFilter authenticationHeaderFilter(
		ProxyAuthenticationProperties properties) {
	ProxyRequestHelper helper = new ProxyRequestHelper();
	return new AuthenticationHeaderFilter(helper, properties);
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-security,
代码行数:7,
代码来源:OAuth2ProxyAutoConfiguration.java

示例18: AuthenticationHeaderFilter

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
public AuthenticationHeaderFilter(ProxyRequestHelper helper,
		ProxyAuthenticationProperties properties) {
	this.helper = helper;
	this.routes = properties.getRoutes();
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-security,
代码行数:6,
代码来源:AuthenticationHeaderFilter.java

示例19: preDecorationFilter

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Bean
public PreDecorationFilter preDecorationFilter(RouteLocator routeLocator, ProxyRequestHelper proxyRequestHelper) {
	return new PreDecorationFilter(routeLocator, this.server.getServlet().getServletPrefix(), this.zuulProperties,
			proxyRequestHelper);
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:6,
代码来源:ZuulProxyAutoConfiguration.java

示例20: setupRibbonRoutingFilter

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
private void setupRibbonRoutingFilter() {
	RibbonCommandFactory factory = mock(RibbonCommandFactory.class);
	filter = new RibbonRoutingFilter(new ProxyRequestHelper(), factory, Collections.<RibbonRequestCustomizer>emptyList());
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:5,
代码来源:RibbonRoutingFilterTests.java

示例21: simpleHostRoutingFilter

点赞 2

import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper; //导入依赖的package包/类
@Bean
SimpleHostRoutingFilter simpleHostRoutingFilter(ZuulProperties zuulProperties,
												ApacheHttpClientConnectionManagerFactory connectionManagerFactory,
												ApacheHttpClientFactory clientFactory) {
	return new SimpleHostRoutingFilter(new ProxyRequestHelper(), zuulProperties, connectionManagerFactory, clientFactory);
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-netflix,
代码行数:7,
代码来源:SimpleHostRoutingFilterTests.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)