Skip to content

Instantly share code, notes, and snippets.

@GHGHGHKO
GHGHGHKO / PalWorldSettings.ini
Last active March 2, 2024 11:02
Hard PalWorldSettings
[/Script/Pal.PalGameWorldSettings]
OptionSettings=(Difficulty=hard,DayTimeSpeedRate=1.000000,NightTimeSpeedRate=1.000000,ExpRate=0.800000,PalCaptureRate=1.000000,PalSpawnNumRate=1.000000,PalDamageRateAttack=1.000000,PalDamageRateDefense=1.000000,PlayerDamageRateAttack=0.500000,PlayerDamageRateDefense=2.000000,PlayerStomachDecreaceRate=1.000000,PlayerStaminaDecreaceRate=1.000000,PlayerAutoHPRegeneRate=1.000000,PlayerAutoHpRegeneRateInSleep=1.000000,PalStomachDecreaceRate=1.000000,PalStaminaDecreaceRate=1.000000,PalAutoHPRegeneRate=1.000000,PalAutoHpRegeneRateInSleep=1.000000,BuildObjectDamageRate=1.000000,BuildObjectDeteriorationDamageRate=1.000000,CollectionDropRate=0.500000,CollectionObjectHpRate=1.000000,CollectionObjectRespawnSpeedRate=1.000000,EnemyDropItemRate=0.500000,DeathPenalty=All,bEnablePlayerToPlayerDamage=False,bEnableFriendlyFire=False,bEnableInvaderEnemy=True,bActiveUNKO=False,bEnableAimAssistPad=True,bEnableAimAssistKeyboard=False,DropItemMaxNum=3000,DropItemMaxNum_UNKO=100,BaseCampMaxNum=128,
{
"version": "v0.12.9",
"notes": "Revert feat: add gfycat",
"pub_date": "2023-09-08T16:30:57Z",
"platforms": {
"darwin-x86_64": {
"signature": "Content of app.tar.gz.sig",
"url": "https://github.com/GHGHGHKO/dalgona/releases/download/v0.12.9/dalgona_x64.app.tar.gz"
},
"darwin-aarch64": {
@GHGHGHKO
GHGHGHKO / UserControllerTest.kt
Created February 23, 2023 13:06
UserControllerTest accessDenied test code
@Test
fun `권한 문제로 유저 정보를 가져오지 못한다`() {
val signInRequestDto = SignInRequestDto(
email = ID + 0 + EMAIL,
password = PASSWORD
)
token = signService.signIn(signInRequestDto).token
@GHGHGHKO
GHGHGHKO / SecurityConfig.kt
Created February 23, 2023 13:05
SecurityConfig filterChain
.requestMatchers("/users/**").hasRole("ADMIN")
.anyRequest().hasRole("USER")
.and()
.exceptionHandling().accessDeniedHandler(accessDeniedHandlerCustom)
.and()
.exceptionHandling().authenticationEntryPoint(authenticationEntryPointCustom)
@GHGHGHKO
GHGHGHKO / exception_en.properties
Created February 23, 2023 13:03
exception_en.properties accessDenied
accessDenied.code = -1003
accessDenied.message = A resource that can not be accessed with the privileges it has.
@GHGHGHKO
GHGHGHKO / exception.properties
Created February 23, 2023 13:02
kr exception.properties accessDenied
accessDenied.code = -1003
accessDenied.message = 보유한 권한으로 접근할 수 없는 리소스 입니다
@GHGHGHKO
GHGHGHKO / ExceptionAdvice.kt
Created February 23, 2023 13:02
ExceptionAdvice accessDeniedException
@ExceptionHandler(value = [AccessDeniedException::class])
fun accessDeniedException(): ResponseEntity<CommonResult> {
return ResponseEntity
.status(HttpStatus.FORBIDDEN)
.body(responseService.failResult(
getMessage("accessDenied.code").toInt(),
getMessage("accessDenied.message")))
}
@GHGHGHKO
GHGHGHKO / AccessDeniedHandlerCustom.kt
Created February 23, 2023 12:51
AccessDeniedHandlerCustom AccessDeniedHandler
package com.example.pepega.common.config.security
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.security.access.AccessDeniedException
import org.springframework.security.web.access.AccessDeniedHandler
import org.springframework.stereotype.Component
import org.springframework.web.servlet.HandlerExceptionResolver
@GHGHGHKO
GHGHGHKO / UserControllerTest.kt
Created February 23, 2023 12:05
UserControllerTest success get all users
@Test
fun `모든 유저 정보를 가져온다`() {
mockMvc.get("/users/v1") {
contentType = MediaType.APPLICATION_JSON
header(X_AUTH_TOKEN, token)
}
.andDo { print() }
.andExpect { status { isOk() } }
.andExpect { jsonPath("$.success") { value(true) } }
@GHGHGHKO
GHGHGHKO / UserControllerTest.kt
Created February 23, 2023 12:04
UserControllerTest BeforeEach
@BeforeEach
fun setUp() {
val roles = mutableListOf<String>()
roles.add("ROLE_USER")
roles.add("ROLE_ADMIN")
userMasterRepository.save(
UserMaster(
email = ADMIN,