본문 바로가기

Spring28

[spring / spring security] 02-1. 구글 연동 및 시큐리티 설정 build.gradle에 의존성 추가 implement 'org.springframework.boot:spring-boot-starter-oauth2-client' spring-boot-starter-oauth2-client 소셜 로그인 등 클라이언트 입장에서 소셜 기능 구현시 필요한 의존성이다. spring-security-oauth2-client 와 spring-security-oauth2-jose를 기본적으로 관리한다. config.auth패키지 생성 @EnableWebSecurity - spring security 설정들을 활성화시켜준다. @csrf().disable().headers().frameOptions().disable() - h2-console화면을 사용하기 위해ㅐ 해당 옵션들을 dis.. 2022. 9. 14.
[spring / JPA]spring JPA auditing ; 시간 자동화에 대하여 JPA Auditing : 생성시간, 수정 시간 자동화 하기 엔티티에는 해당 데이터의 생성 시간과 수정 시간을 포함한다. 언제 만들어졌는지, 언제 수정되었는지 등은 차후 유지보수에 중요 요소이다. 그래서 매번 dB 삽입하기 전, 갱신 전 날짜데이터를 등록/수정하는 코드가 여러군데 필요하다. 단순하고 반복적인 코드를 깔끔하게 정리하기 위해 JPA Auditing을 사용한다. localDate, localDateTime 사용 BaseTimeEntity : 모든 Entity의 상위 클래스가 되어 Entity들의 cretedDate, modiftedDate를 자동으로 관리하는 역할 @Getter @MapperSuperclass @EntityListeners(AuditiingEntityM=Listener.clas.. 2022. 9. 12.
[Spring / Spring Security] 01. 스프링 시큐리티 개요 및 특징, 방법 개요 Sping Security : 인증, 인가 기능을 가진 프레임워크 : 보안을 위한 표준이라고 생각 Spring Security ↔ 인터셉터, 필터 기반 보안 기능 구현 공식문서 : https://spring.io/projects/spring-security Spring Security Spring Security is a framework that focuses on providing both authentication and authorization to Java applications. Like all Spring projects, the real power of Spring Security is found in how easily it can be extended to meet custom r.. 2022. 9. 12.
[spring / 기본] 핵심 core 강의 04. 주문, 할인 도메인 실행과 테스트/ 05. 객체 지향성 체크(원리 적용) 단위테스트 : spring, container 없이 순수 java 코드로 test 하는 것. 핵심은 클라이언트 - 주문서비스 요구사항 추가된다면, 문제점 : DI, OCP를 적용시키지 못하게 될 수도 있다. junit5 : ctrl + shift + T test 만들기 junit5 부터 @DisplayName : 한글로 요구사항 정리해도 된다. java 기본 문법 import static org.assertj.core.api.Assertions.*; alt + enter : static import 2022. 8. 29.