-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Security 작업 및 Request Response Logging (#11)
* feat: Add Security Config * feat: Create Request Response Log * chore: re setting module * feat: Add BadRequest Exception * feat: Add BusinessException * feat: Add Unauthorized * feat: separate sealed class * feat: Add Conflict Exception * feat: Add NotFound Exception * feat: Add ServiceUnavailable Exception * feat: Add InternalServerError Exception * feat: Add NotAcceptable Exception * feat: Add UnsupportedMediaType Exception * feat: Add Bad Request Detail Case * feat: Add Unauthorized Detail Case * feat: Add Sns Auth Type * feat: Add SnsType * feat: Add SnsType attribute convertor * feat: Add UserEntity * feat: Add UserEntity * feat: Add User detail for security * feat: Add user domain model * feat: Add user mapper * style: add comma * feat: change private id to public * feat: Create LoadUserInputBoundary * feat: Create UserGateway * feat: Add User find feature * build: Add jwt category bundle * build: Add springdoc dependency * feat: Add JwtConfig file * feat: Add jwt value property in JwtConfig * style: fix style * style: fix typo * build: Add Mockk Dependency mockito 의존성 제거 및 mockK 의존성 추가 * build: Add JwtConfigContract * build: Add mockK in version catalog * feat: Add AuthToken Domain Model * feat: Add BeIssuedAuthTokenUseCase * feat: Add BeIssuedAuthTokenUseCase * feat: Move ZoneId to JwtConfigContract Companion * feat: Add jwt validate usecase * feat: Move ZoneId to JwtConfigContract Companion * test: Add unexpired token verification test * feat: Add AuthenticationToken * chore: Fix file name * test: Add Unauthorized Case Test * feat: move magic string to companion object * feat: change magic string to const * feat: Change Validate Use Case to Extract Token Use Case * feat: Fix Extract token throw method * feat: Add Jwt Authentication with Security * chore: Fix CI action * chore: Fix CI action * chore: Fix CI action * chore: Fix CI action * chore: Fix CI action test files path
- Loading branch information
Showing
87 changed files
with
1,377 additions
and
614 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
tasks: | ||
description: gradle execute option | ||
type: string | ||
|
||
jobs: | ||
gradle-task: | ||
strategy: | ||
matrix: | ||
gradle: ${{ fromJSON(inputs.tasks) }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.CI_TOKEN }} | ||
submodules: true | ||
|
||
- name: Gradle cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Run Gradle Task | ||
run: ./gradlew ${{matrix.gradle}} |
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
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
11 changes: 0 additions & 11 deletions
11
module-api/src/main/kotlin/universe/sparkle/moduleapi/ModuleApiApplication.kt
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
module-api/src/test/kotlin/universe/sparkle/moduleapi/ModuleApiApplicationTests.kt
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
...e-domain/src/main/kotlin/universe/sparkle/modulecoredomain/ModuleCoreDomainApplication.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
module-data/src/main/kotlin/universe/sparkle/moduledata/ModuleDataApplication.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
module-data/src/test/kotlin/universe/sparkle/moduledata/ModuleDataApplicationTests.kt
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
module-domain/src/main/kotlin/universe/sparkle/domain/JwtConfigContract.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package universe.sparkle.domain | ||
|
||
import java.time.ZoneId | ||
|
||
interface JwtConfigContract { | ||
fun getSecret(): String | ||
fun getAccessExpiryPeriodDay(): Long | ||
fun getRefreshExpiryPeriodDay(): Long | ||
|
||
companion object { | ||
val zoneIdKST = ZoneId.of("Asia/Seoul") | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
module-domain/src/main/kotlin/universe/sparkle/domain/SnsType.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package universe.sparkle.domain | ||
|
||
enum class SnsType { | ||
KAKAO, GOOGLE, APPLE; | ||
|
||
companion object { | ||
fun findSnsTypeBy(snsTypeName: String): SnsType { | ||
return values().find { it.name == snsTypeName } | ||
?: throw IllegalArgumentException("Unsupported social login type: $snsTypeName") | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
module-domain/src/main/kotlin/universe/sparkle/domain/exception/BadRequest.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package universe.sparkle.domain.exception | ||
|
||
sealed class BadRequest( | ||
code: Int, | ||
message: String, | ||
) : BusinessException(code, message) { | ||
data class InvalidRequestMethod( | ||
override val message: String = "잘못된 방식의 요청입니다.", | ||
) : BadRequest(1001, message) | ||
|
||
data class AlreadyGameCreated( | ||
override val message: String = "이미 승부가 생성되었습니다.", | ||
) : BadRequest(1002, message) | ||
|
||
data class UserNotExistent( | ||
override val message: String = "존재하지 않는 유저의 요청입니다.", | ||
) : BadRequest(1003, message) | ||
|
||
data class AlreadyGameDone( | ||
override val message: String = "이미 게임이 종료 되었습니다.", | ||
) : BadRequest(1004, message) | ||
|
||
data class CoupleNotExistent( | ||
override val message: String = "존재하지 않는 커플의 요청입니다.", | ||
) : BadRequest(1005, message) | ||
|
||
data class InvalidInviteCode( | ||
override val message: String = "올바르지 않은 초대 코드입니다.", | ||
) : BadRequest(1006, message) | ||
|
||
data class PartnerResultNotEntered( | ||
override val message: String = "상대방이 아직 결과를 입력하지 않았습니다.", | ||
) : BadRequest(1007, message) | ||
} |
6 changes: 6 additions & 0 deletions
6
module-domain/src/main/kotlin/universe/sparkle/domain/exception/BusinessException.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package universe.sparkle.domain.exception | ||
|
||
sealed class BusinessException( | ||
open val code: Int, | ||
override val message: String, | ||
) : RuntimeException(message) |
Oops, something went wrong.