JAVA-11240 Moved spring-cloud to spring-cloud-modules
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
package com.baeldung.spring.cloud.config.server;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.config.server.EnableConfigServer;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableConfigServer
|
||||
public class ConfigServer {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ConfigServer.class, args);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.baeldung.spring.cloud.config.server;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void configure(HttpSecurity http) throws Exception {
|
||||
http.csrf()
|
||||
.ignoringAntMatchers("/encrypt/**")
|
||||
.ignoringAntMatchers("/decrypt/**");
|
||||
|
||||
super.configure(http);
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
server.port=8888
|
||||
spring.cloud.config.server.git.uri=
|
||||
spring.cloud.config.server.git.clone-on-start=true
|
||||
spring.security.user.name=root
|
||||
spring.security.user.password=s3cr3t
|
||||
|
||||
encrypt.keyStore.location=classpath:/config-server.jks
|
||||
encrypt.keyStore.password=my-s70r3-s3cr3t
|
||||
encrypt.keyStore.alias=config-server-key
|
||||
encrypt.keyStore.secret=my-k34-s3cr3t
|
||||
Binary file not shown.
+16
@@ -0,0 +1,16 @@
|
||||
package com.baeldung.spring.cloud.config.server;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(classes = ConfigServer.class)
|
||||
@WebAppConfiguration
|
||||
public class SpringContextTest {
|
||||
@Test
|
||||
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
### This should be provided by the docker config
|
||||
spring.cloud.config.server.git.uri=classpath:.
|
||||
Reference in New Issue
Block a user