분류 전체보기
-
[보안] HTTPS/SSL/MAC/전자서명 - 헷갈렸던 개념 한줄 씩 정리🩸 삽질의 추억 2024. 4. 20. 00:55
키 1. 보안에 필요한 키는 데이터 전송이 있기 전, 사전에 교환한다. 2. 대칭 키 방식은 키를 교환하는 과정에서 중간자가 이를 탈취하면 이후 모든 데이터를 도청 가능. 3. https 프로토콜에서 사용되는 '키'는 개발자가 직접 사용하는 것이 아니라, 데이터 통신 과정에서 SSL/TSL 계층이 이를 담당하여 암호화 복호화할 때 알아서 사용함. 4. https 통신에서 사용되는 대칭키 == 세션키. 통신이 끝나면 폐기 되기때문에 세션키라고도 불림. 5. https 에서 사용되는 '키' 와 MAC(HMAC) 에서 사용 되는 '비밀 공유 키' 는 다른 개념이다. 후자는 송신자와 수신자가 데이터 해싱에 직접 사용하는 키(=비밀값) 이다. 6. 디지털 서명에서 사용되는 키는 애플리케이션 단(=직접 사용)에서 ..
-
[JPA SQL (JPQL)] @Query 작성했더니 빈 값 리턴🩸 삽질의 추억 2024. 4. 18. 16:09
상황 spring boot 3.2.x 사용, @Query 로 SQL 직접 작성한 메소드 실행 시에 빈값이 리턴 됨. 어노테이션 없는 기본 메소드는 잘 실행되는데? @Query("SELECT t FROM TransactionHistory t " + "WHERE t.senderAccountId = :accountId OR t.receiverAccountId = :accountId ORDER BY t.createdAt DESC") List findByAccountId(@Param("accountId") String accountId); - String type 의 Param 을 넘김, - Controller 에서 다음과 같이 작성 @RequestBody String 해결 swagger 상에서 "따옴표" 없이 ..
-
[Spring Boot] swagger 로 테스트 중, body를 넘기는데 null 값이 들어왔다고 함🩸 삽질의 추억 2024. 4. 17. 19:57
상황 swagger 로 테스트 함. body 를 모.두. 작성해서 넘겼는데 null 값이 들어왔다고 에러가 뜸 ㅡㅡ 해결 import org.springframework.web.bind.annotation.RequestBody; 어노테이션 Import 를 제대로 했는지 확인할 것. springframework 에서 import 했는지.. 삽질한 이유 import io.swagger.v3.oas.annotations.parameters.RequestBody; swagger 의 RequestBody 를 import 함 ㅡㅡ 참고 https://stackoverflow.com/questions/38935912/requestbody-is-getting-null-values @RequestBody is getti..
-
[Docker, MongoDB] 도커에 올렸더니 Authentication failed🩸 삽질의 추억 2024. 4. 14. 14:51
상황: docker compose up(혹은 run) 후, swagger 까지는 잘 들어가지는데 execute 를 하면 Authenication failed 가 뜨는 경우이다. + 로컬에선 문제 없었음 해결 // docker-compose.yml version: '3.8' services: mongodb: (중략) environment: - MONGO_INITDB_DATABASE=chatDB - MONGO_INITDB_ROOT_USERNAME=root - MONGO_INITDB_ROOT_PASSWORD=root app: (중략) environment: - SPRING_DATA_MONGODB_URI=mongodb://root:root@mongodb:27017/chatDB?authSource=admin //..
-
[Docker+원격서버] 플랫폼 호환- 옵션 부여/compose.yml 에 작성🩸 삽질의 추억 2024. 4. 14. 09:50
문제 상황 The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested 이미지를 빌드할때 생성된 빌드 플랫폼이 호환되지 않는디는 뜻이다. 해결 방법 1. docker build 시에 --platform linux/amd64 옵션 값을 부여한다 2. 매번 부여하기 귀찮다! docker-compose.yml 에 설정해서 자동화하고 싶다 services: app: image: seoyoungyoon/eum-chat:latest platform: linux/amd64 ports: - "외부 포트:내부 포트"
-
[CORS, Spring Boot] WebMvcConfigurer 설정 후에도 access-control-allow-headers 에러🩸 삽질의 추억 2024. 4. 14. 04:37
Access to fetch at ‘https://내가올린원격서버주소’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled. 문제 상황: webmvcconfig 를 했는데도👿👿💢이러한 에러가 계속 뜸 해결방법 무식한 방법- 와일드 카드 설정 .allowedHeaders("*") 안무식한 방..