These are chat archives for spring-cloud/spring-cloud

6th
Jun 2017
Alberto Flores
@albertoaflores
Jun 06 2017 00:53
Question to the group: I have been looking for a solution to deploy microservices. I'm a happy CloudFoundry users, however I'm trying to make sense of "Spring Cloud Data Flow". My apps in CF use messaging. If I have CF, do I really need "Spring Cloud Data Flow"? I'm trying to understand the use cases whereby one is preferred over the other one?
Karthik Mahadeva Iyer
@alwaysastudent
Jun 06 2017 03:06
@mp911de - Hi Mark, can you please advise me if there a way to access Vault using VaultTemplate from a CloudFoundryServiceInfoCreator ?
Karthik Mahadeva Iyer
@alwaysastudent
Jun 06 2017 03:32
I am trying to get to vault server for accessing something from my custom CloudFoundryServiceInfoCreator (unrelated to vault) which will create a ServiceInfo object for my custom connector (unrelated to vault). Appreciate your help.
Karthik Mahadeva Iyer
@alwaysastudent
Jun 06 2017 04:39
I think I can only do an explicit instantiation
VaultOperations vaultOperations = new VaultTemplate(VaultEndpoint.create("my-host", 8200),new TokenAuthentication("455b4005-9697-6952-9794-90c3809f3159"));
VaultTransitOperations  = ...
Karthik Mahadeva Iyer
@alwaysastudent
Jun 06 2017 05:28
^ but the issue is my vault informations can not be hardcoded. They are in the environment variables under VCAP_SERVICES, its own service definition, I am not sure how to get access to them from a different ServiceInfoCreator.
Karthik Mahadeva Iyer
@alwaysastudent
Jun 06 2017 05:38
the problem is generic enough now, can anyone please guide me on this ?
I am trying to create a service info from a service data mapping, but for that I have to rely on some information residing on another service data under the VCAP_SERVICES. How can I reach out to another service data ? Should I have to parse the VCAP_SERVICES from the System.env ?
Dave Syer
@dsyer
Jun 06 2017 06:04
You could do I guess
But other libraries already do that
Does a ServiceInfoCreator not have access to the Spring Environment?
Mark Paluch
@mp911de
Jun 06 2017 06:14
@alwaysastudent here's a sample Spring project with Spring Cloud Vault connector: https://github.com/mp911de/spring-cloud-vault-config-samples/tree/master/spring-vault/cloudfoundry
You need the connector (io.pivotal.spring.cloud:spring-cloud-vault-spring-connector:1.0.0.BUILD-SNAPSHOT) that registers a Cloud bean and here's the code using the connector:
Karthik Mahadeva Iyer
@alwaysastudent
Jun 06 2017 16:08
@dsyer @mp911de thanks for your reply. My question is more like how can I get access to say - VaultServiceInfo from within the MysqlServiceInfoCreator
I think ServiceInfoCreator.createServiceInfo comes way earlier in the lifecycle during the SpringApplication.prepareEnvironment() call chain
Dave Syer
@dsyer
Jun 06 2017 16:29
MysqlServiceInfoCreator is in a library. How would you change it?
Karthik Mahadeva Iyer
@alwaysastudent
Jun 06 2017 16:29
In theory, I have a custom something like that
Dave Syer
@dsyer
Jun 06 2017 16:30
I don't know if there is any API for injecting service info creators with each other
Karthik Mahadeva Iyer
@alwaysastudent
Jun 06 2017 16:30
I am not changing the original MysqlServiceInfoCreator.
Dave Syer
@dsyer
Jun 06 2017 16:30
I doubt it
Karthik Mahadeva Iyer
@alwaysastudent
Jun 06 2017 16:31
ok
Dave Syer
@dsyer
Jun 06 2017 16:31
Depending on where you are in the lifecycle when your code is running the VCAP env var might be already decoded for you
the buildpack does it
so does Spring Boot
Karthik Mahadeva Iyer
@alwaysastudent
Jun 06 2017 16:34
Who does that part of pulling the VCAP_SERVICES and storing them as properties withvcap.services. prefix ? Also I don't know if I can get the Spring Environment wired in a ServiceInfoCreator to get the same.
In these lines, is it possible to plug a custom MysqlServiceInfoCreator that override/replace the original one ?
I am essentially trying to decrypt the credentials sent in as a part of VCAP_SERVICES
Karthik Mahadeva Iyer
@alwaysastudent
Jun 06 2017 16:42
I guess I found how to override theMysqlServiceInfoCreator with my custom one. I just have to make the MysqlServiceInfoCreator .accept return false, by sending in a service data that won't satisfy the checks.
pradeepkusingh
@pradeepkusingh
Jun 06 2017 19:12
@dsyer how can I tell zuul/apigateway to allow only HTTP traffic not script or any other hit ?
Dave Syer
@dsyer
Jun 06 2017 19:37
Sorry. I don't understand the question.
I can have a look tomorrow if you can explain
Ali Moghadam
@alighm
Jun 06 2017 22:17
Hey Team, quick question. How can I perform a FeignClient call to a HTTPS API
I get the following error:
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Ali Moghadam
@alighm
Jun 06 2017 22:22
I have the path to the ca.crt
Ahmad Iqbal Ali
@ahmadiq
Jun 06 2017 22:35
Hi @spencergibb when using Zuul proxy and Consul discovery client, is there a way to strip the prefix (service name) in the auto generated routes? zuul.stripPrefix property value does not seem to affect that.
i'd like my routes to be accessible as /** instead of /<service>/**