This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package config | |
import grails.util.Holders | |
import org.springframework.web.filter.GenericFilterBean | |
import javax.servlet.FilterChain | |
import javax.servlet.ServletException | |
import javax.servlet.ServletRequest | |
import javax.servlet.ServletResponse | |
import javax.servlet.http.HttpServletRequest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grails: | |
plugin: | |
springsecurity: | |
filterChain: | |
chainMap: | |
- pattern: /config/** | |
filters: configFilter | |
config: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package config | |
import grails.util.Holders | |
import org.springframework.web.filter.GenericFilterBean | |
import javax.servlet.FilterChain | |
import javax.servlet.ServletException | |
import javax.servlet.ServletRequest | |
import javax.servlet.ServletResponse | |
import javax.servlet.http.HttpServletRequest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.biid.config | |
import grails.util.Holders | |
import org.springframework.web.filter.GenericFilterBean | |
import javax.servlet.FilterChain | |
import javax.servlet.ServletException | |
import javax.servlet.ServletRequest | |
import javax.servlet.ServletResponse | |
import javax.servlet.http.HttpServletRequest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import config.ConfigFilter | |
beans = { | |
configFilter(ConfigFilter) { | |
urisToFilter = grailsApplication.config.getProperty( | |
"config.uri", List, []) | |
} | |
SpringSecurityUtils.registerFilter "configFilter", | |
SecurityFilterPosition.FORM_LOGIN_FILTER.order - 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grails: | |
plugin: | |
springsecurity: | |
filterChain: | |
chainMap: | |
- pattern: /config/** | |
filters: configFilter //name of the custom filter | |
config: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring: | |
application: | |
name: client-service | |
environments: | |
development: | |
spring: | |
cloud: | |
config: | |
authorization: authorizationTokenShouldBeHere // I used Spring Security Filter Chain for security. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring: | |
application: | |
name: client-service | |
cloud: | |
config: | |
uri: http://localhost:8088/config | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
compile('org.springframework.cloud:spring-cloud-starter-config:1.3.0.RELEASE') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in bootstrap.yml is defined spring.cloud.config.server.prefix = /config and client microservice call to | |
// org.springframework.cloud.config.server.resource.ResourceController. So in UrlMappings we need write our | |
// mapping for call - get "/config/${serviceName}/${profile}"(controller: 'configuration', action: 'config') | |
def config(String serviceName, String profile) { | |
def propertySources = [:] | |
propertySources.name = "${serviceName}.properties" | |
propertySources.source = [:] | |
NewerOlder