현실을 넘어
close
프로필 배경
프로필 로고

현실을 넘어

  • 분류 전체보기
    • 자바
      • 일반
      • 알고리즘
      • 객사오
      • 스프링입문객체지향
      • 리팩토링
      • 스프링부트3
      • JPA
      • QueryDsl
      • Spring Security
    • 코틀린
      • 코틀린인액션
      • 알고리즘
    • 일 관련 삽질
    • JIRA
    • 도메인주도개발
    • DB
      • Mysql
    • MQ
      • Apache Kafka
    • Docker-Kubernetes
    • GITHUB
    • REST API
    • 리눅스
  • 홈
  • 태그
  • 방명록

[프로젝트] RestDocs 커스텀 유저 모킹 `@MockMember` 적용기

개요@MockMember 어노테이션의 경우 테스트 환경에서 시큐리티에서 인증된 사용자의 모의(Mock) 하기 위해서 사용된다.일반적인 경우에는 @WithMockUser 등의 사용자 모킹을 하면 되겠지만..나는 @WithMockUser 가 사용을 해도 일단 인증을 받아 올 수가 없었다.그래서 검색하던 중에 발견한 것이 별도의 커스텀 어노테이션을 통하여 SecurityContext 안의 보안 객체를 커스텀하게 테스트코드에서만 채우는 방법이 있다는 것을 발견했다.어노테이션 코드@Retention(RetentionPolicy.RUNTIME) @WithSecurityContext(factory = MockMemberSecurityContextFactory.class) public @interface MockMem..

  • format_list_bulleted 자바/리팩토링
  • · 2024. 2. 2.
  • textsms

[프로그래머스] 정수삼각형

package org.example.알고리즘.정수삼각형; import java.util.Arrays; class Solution { public static void main(String[] args) { Solution solution = new Solution(); System.out.println(solution.solution(new int[][]{ {7}, {3, 8}, {8, 1, 0}, {2, 7, 4, 4}, {4, 5, 2, 6, 5}, })); } public int solution(int[][] triangle) { int[][] dp = new int[triangle.length][triangle.length]; dp[0][0] = triangle[0][0]; for (int i =..

  • format_list_bulleted 자바/알고리즘
  • · 2024. 1. 19.
  • textsms
[JWT] 리프레쉬 토큰 - 엑세스 토큰

[JWT] 리프레쉬 토큰 - 엑세스 토큰

엑세스 토큰클라이언트가 리소스 서버의 보호된 리소스에 접근할 수 있도록 하는 짧은 유효 기간을 가진 토큰이다.리프레시 토큰엑세스 토큰이 만료된 경우 새로운 엑세스 토큰을 발급받기 위해 사용되는 토큰일반적으로 엑세스 토큰보다 긴 유효기간을 가진다.OAUTH2 에서의 토큰 인증방식토큰의 생성사용자가 자격 증명으로 인증 서버에서 인증을 마치면서버는 2가지의 토큰을 발급한다엑세스 토큰짧은 수명보호된 리소스에 접근하는 데 사용된다.리프레시 토큰긴 수명엑세스 토큰을 얻는데 사용엑세스 토큰의 사용클라이언트는 엑세스 토큰을 리소스 서버에 제공보호된 데이터에 접근리소스 서버는 엑세스 토큰 검증유효요청을 처리유효X401 인가되지 않은 에러 떨굼엑세스 토큰의 만료시엑세스 토큰이 만료시 보호된 리소스에 접근 불가리프레시 토큰..

  • format_list_bulleted 자바/Spring Security
  • · 2024. 1. 19.
  • textsms

[리팩토링] properties 파일을.. yaml 로 변경하면서 생긴, gradle 문제 해결

Properties 파일을 Yaml 로 변경하면서 현재 domain 기존 설정 부분이 null 로 넘어오는 문제가 생겼다props 의 경우 키 - 밸류( LinkedHashMap ) 으로 데이터를 호출함.문제는 해당 key value 구조의 yaml 을 기존과 같이 들고오려면.. profile 에서 props 구분을 [spring.profile.active] 로 할 수 있는게 아니라props[키][키][키] ⇒ 이런식으로 호출하도록 해야함; 해결법yaml 의 평면화 작업키 밸류 구조를 기존 properties 의 방식처럼키.키.키 ⇒ 이런식으로 평탄화재귀를 해야한다. ⇒ 솔직히 이런 작업에서 재귀를 돌리고 싶지 않았다.키값으로 직접 호출해결import org.yaml.snakeyaml.Yaml def l..

  • format_list_bulleted 자바/리팩토링
  • · 2024. 1. 19.
  • textsms

[Security] PasswordEncoder..?

@Bean public PasswordEncoder passwordEncoder() { return PasswordEncoderFactories.createDelegatingPasswordEncoder(); }PasswordEncoder 빈 주입return new BCryptPasswordEncoder(); -> return PasswordEncoderFactories.createDelegatingPasswordEncoder();으로 변경하였다.Password Storage :: Spring SecuritySpring Security’s PasswordEncoder interface is used to perform a one-way transformation of a password to let the..

  • format_list_bulleted 자바/Spring Security
  • · 2024. 1. 19.
  • textsms
[Security] __AuthorizationFilter?__

[Security] __AuthorizationFilter?__

Authorize HttpServletRequests with AuthorizationFilter :: Spring SecurityThis version is still in development and is not considered stable yet. For the latest stable version, please use Spring Security 6.2.1!https://docs.spring.io/spring-security/reference/5.7-SNAPSHOT/servlet/authorization/authorize-http-requests.html#page-titleAuthorizationFilter?인증된 요청이 특정 자원에 대한 접근 권한을 가지고 있는지 확인하는 역할임스프링 필터..

  • format_list_bulleted 자바/Spring Security
  • · 2024. 1. 19.
  • textsms
  • navigate_before
  • 1
  • ···
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • ···
  • 49
  • navigate_next
공지사항
  • ㅇ
전체 카테고리
  • 분류 전체보기
    • 자바
      • 일반
      • 알고리즘
      • 객사오
      • 스프링입문객체지향
      • 리팩토링
      • 스프링부트3
      • JPA
      • QueryDsl
      • Spring Security
    • 코틀린
      • 코틀린인액션
      • 알고리즘
    • 일 관련 삽질
    • JIRA
    • 도메인주도개발
    • DB
      • Mysql
    • MQ
      • Apache Kafka
    • Docker-Kubernetes
    • GITHUB
    • REST API
    • 리눅스
최근 글
인기 글
최근 댓글
태그
  • #도메인주도개발
  • #ddd
  • #리팩토링
  • #객사오
  • #객체지향
  • #자바
  • #Kotlin
  • #QueryDSL
  • #알고리즘
  • #JPA
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바