Skip to content

Commit b127bcf

Browse files
committed
* Spring boot application is created
* Spring Session configuration is made with REDIS
1 parent 47287dc commit b127bcf

6 files changed

Lines changed: 220 additions & 28 deletions

File tree

security-jwt/design.graphml

Lines changed: 28 additions & 28 deletions
Large diffs are not rendered by default.

security-jwt/pom.xml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<groupId>com.fd</groupId>
88
<artifactId>security.jwt</artifactId>
99
<version>1.0-SNAPSHOT</version>
10+
<modules>
11+
<module>stateless-auth</module>
12+
</modules>
1013
<packaging>pom</packaging>
1114

1215
<properties>
@@ -15,6 +18,7 @@
1518
<maven.compiler.target>1.8</maven.compiler.target>
1619

1720
<spring.boot.version>2.0.5.RELEASE</spring.boot.version>
21+
<spring.cloud.starter.hystrix.version>1.4.5.RELEASE</spring.cloud.starter.hystrix.version>
1822
<hamcrest-version>1.3</hamcrest-version>
1923
<lombok-version>1.18.2</lombok-version>
2024
<mapstruct.version>1.2.0.Final</mapstruct.version>
@@ -27,5 +31,102 @@
2731

2832
</properties>
2933

34+
<dependencyManagement>
35+
<dependencies>
36+
<dependency>
37+
<groupId>org.springframework.cloud</groupId>
38+
<artifactId>spring-cloud-dependencies</artifactId>
39+
<version>Finchley.SR1</version>
40+
<type>pom</type>
41+
<scope>import</scope>
42+
</dependency>
3043

44+
<dependency>
45+
<groupId>org.springframework.boot</groupId>
46+
<artifactId>spring-boot-starter-parent</artifactId>
47+
<version>${spring.boot.version}</version>
48+
<type>pom</type>
49+
<scope>import</scope>
50+
</dependency>
51+
</dependencies>
52+
</dependencyManagement>
53+
54+
<dependencies>
55+
<dependency>
56+
<groupId>org.projectlombok</groupId>
57+
<artifactId>lombok</artifactId>
58+
<version>${lombok-version}</version>
59+
</dependency>
60+
61+
<dependency>
62+
<groupId>org.hamcrest</groupId>
63+
<artifactId>hamcrest-all</artifactId>
64+
<version>${hamcrest-version}</version>
65+
<scope>test</scope>
66+
</dependency>
67+
68+
<dependency>
69+
<groupId>org.apache.logging.log4j</groupId>
70+
<artifactId>log4j-core</artifactId>
71+
</dependency>
72+
73+
<dependency>
74+
<groupId>org.apache.logging.log4j</groupId>
75+
<artifactId>log4j-slf4j-impl</artifactId>
76+
</dependency>
77+
</dependencies>
78+
79+
<build>
80+
<plugins>
81+
<!-- MAVEN COMPILER PLUGIN -->
82+
<plugin>
83+
<groupId>org.apache.maven.plugins</groupId>
84+
<artifactId>maven-compiler-plugin</artifactId>
85+
<version>${maven.plugin.compiler.version}</version>
86+
<configuration>
87+
<source>${java-version}</source>
88+
<target>${java-version}</target>
89+
<encoding>UTF-8</encoding>
90+
91+
<annotationProcessorPaths>
92+
<path>
93+
<groupId>org.mapstruct</groupId>
94+
<artifactId>mapstruct-processor</artifactId>
95+
<version>${mapstruct.version}</version>
96+
</path>
97+
<path>
98+
<groupId>org.projectlombok</groupId>
99+
<artifactId>lombok</artifactId>
100+
<version>${lombok-version}</version>
101+
</path>
102+
</annotationProcessorPaths>
103+
</configuration>
104+
</plugin>
105+
106+
<!-- MAVEN ADD GENERATED-SOURCES TO CLASSPATH -->
107+
<plugin>
108+
<groupId>org.codehaus.mojo</groupId>
109+
<artifactId>build-helper-maven-plugin</artifactId>
110+
<version>${maven.plugin.build-helper.version}</version>
111+
<executions>
112+
<execution>
113+
<phase>generate-sources</phase>
114+
<goals>
115+
<goal>add-source</goal>
116+
</goals>
117+
<configuration>
118+
<sources>
119+
<source>target/generated-sources/annotations</source>
120+
</sources>
121+
</configuration>
122+
</execution>
123+
</executions>
124+
</plugin>
125+
126+
<plugin>
127+
<groupId>org.springframework.boot</groupId>
128+
<artifactId>spring-boot-maven-plugin</artifactId>
129+
</plugin>
130+
</plugins>
131+
</build>
31132
</project>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>security.jwt</artifactId>
7+
<groupId>com.fd</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>stateless-auth</artifactId>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>org.springframework.cloud</groupId>
17+
<artifactId>spring-cloud-starter-hystrix</artifactId>
18+
<version>${spring.cloud.starter.hystrix.version}</version>
19+
</dependency>
20+
21+
<dependency>
22+
<groupId>org.springframework.boot</groupId>
23+
<artifactId>spring-boot-starter-web</artifactId>
24+
<exclusions>
25+
<exclusion>
26+
<groupId>ch.qos.logback</groupId>
27+
<artifactId>logback-classic</artifactId>
28+
</exclusion>
29+
30+
<exclusion>
31+
<groupId>org.apache.logging.log4j</groupId>
32+
<artifactId>log4j-to-slf4j</artifactId>
33+
</exclusion>
34+
</exclusions>
35+
</dependency>
36+
37+
<dependency>
38+
<groupId>org.springframework.session</groupId>
39+
<artifactId>spring-session-data-redis</artifactId>
40+
</dependency>
41+
42+
<dependency>
43+
<groupId>io.lettuce</groupId>
44+
<artifactId>lettuce-core</artifactId>
45+
</dependency>
46+
</dependencies>
47+
48+
</project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.fd.tryout.jwt;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
/**
7+
* @author fdanismaz
8+
* date: 10/5/18 6:05 AM
9+
*/
10+
@SpringBootApplication
11+
public class App {
12+
13+
public static void main(String[] args) {
14+
SpringApplication.run(App.class, args);
15+
}
16+
17+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.fd.tryout.jwt.config;
2+
3+
import org.springframework.context.annotation.Configuration;
4+
5+
/**
6+
* @author fdanismaz
7+
* date: 10/5/18 6:20 AM
8+
*/
9+
@Configuration
10+
public class SecurityConfig {
11+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
spring:
2+
redis:
3+
host: localhost
4+
port: 6379
5+
#password: ...
6+
session:
7+
store-type: redis
8+
redis:
9+
flush-mode: on-save
10+
namespace: spring:session # Namespace for keys used to store sessions
11+
12+
server:
13+
servlet:
14+
session:
15+
timeout: 30 # session timeout in terms of seconds (because suffix not specified)

0 commit comments

Comments
 (0)