spring-cloud-netflix

Authorization header not passed by ZuulProxy starting with Brixton.RC1

我与影子孤独终老i 提交于 2019-12-04 20:07:30
问题 In switching from Spring Cloud Brixton.M5 to Brixton.RC1 my ZuulProxy no longer passes Authorization headers downstream to my proxied services. There's various actors in play in my setup, but most all of them are fairly simple: - AuthorizationServer: runs separately; hands out JWTs to clients - Clients: get JWTs from OAuth server; each with access to a subset of resources. - ResourceServers: consume JWTs for access decisions - MyZuulProxy: proxies various resource servers; should relay JWTs.

Eureka Renews threshold & Renews (last min)

亡梦爱人 提交于 2019-12-04 17:01:33
I have one Eureka Server A and two client instances of B(Client3) and C(Client4) I got logs from Eureka Server, which are as follows : 2018-01-25 12:56:27.828 INFO 7145 --- [nio-8765-exec-2] c.n.e.registry.AbstractInstanceRegistry : Registered instance CLIENT3/client3:bb488bb73fd313321e393915f746bfe5 with status UP (replication=false) 2018-01-25 12:56:28.417 INFO 7145 --- [nio-8765-exec-3] c.n.e.registry.AbstractInstanceRegistry : Registered instance CLIENT3/client3:bb488bb73fd313321e393915f746bfe5 with status UP (replication=true) 2018-01-25 12:56:33.028 INFO 7145 --- [nio-8765-exec-3] c.n.e

XACML for Spring Cloud

最后都变了- 提交于 2019-12-04 16:53:40
I'm going to secure my Spring Cloud Application with OAuth2 and XACML (using AuthZForce, Balana, AT&T XACML or something similar). I want to use the microservices from Spring-Cloud(-Netflix). To make XACML available I think that I need this: PEP for each existing API-service PDP's as new services, that are used by PEP's. Because Spring-Cloud(-Netflix) has load-balancing functions (Eureka) I need to register this services on Eureka and implement a REST-API. Because all PDP's should use the same policies, they need to be stored centrally (Policy Provider) Which framework is most suitable for

How to write integration tests with spring-cloud-netflix and feign

微笑、不失礼 提交于 2019-12-04 15:47:12
问题 I use Spring-Cloud-Netflix for communication between micro services. Let's say I have two services, Foo and Bar, and Foo consumes one of Bar's REST endpoints. I use an interface annotated with @FeignClient : @FeignClient public interface BarClient { @RequestMapping(value = "/some/url", method = "POST") void bazzle(@RequestBody BazzleRequest); } Then I have a service class SomeService in Foo, which calls the BarClient . @Component public class SomeService { @Autowired BarClient barClient;

Feign: Retry depending on response status

给你一囗甜甜゛ 提交于 2019-12-04 12:51:22
问题 I am currently using Spring Cloud and Feign to consume a Microservice in my application. Since it can happen, that a database connection or the like fails in a single service instance, making it return 500 HTTP status code, I want to make sure, that the next server is retried by the service's clients. Currently, Ribbon's retry mechanism works like a charm when the service is not running at all, however it still returns instantly an error when it receives a 500 status code, without any retry.

Is it possible to use Spring API Gateway for threat protection?

大城市里の小女人 提交于 2019-12-04 11:23:27
I'm going to implement API Gateway using Netflix Zuul. Is it possible to setup any rules for protection against: SQL Injection, XML Threat Protection JSON Threat Protection I found only external solution (API Gateways) supporting it :( 来源: https://stackoverflow.com/questions/52422198/is-it-possible-to-use-spring-api-gateway-for-threat-protection

Spring Cloud Zuul API gateway doesn't forward JWT token for stateless sessions

寵の児 提交于 2019-12-04 10:53:58
I am trying to implement Microservices architecture backend using Spring Boot 1.5.6.RELEASE and Spring Cloud Dalston.SR3 that would be consumed by mobile/web endpoints. API Gateway application @SpringBootApplicatio @EnableEurekaClient @EnableZuulProxy public class GatewayApplication { public static void main(String[] args) { SpringApplication.run(GatewayApplication.class, args); } } API security @Configuration @EnableWebSecurity @Order(ManagementServerProperties.ACCESS_OVERRIDE_ORDER) @EnableOAuth2Sso public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { @Override public

Setting the route programmatically in Spring Cloud Netflix Zuul

冷暖自知 提交于 2019-12-04 09:27:34
I have created two AWS Beanstalk envs, each with their own version of the applications. The urls for these envs are https://beta.myserver.com/v1073 and https://beta.myserver.com/v1084 . These urls point to the load balancer. Now I also have a Zuul implementation that have the following configurations. zuul: routes: beta: path: /api/** serviceId: beta-root strip-prefix: false sensitive-headers: Cookie,Set-Cookie ribbon: eureka: enabled: false hystrix: command: default: execution: isolation: thread: timeoutInMilliseconds: 5000 beta-root: ribbon: listOfServers: https://beta.myserver.com Request

How to fine-tune the Spring Cloud Feign client?

雨燕双飞 提交于 2019-12-04 09:07:51
The Spring Cloud doc says: If Hystrix is on the classpath, by default Feign will wrap all methods with a circuit breaker. That's good but how do I configure the Hystrix options to ignore certain exceptions? I've an ErrorDecoder implementation that maps HTTP status code to exceptions. If I put @HystrixCommand on the method, does Feign honor that? Our requirement is to log various details about every HTTP call made out to dependencies. Currently I've a decorated RestTemplate that does this. From what I see in the code and based on Dave Syer's answer here , Feign does't use a RestTemplate . So

how to create multiple instances of eureka services registered into eureka service registry?

偶尔善良 提交于 2019-12-04 08:46:59
I have created eureka service registry and registered services into that. Currently only one instance of a service is running. How to add multiple instances of a same service? I am developing standalone application. And I am accessing services through Rest Template.I am following https://spring.io/guides/gs/service-registration-and-discovery/ Each instance would need to have a unique instanceId , normally configured in application.yml using: ... eureka: instance: metadataMap: instanceId: ${spring.application.name}:${server.port} ... Adding the port to the instanceId allows to run multiple