Skip to content

Commit 19942a9

Browse files
author
Greg Meyer
authored
Merge pull request #1 from DirectProjectJavaRI/develop
Archiving M1 Release Source
2 parents ff525bf + 33eb7e4 commit 19942a9

12 files changed

Lines changed: 180 additions & 183 deletions

File tree

pom.xml

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
<maven>3.0.0</maven>
1919
</prerequisites>
2020
<parent>
21-
<groupId>org.springframework.boot</groupId>
22-
<artifactId>spring-boot-dependencies</artifactId>
23-
<version>2.0.5.RELEASE</version>
21+
<groupId>org.springframework.boot</groupId>
22+
<artifactId>spring-boot-starter-parent</artifactId>
23+
<version>2.1.1.RELEASE</version>
24+
<relativePath />
2425
</parent>
2526
<developers>
2627
<developer>
@@ -37,17 +38,66 @@
3738
<name>New BSD License</name>
3839
<url>http://nhindirect.org/BSDLicense</url>
3940
</license>
40-
</licenses>
41+
</licenses>
42+
<properties>
43+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
44+
<camel.version>2.22.0</camel.version>
45+
</properties>
46+
<repositories>
47+
<!-- Temp repository for Spring Boot Milestone -->
48+
<repository>
49+
<id>spring-milestone</id>
50+
<name>Spring Milestone Releases</name>
51+
<url>https://repo.spring.io/milestone/</url>
52+
</repository>
53+
</repositories>
54+
<dependencyManagement>
55+
<dependencies>
56+
<dependency>
57+
<groupId>org.springframework.boot</groupId>
58+
<artifactId>spring-boot-dependencies</artifactId>
59+
<version>2.1.1.RELEASE</version>
60+
<type>pom</type>
61+
<scope>import</scope>
62+
</dependency>
63+
<dependency>
64+
<groupId>org.springframework.cloud</groupId>
65+
<artifactId>spring-cloud-starter-parent</artifactId>
66+
<version>Greenwich.M3</version>
67+
<type>pom</type>
68+
<scope>import</scope>
69+
</dependency>
70+
</dependencies>
71+
</dependencyManagement>
4172
<dependencies>
4273
<dependency>
4374
<groupId>org.nhind</groupId>
4475
<artifactId>config-service-jar</artifactId>
4576
<version>6.0-SNAPSHOT</version>
4677
</dependency>
78+
<dependency>
79+
<groupId>org.nhind</groupId>
80+
<artifactId>config-store</artifactId>
81+
<version>6.0-SNAPSHOT</version>
82+
</dependency>
83+
<dependency>
84+
<groupId>org.apache.camel</groupId>
85+
<artifactId>camel-spring-boot-starter</artifactId>
86+
<version>${camel.version}</version>
87+
</dependency>
88+
<dependency>
89+
<groupId>org.springframework.boot</groupId>
90+
<artifactId>spring-boot-starter-tomcat</artifactId>
91+
<scope>provided</scope>
92+
</dependency>
4793
<dependency>
4894
<groupId>org.springframework.boot</groupId>
4995
<artifactId>spring-boot-starter-web</artifactId>
50-
</dependency>
96+
</dependency>
97+
<dependency>
98+
<groupId>org.springframework.boot</groupId>
99+
<artifactId>spring-boot-starter-webflux</artifactId>
100+
</dependency>
51101
<dependency>
52102
<groupId>org.springframework.boot</groupId>
53103
<artifactId>spring-boot-starter-data-jpa</artifactId>
@@ -56,11 +106,6 @@
56106
<groupId>org.springframework.boot</groupId>
57107
<artifactId>spring-boot-starter-security</artifactId>
58108
</dependency>
59-
<dependency>
60-
<groupId>postgresql</groupId>
61-
<artifactId>postgresql</artifactId>
62-
<version>8.4-701.jdbc4</version>
63-
</dependency>
64109
<dependency>
65110
<groupId>commons-dbcp</groupId>
66111
<artifactId>commons-dbcp</artifactId>
@@ -76,15 +121,13 @@
76121
<dependency>
77122
<groupId>mysql</groupId>
78123
<artifactId>mysql-connector-java</artifactId>
79-
<version>5.1.47</version>
80124
<scope>runtime</scope>
81125
</dependency>
82126
<dependency>
83127
<groupId>org.postgresql</groupId>
84128
<artifactId>postgresql</artifactId>
85-
<version>42.2.5</version>
86129
<scope>runtime</scope>
87-
</dependency>
130+
</dependency>
88131
<dependency>
89132
<groupId>org.eclipse.jetty</groupId>
90133
<artifactId>test-jetty-servlet</artifactId>
@@ -126,7 +169,7 @@
126169
<source>1.8</source>
127170
<target>1.8</target>
128171
</configuration>
129-
</plugin>
172+
</plugin>
130173
<!-- for releases only
131174
<plugin>
132175
<groupId>org.apache.maven.plugins</groupId>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package org.nhindirect.config.boot;
2+
3+
import org.springframework.boot.autoconfigure.SpringBootApplication;
4+
import org.springframework.boot.builder.SpringApplicationBuilder;
5+
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
6+
import org.springframework.context.annotation.ComponentScan;
7+
8+
9+
@ComponentScan({"org.nhindirect.config", "org.nhindirect.config.boot"})
10+
@SpringBootApplication
11+
public class ConfigServiceApplication extends SpringBootServletInitializer
12+
{
13+
@Override
14+
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
15+
{
16+
return application.sources(ConfigServiceApplication.class);
17+
}
18+
19+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package org.nhindirect.config.boot;
2+
3+
import org.springframework.beans.factory.annotation.Value;
4+
import org.springframework.context.annotation.Bean;
5+
import org.springframework.context.annotation.Configuration;
6+
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
7+
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
8+
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
9+
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
10+
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
11+
import org.springframework.security.crypto.password.PasswordEncoder;
12+
13+
@EnableWebSecurity
14+
@Configuration
15+
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter
16+
{
17+
private static final String BCRYPT_PREFIX = "{bcrypt}";
18+
19+
@Value("${spring.security.user.name}")
20+
protected String username;
21+
22+
@Value("${spring.security.user.password}")
23+
protected String password;
24+
25+
@Override
26+
protected void configure(HttpSecurity httpSecurity) throws Exception
27+
{
28+
httpSecurity
29+
.authorizeRequests()
30+
.antMatchers("/**").authenticated()
31+
.and()
32+
.httpBasic();
33+
httpSecurity.csrf().disable();
34+
}
35+
36+
37+
@Override
38+
public void configure(AuthenticationManagerBuilder auth) throws Exception
39+
{
40+
if (password.startsWith(BCRYPT_PREFIX))
41+
password = password.substring(BCRYPT_PREFIX.length());
42+
else
43+
password = passwordEncoder().encode(password);
44+
45+
auth
46+
.inMemoryAuthentication()
47+
.passwordEncoder(passwordEncoder())
48+
.withUser(username)
49+
.password(password)
50+
.roles("USER");
51+
}
52+
53+
@Bean
54+
public PasswordEncoder passwordEncoder()
55+
{
56+
return new BCryptPasswordEncoder();
57+
}
58+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# automatically expand info properties from the Maven project using resource filtering
2+
info.build.artifact=@project.artifactId@
3+
info.build.name=@project.name@
4+
info.build.description=@project.description@
5+
info.build.version=@project.version@
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
spring.application.name=direct-config-service
2+
spring.jpa.open_in_view=false
3+
camel.springboot.xmlRoutes = classpath:routes/routes.xml
4+
org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
5+
org.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true
6+
7+
#Default username and password
8+
spring.security.basic.enabled=true
9+
spring.security.user.name=admin
10+
spring.security.user.password={bcrypt}$2a$04$WQsYXSBOnycO1/7E9bKUVevWX3.Gxv2V6ZfYx9UKoy3lm9.4TjU7e
11+
12+
#Default Derby Database Settings. This is not recommended for production use
13+
#and not fit for purpose for ephemeral deployments (you are almost guaranteed to lose your data if
14+
#using an ephemeral environment)
15+
spring.datasource.url=jdbc:derby:nhindconfig;create=true
16+
spring.datasource.username=nhind
17+
spring.datasource.password=nhind
18+
19+
#Disable eureka client. Set this to true and set eureka client properties to
20+
#connect to eureka.
21+
eureka.client.enabled=false
22+
23+
spring.main.allow-bean-definition-overriding=true
24+
25+
#unique jmx names to avoid collisions when running
26+
#multiple spring boot apps in an web container
27+
endpoints.jmx.default-domain=direct-config-service
28+
endpoints.jmx.uniqueNames=true
29+
spring.jmx.default-domain=direct-config-service

src/main/resources/pkcs11Config/pkcs11.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/main/resources/properties/config.properties

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<routes xmlns="http://camel.apache.org/schema/spring">
2+
<route id="refreshBundle">
3+
<from uri="seda:refresh-start"/>
4+
<bean ref="bundleRefreshProcessor"/>
5+
</route>
6+
7+
<route id="cache-refresher">
8+
<from uri="timer://cache-refresh?period=1h"/>
9+
<bean ref="bundleCacheUpdateProcessor"/>
10+
</route>
11+
</routes>

src/main/webapp/META-INF/MANIFEST.MF

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/main/webapp/WEB-INF/configservice-servlet.xml

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)