inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

이야기를 나눠요

173만명의 커뮤니티!! 함께 토론해봐요.

빠르게 코딩하기 위한 단축기 문의 (팁)

[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)

삭제된 글입니다

  • python
  • 머신러닝
  • 빅데이터
  • pandas
  • 빅데이터분석기사
hello4298 댓글 1 좋아요 0 조회수 444

spring-boot 2.7 이상을 사용 하시는 분의 경우

Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)

안녕하세요. 강사님께서는 2.6 버전을 사용 권장 하셨지만 왠지 모를 궁금함에 2.7에서 사용하는 spring security 5.7 이상에서 바뀐 부분으로 한번 적용을 해보고 싶었습니다. 인프런에 올라온 많은 분들의 질문을 정리 하여 만들어 보았습니다. package com.example.userservice.security; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.web.SecurityFilterChain; import com.example.userservice.service.UserService; import lombok.RequiredArgsConstructor; @Configuration @EnableWebSecurity @RequiredArgsConstructor public class WebSecurity { private final UserService userService; private final BCryptPasswordEncoder bCryptPasswordEncoder; private final Environment env; AuthenticationManager authenticationManager; // spring.boot 2.7 부터는 WebSecurityConfigurerAdapter가 아닌 // SecurityFilterChain 을 사용 합니다. @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { AuthenticationManagerBuilder authenticationManagerBuilder = http.getSharedObject(AuthenticationManagerBuilder.class); authenticationManagerBuilder.userDetailsService(userService).passwordEncoder(bCryptPasswordEncoder); authenticationManager = authenticationManagerBuilder.build(); //AuthenticationFilter authenticationFilter = new AuthenticationFilter(); //authenticationFilter.setAuthenticationManager(authenticationManager); AuthenticationFilter authenticationFilter = new AuthenticationFilter(authenticationManager , userService , env); http.csrf().disable(); http.authorizeRequests() //.antMatchers("/error/**").permitAll() // public abstract java.lang.String javax.servlet.ServletRequest.getRemoteAddr() is not supported 보기 싫을때 활성화 .antMatchers("/**") .hasIpAddress("127.0.0.1") .and() .authenticationManager(authenticationManager) .addFilter(authenticationFilter) ; http.headers().frameOptions().disable(); return http.build(); } //ex) 기존의 경우 AuthenticationManagerBuilder 를 오버라이드 하여 사용 하였지만 filterChain 안에서 호출 하여 설정 합니다. /* protected void configure(AuthenticationManagerBuilder auth) throws Exception{ auth.userDetailsService(userService).passwordEncoder(bCryptPasswordEncoder); } */ //ex)filter를 authenticationAmanger에 주입 하던 getAuthenticationFilter역시 filterChain 내부에서 사용 합니다. /* private AuthenticationFilter getAuthenticationFilter() throws Exception { AuthenticationFilter authenticationFilter = new AuthenticationFilter(); authenticationFilter.setAuthenticationManager(authenticationManager); return authenticationFilter; } */ }

  • spring-boot
  • jpa
  • 아키텍처
  • spring-cloud
  • kafka
  • msa
최재영 댓글 0 좋아요 1 조회수 2550

정말 꿀팁 강의입니다...

파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트

본 강의에서 알려주신 판다스 및 이미지 활용 예제를 알려주셔서 감사합니다. 강의 후반에 알려주신 것 처럼 활용 할 수 있는 부분이 굉장히 많아 보입니다. 판다스 예제를 views.py에 녹여 봤는데, 잘 출력됩니다 ㅎㅎ 이후 템플릿 폴더 내부 html 파일을 생성해서 디자인 좀 추가해 출력하면 분석 툴 제작도 충분히 가능할 듯 싶네요. 강의 중반까지 듣고 시도해 보겠습니다 :)

  • pandas
  • images
이재화 댓글 1 좋아요 3 조회수 325

MSA 와 관련하여 질문드립니다.

스프링 MVC 2편 - 백엔드 웹 개발 활용 기술

안녕하세요 완강 후 추가적으로 궁금한 사항이 있어서 글을 올리게 되었습니다. 요즘 대세인 MSA와 관련하여 여쭙고 싶어서 연락드립니다. [문제상황] MSA와 관련하여 아키텍쳐에서는 요청에 맞추어 반응하는 서버를 만들기 위하여 docker container 를 활용한 서버들을 많이 구성하는 걸로 알고 있습니다. 이때, Spring boot은 다양한 기능들을 제공하지만 python의 flask나 Fastapi와 같은 가벼운 프레임워크에 비해서는 안좋은 점들이 있을것이라 생각듭니다. (예를 들어서 컨테이너의 용량이 크고, 콜드 스타트의 시작이 늦다는 점... 이 대표적으로 생각납니다.) [질의사항] 1. Springboot 로 MSA를 구성하였을 경우 앞서 얘기드렸던 문제점이 없는지 여부 2. Springboot 가 MSA에서 갖는 장점 3. 프레임워크의 무겁다와 가볍다의 개념이 무엇인지 궁금합니다. 4. 배민에서는 JAVA를 사용하여 프로젝트를 진행하는데, 우리나라의 경우 JAVA를 사용하는 시니어개발자들이 많아 사용하는 걸로 알고있습니다. 만약 그렇지 않았다면, JAVA Spring boot 가 아닌 다른 프레임워클 사용하여 개발하였을지 궁금합니다. 감사합니다.

  • spring
  • msa
정영호 댓글 1 좋아요 0 조회수 614

인기 태그

인프런 TOP Writers

주간 인기글