Server๐งค/SpringSecurity
๋ด๋ถ๊ตฌ์กฐ SecurityContext context = SecurityContextHolder.getContext(); // Security Context Authentication authentication = context.getAuthentication(); // authentication authentication.getPrincipal(); authentication.getAuthorities(); authentication.getCredentials(); authentication.getDetails(); authentication.isAuthenticated(); SecurityContextHolder SecurityContextHolder๋ SecurityContext๋ฅผ ์ ๊ณตํ๋ stati..
Server๐งค/SpringSecurity
Spring Security ๋ ์ธ์ฆ๊ณผ ์ธ๊ฐ๋ผ๋ ๊ฐ๋
์ ์ต๋ํ ์ฝ๊ณ ์ ์ฐํ๊ฒ ๊ตฌํํ ์ ์๋๋ก ๋ง๋ค์ด์ง Framework Spring์ ์ฌ์ฉํ๋ค๋ฉด ์ฌ์ค์ ์ต์ ์ Security Framework Web ๊ธฐ๋ฐ Application์ ๋ณด์์ ์ธ ์ ํ์ ์ถ๊ฐํ๊ธฐ ์ํด ์ฌ์ฉํ๋ Security Framework ์ค์ ํ๋ Rest API endpoint, mvc url, ์ ์ ๋ฆฌ์์ค์๊ฐ์ ๋ฆฌ์์ค๋ค์ ์ ๊ทผํ๋ ค๋ ์์ฒญ์ ์ธ์ฆ์ ์ฑ
์์ง๋ ๊ฒ. Spring ์ํ๊ณ์ ํธํ์ฑ์ด ๋๊ณ ์ปค์คํ
์ด ๋งค์ฐ ์ฝ๋ค. ์ธ์ฆ ์ฌ์ฉ์๊ฐ ๋๊ตฌ์ธ์ง ํ์ธํ๋ ์ ์ฐจ. ์ฆ, "๋น์ ์ ๋๊ตฌ์
๋๊น?"๋ฅผ ํ์ธ ์ฌ๊ธฐ์ ๋ฌธ์ ์ ์ด ๋ฐ์ํ๋ค. ์ดํ์ ์ ์ ๊ฐ UserA๋ผ๋ ๊ฒ์ ์ด๋ป๊ฒ ์ฆ๋ช
ํ ์ ์์๊น? ๋ฐฉ๋ฒ 1 : ๋ชจ๋ ์์ฒญ๋ง๋ค ๋์ ID์ ํจ์ค์๋๋ฅผ ํฌํจ์์ผ์..
Server๐งค/QueryDsl
Soptmakers์์, ๋๋ง์๊ธฐ ๊ธฐ๋ฅ์ ๊ตฌํํ๋ค. ์ฒ์ MVP๋ ๋ชจ๋ ํ์ฐจ์ ๋๋ง์๊ธฐ ๋ชฉ๋ก์ ๋ณด์ด๋๋ก ํ๊ธฐ๋ก ํ๋ค. ๋ฌดํ ์คํฌ๋กค์ ๊ตฌํํ ๋๋ limit, cursor, hasNext์ ๊ฐ์ ํ๋๊ฐ ํ์ํ๋ค. limit : ํ์ด์ง ์ฌ์ด์ฆ cursor: ์ฝ๊ณ ์ถ์ ํ์ ๋ฐ์ดํฐ ๊ฐ์ hasNext: ์คํฌ๋กค ์ดํ ๊ทธ ๋ค์ ๋ฐ์ดํฐ๊ฐ ๋จ์์๋์ง ์๋์ง ํ๋จํ๋ ํ๋ ๋ฌธ์ ์ ๋ฐ์ ์ ์ฒด ์กฐํํ๋ ๊ฒฝ์ฐ์, ์ค๋ณต๋๋ ๋ฐ์ดํฐ๊ฐ ๋ณด์ด๊ฒ๋จ limit์ 10 cursor๋ 10, 20, 30~ ์ ๊ฐ์ผ๋ก ์์ฒญ ์ด ๊ณผ์ ์์, (0 ~ 10) (10 ~ 20) (20 ~ 30) ์ค๊ฐ์ ๊ฐ๋ค์ด ์ค๋ณต๋๋ ํ์ ๋ฐ์ ๐Offest Based Pagination @Repository @RequiredArgsConstructor publi..
Server๐งค/JPA
JPA ๊ฐ์ Persistence Java ๊ฐ์ฒด(์ ํฌํจ๋์ด์๋ ๋ฐ์ดํฐ)๋ฅผ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ํตํด ์ ์ฅ ๋ฐ ๊ด๋ฆฌํจ์ผ๋ก์จ ๊ฐ์ฒด์ ์์์ฑ์ ๋ณด์ฅํจ Java Persistence API Object-Relational Mapping(ORM) ์ ์คํํ๊ธฐ ์ํ Java ํ์ค API Entity๋ก ์ ์๋ Java ๊ฐ์ฒด์ ๋ฐ์ดํฐ ๋ฒ ์ด์ค ์ฌ์ด์ mapping ๋ฐฉ๋ฒ์ ์ค์ (annotation ์ด์ฉ) ์ค์ ๋ Mapping์ ๋ฐ๋ผ Java๊ฐ์ฒด๋ฅผ DB์ ์ ์ฅ, ์์ , ์ญ์ ๊ฒ์ ํ ์ ์๋ Interface ์ ๊ณต -> EntityManager JDBC API๋ Data Mapper (ex: MyBatis)์ ๋์ Java ์ค์ฌ์ ๋ฐ์ดํฐ ๊ด๋ฆฌ๊ฐ ๊ฐ๋ฅํด์ง๋ค. Persistence Provider (JPA Provider) JPA์..