Compare commits
3 Commits
feature/ve
...
feature/Ti
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9875de4896 | ||
|
|
af5aa05b9e | ||
|
|
3e65a3a2e7 |
@@ -1,12 +0,0 @@
|
||||
FROM openjdk:11-jre-slim
|
||||
|
||||
ENV APP_HOME=/usr/app/
|
||||
|
||||
WORKDIR $APP_HOME
|
||||
|
||||
COPY build/libs/server-0.0.1-SNAPSHOT.jar application.jar
|
||||
|
||||
EXPOSE 8443
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["java", "-jar", "application.jar"]
|
||||
@@ -1,13 +1,7 @@
|
||||
import Dependencies.AnnotationProcessorLib
|
||||
import Dependencies.DependencyManagementLib
|
||||
import Dependencies.ModuleLib
|
||||
import Dependencies.RuntimeOnlyLib
|
||||
import Dependencies.TestLib
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version Versions.SPRING_BOOT_STARTER
|
||||
id("io.spring.dependency-management") version Versions.SPRING_DEPENDENCY_MANAGEMENT
|
||||
id("org.springframework.boot") version "2.6.7"
|
||||
id("io.spring.dependency-management") version "1.0.11.RELEASE"
|
||||
}
|
||||
|
||||
group = "com.ticketing"
|
||||
@@ -29,50 +23,48 @@ repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
extra["springCloudVersion"] = Versions.SPRING_CLOUD
|
||||
extra["springCloudVersion"] = "2021.0.3"
|
||||
|
||||
dependencies {
|
||||
implementation(Dependencies.SPRING_BOOT_STARTER_DATA_JPA)
|
||||
implementation(Dependencies.SPRING_BOOT_STARTER_SECURITY)
|
||||
implementation(Dependencies.SPRING_BOOT_STARTER_VALIDATION)
|
||||
implementation(Dependencies.SPRING_BOOT_STARTER_WEB)
|
||||
implementation(Dependencies.SPRING_BOOT_STARTER_ACTUATOR)
|
||||
implementation(Dependencies.SPRING_BOOT_STARTER_LOG4J2)
|
||||
implementation(Dependencies.LOMBOK)
|
||||
implementation(Dependencies.SPRING_FOX_STARTER)
|
||||
implementation(Dependencies.SWAGGER)
|
||||
implementation(Dependencies.JASYPT_SPRING_BOOT_STARTER)
|
||||
implementation(Dependencies.DISRUPTOR)
|
||||
implementation(Dependencies.JJWT)
|
||||
implementation(Dependencies.JSON_SIMPLE)
|
||||
implementation(Dependencies.SPRING_BOOT_STARTER_REDIS)
|
||||
implementation(Dependencies.JSR350)
|
||||
implementation(Dependencies.SPRING_CLOUD_STARTER)
|
||||
implementation(Dependencies.SPRING_CLOUD_FEIGN)
|
||||
implementation(Dependencies.MICROMETER_CORE)
|
||||
implementation(Dependencies.MICROMETER_REGISTRY_PROMETHEUS)
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
implementation("org.springframework.boot:spring-boot-starter-security")
|
||||
implementation("org.springframework.boot:spring-boot-starter-validation")
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.springframework.boot:spring-boot-starter-actuator")
|
||||
implementation("org.springframework.boot:spring-boot-starter-log4j2")
|
||||
implementation("org.projectlombok:lombok:1.18.24")
|
||||
implementation("io.springfox:springfox-boot-starter:3.0.0")
|
||||
implementation("io.springfox:springfox-swagger-ui:3.0.0")
|
||||
implementation("com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.4")
|
||||
implementation("com.lmax:disruptor:3.4.4")
|
||||
implementation("io.jsonwebtoken:jjwt-api:0.11.5")
|
||||
implementation("com.googlecode.json-simple:json-simple:1.1.1")
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-redis")
|
||||
implementation("com.google.code.findbugs:jsr305:3.0.2")
|
||||
implementation ("org.springframework.cloud:spring-cloud-starter-config")
|
||||
implementation("org.springframework.cloud:spring-cloud-starter-openfeign")
|
||||
|
||||
modules {
|
||||
module(ModuleLib.SPRING_BOOT_STARTER_LOGGING) {
|
||||
replacedBy(ModuleLib.SPRING_BOOT_STARTER_LOG4J2, "Use Log4j2 instead of Logback")
|
||||
module("org.springframework.boot:spring-boot-starter-logging") {
|
||||
replacedBy("org.springframework.boot:spring-boot-starter-log4j2", "Use Log4j2 instead of Logback")
|
||||
}
|
||||
}
|
||||
|
||||
compileOnly(Dependencies.LOMBOK)
|
||||
runtimeOnly(RuntimeOnlyLib.MYSQL)
|
||||
runtimeOnly(RuntimeOnlyLib.JJWT_IMPL)
|
||||
runtimeOnly(RuntimeOnlyLib.JJWT_JACKSON)
|
||||
annotationProcessor(Dependencies.LOMBOK)
|
||||
annotationProcessor(AnnotationProcessorLib.SPRING_BOOT_PROCESSOR)
|
||||
compileOnly("org.projectlombok:lombok")
|
||||
runtimeOnly("mysql:mysql-connector-java")
|
||||
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.11.5")
|
||||
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.11.5")
|
||||
annotationProcessor("org.projectlombok:lombok")
|
||||
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
|
||||
|
||||
testImplementation(TestLib.JUPITER)
|
||||
testImplementation(TestLib.SPRING_BOOT_STARTER)
|
||||
testImplementation(TestLib.SPRING_SECURITY)
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
testImplementation("org.springframework.security:spring-security-test")
|
||||
}
|
||||
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom(DependencyManagementLib.SPRING_CLOUD)
|
||||
mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
object Dependencies {
|
||||
|
||||
const val SPRING_BOOT_STARTER_DATA_JPA = "org.springframework.boot:spring-boot-starter-data-jpa:${Versions.SPRING_BOOT_STARTER}"
|
||||
const val SPRING_BOOT_STARTER_SECURITY = "org.springframework.boot:spring-boot-starter-security:${Versions.SPRING_BOOT_STARTER}"
|
||||
const val SPRING_BOOT_STARTER_VALIDATION = "org.springframework.boot:spring-boot-starter-validation:${Versions.SPRING_BOOT_STARTER}"
|
||||
const val SPRING_BOOT_STARTER_WEB = "org.springframework.boot:spring-boot-starter-web:${Versions.SPRING_BOOT_STARTER}"
|
||||
const val SPRING_BOOT_STARTER_ACTUATOR = "org.springframework.boot:spring-boot-starter-actuator:${Versions.SPRING_BOOT_STARTER}"
|
||||
const val SPRING_BOOT_STARTER_LOG4J2 = "org.springframework.boot:spring-boot-starter-log4j2:${Versions.SPRING_BOOT_STARTER}"
|
||||
const val SPRING_BOOT_STARTER_REDIS = "org.springframework.boot:spring-boot-starter-data-redis:${Versions.SPRING_BOOT_STARTER}"
|
||||
|
||||
const val SPRING_CLOUD_STARTER = "org.springframework.cloud:spring-cloud-starter-config:${Versions.SPRING_CLOUD_STARTER}"
|
||||
const val SPRING_CLOUD_FEIGN = "org.springframework.cloud:spring-cloud-starter-openfeign:${Versions.SPRING_CLOUD_STARTER}"
|
||||
|
||||
const val LOMBOK = "org.projectlombok:lombok:${Versions.LOMBOK}"
|
||||
|
||||
const val SPRING_FOX_STARTER = "io.springfox:springfox-boot-starter:${Versions.SPRING_FOX}"
|
||||
const val SWAGGER = "io.springfox:springfox-swagger-ui:${Versions.SPRING_FOX}"
|
||||
|
||||
const val JASYPT_SPRING_BOOT_STARTER = "com.github.ulisesbocchio:jasypt-spring-boot-starter:${Versions.JASYPT}"
|
||||
|
||||
const val DISRUPTOR = "com.lmax:disruptor:${Versions.DISRUPTOR}"
|
||||
|
||||
const val JJWT = "io.jsonwebtoken:jjwt-api:${Versions.JJWT}"
|
||||
const val JSON_SIMPLE = "com.googlecode.json-simple:json-simple:${Versions.JSON_SIMPLE}"
|
||||
|
||||
const val MICROMETER_CORE = "io.micrometer:micrometer-core:${Versions.MICROMETER}"
|
||||
const val MICROMETER_REGISTRY_PROMETHEUS = "io.micrometer:micrometer-registry-prometheus:${Versions.MICROMETER}"
|
||||
|
||||
const val JSR350 = "com.google.code.findbugs:jsr305:${Versions.JSR350}"
|
||||
|
||||
object ModuleLib {
|
||||
const val SPRING_BOOT_STARTER_LOGGING = "org.springframework.boot:spring-boot-starter-logging"
|
||||
const val SPRING_BOOT_STARTER_LOG4J2 = "org.springframework.boot:spring-boot-starter-log4j2"
|
||||
}
|
||||
|
||||
object RuntimeOnlyLib {
|
||||
const val MYSQL = "mysql:mysql-connector-java:${Versions.MYSQL_CONNECTOR_JAVA}"
|
||||
const val JJWT_IMPL = "io.jsonwebtoken:jjwt-impl:${Versions.JJWT}"
|
||||
const val JJWT_JACKSON = "io.jsonwebtoken:jjwt-jackson:${Versions.JJWT}"
|
||||
}
|
||||
|
||||
object AnnotationProcessorLib {
|
||||
const val SPRING_BOOT_PROCESSOR = "org.springframework.boot:spring-boot-configuration-processor:${Versions.SPRING_BOOT_STARTER}"
|
||||
}
|
||||
|
||||
object TestLib {
|
||||
const val JUPITER = "org.junit.jupiter:junit-jupiter-api:${Versions.JUPITER}"
|
||||
const val SPRING_BOOT_STARTER = "org.springframework.boot:spring-boot-starter-test:${Versions.SPRING_BOOT_STARTER}"
|
||||
const val SPRING_SECURITY = "org.springframework.security:spring-security-test:${Versions.SECURITY}"
|
||||
}
|
||||
|
||||
object DependencyManagementLib {
|
||||
const val SPRING_CLOUD = "org.springframework.cloud:spring-cloud-dependencies:${Versions.SPRING_CLOUD}"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
object Versions {
|
||||
|
||||
const val SPRING_BOOT_STARTER = "2.6.7"
|
||||
const val SPRING_DEPENDENCY_MANAGEMENT = "1.0.11.RELEASE"
|
||||
|
||||
const val SPRING_CLOUD_STARTER = "3.1.3"
|
||||
const val SPRING_CLOUD = "2021.0.3"
|
||||
|
||||
const val MYSQL_CONNECTOR_JAVA = "8.0.28"
|
||||
|
||||
const val LOMBOK = "1.18.24"
|
||||
const val SPRING_FOX = "3.0.0"
|
||||
const val JASYPT = "3.0.4"
|
||||
const val DISRUPTOR = "3.4.4"
|
||||
const val JJWT = "0.11.5"
|
||||
const val JSON_SIMPLE = "1.1.1"
|
||||
const val MICROMETER = "1.8.5"
|
||||
const val JSR350 = "3.0.2"
|
||||
|
||||
const val JUPITER = "5.8.1"
|
||||
const val SECURITY = "5.6.3"
|
||||
|
||||
}
|
||||
@@ -28,9 +28,8 @@ public class RefreshToken {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public RefreshToken changeToken(String token) {
|
||||
public void changeToken(String token) {
|
||||
this.token = token;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ public class JwtProvider {
|
||||
|
||||
private static final String AUTHORITIES_KEY = "auth";
|
||||
private static final String AUTHORITIES_DELIMITER = ",";
|
||||
private static final String ROLE = "ROLE_";
|
||||
|
||||
private final Key key;
|
||||
private final String prefix;
|
||||
@@ -90,7 +89,7 @@ public class JwtProvider {
|
||||
}
|
||||
|
||||
private String makeRoleName(String role) {
|
||||
return role.contains(ROLE) ? role.toUpperCase() : ROLE + role.toUpperCase();
|
||||
return "ROLE_" + role.toUpperCase();
|
||||
}
|
||||
|
||||
public Authentication getAuthentication(String token) {
|
||||
|
||||
@@ -5,8 +5,8 @@ import com.ticketing.server.global.redis.RefreshRedisRepository;
|
||||
import com.ticketing.server.global.redis.RefreshToken;
|
||||
import com.ticketing.server.global.security.jwt.JwtProperties;
|
||||
import com.ticketing.server.global.security.jwt.JwtProvider;
|
||||
import com.ticketing.server.user.service.dto.DeleteRefreshTokenDTO;
|
||||
import com.ticketing.server.user.service.dto.TokenDTO;
|
||||
import com.ticketing.server.user.service.dto.DeleteRefreshTokenDTO;
|
||||
import com.ticketing.server.user.service.interfaces.AuthenticationService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
@@ -40,14 +40,8 @@ public class AuthenticationServiceImpl implements AuthenticationService {
|
||||
// refresh 토큰이 있으면 수정, 없으면 생성
|
||||
refreshRedisRepository.findByEmail(email)
|
||||
.ifPresentOrElse(
|
||||
tokenEntity -> refreshRedisRepository.save(
|
||||
tokenEntity.changeToken(
|
||||
tokenDto.getRefreshToken()
|
||||
)
|
||||
),
|
||||
() -> refreshRedisRepository.save(
|
||||
new RefreshToken(email, tokenDto.getRefreshToken())
|
||||
)
|
||||
tokenEntity -> tokenEntity.changeToken(tokenDto.getRefreshToken()),
|
||||
() -> refreshRedisRepository.save(new RefreshToken(email, tokenDto.getRefreshToken()))
|
||||
);
|
||||
|
||||
return tokenDto;
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
server:
|
||||
port: 8443
|
||||
address: 0.0.0.0
|
||||
|
||||
http:
|
||||
port: 8080
|
||||
|
||||
ssl:
|
||||
key-store: classpath:keystore/ticketing.p12
|
||||
key-store-password: ENC(OMvGcpZLpggFTiGNkqNe66Zq/SmJXF6o)
|
||||
key-store-type: PKCS12
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://ticketing-db/ticketing?serverTimezone=Asia/Seoul&characterEncoding=UTF-8
|
||||
username: ENC(LowN1n4w0Ep/DqLD8+q5Bq6AXM4b8e3V)
|
||||
password: ENC(OMvGcpZLpggFTiGNkqNe66Zq/SmJXF6o)
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
jpa:
|
||||
properties:
|
||||
hibernate:
|
||||
show_sql: true
|
||||
format_sql: true
|
||||
hibernate:
|
||||
ddl-auto: validate
|
||||
|
||||
redis:
|
||||
host: 172.18.0.3
|
||||
port: 6379
|
||||
|
||||
application:
|
||||
name: monitoring
|
||||
|
||||
|
||||
@@ -26,24 +26,6 @@ spring:
|
||||
config:
|
||||
import: "optional:configserver:"
|
||||
|
||||
application:
|
||||
name: monitoring
|
||||
|
||||
management:
|
||||
endpoint:
|
||||
metrics:
|
||||
enabled: true
|
||||
prometheus:
|
||||
enabled: true
|
||||
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health, info, metrics, prometheus
|
||||
|
||||
metrics:
|
||||
tags:
|
||||
application: ${spring.application.name}
|
||||
|
||||
jasypt:
|
||||
encryptor:
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user