From e756798a34e8acfed8befdccc0190e455430638b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98yj-leez=E2=80=99?= Date: Thu, 2 Nov 2023 20:56:24 +0900 Subject: [PATCH] [fix] cicd --- src/main/java/wowmarket/wow_server/global/S3Uploader.java | 8 +++++--- .../wow_server/global/jwt/JwtAuthenticationFilter.java | 4 +++- .../wow_server/login/service/UserServiceImpl.java | 1 + .../register/controller/RegisterController.java | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/wowmarket/wow_server/global/S3Uploader.java b/src/main/java/wowmarket/wow_server/global/S3Uploader.java index d5a4013..a63c1b4 100644 --- a/src/main/java/wowmarket/wow_server/global/S3Uploader.java +++ b/src/main/java/wowmarket/wow_server/global/S3Uploader.java @@ -46,14 +46,16 @@ public String getPreSignedURL(String dirName) { try { GeneratePresignedUrlRequest generatePresignedUrlRequest = new GeneratePresignedUrlRequest(bucket, fileName) - .withMethod(HttpMethod.PUT) - .withExpiration(expiration); + .withMethod(HttpMethod.PUT) //메서드가 PUT인 Presigned URL을 생성 + .withExpiration(expiration); //URL의 만료 시간을 설정 generatePresignedUrlRequest.addRequestParameter( Headers.S3_CANNED_ACL, - CannedAccessControlList.PublicRead.toString()); + CannedAccessControlList.PublicRead.toString()); //생성된 URL에 대한 공개 읽기 권한을 설정 + //Amazon S3 클라이언트 객체를 사용하여 Presigned URL을 생성하는 메서드 URL url = amazonS3Client.generatePresignedUrl(generatePresignedUrlRequest); + preSignedURL = url.toString(); } catch (Exception e) { diff --git a/src/main/java/wowmarket/wow_server/global/jwt/JwtAuthenticationFilter.java b/src/main/java/wowmarket/wow_server/global/jwt/JwtAuthenticationFilter.java index 2e0543f..a4abbd6 100644 --- a/src/main/java/wowmarket/wow_server/global/jwt/JwtAuthenticationFilter.java +++ b/src/main/java/wowmarket/wow_server/global/jwt/JwtAuthenticationFilter.java @@ -36,9 +36,11 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse if (token != null && jwtAuthenticationProvider.validateAccessToken(token)) { + + //logout된 jwt 검증 로직 String isLogout = (String)redisTemplate.opsForValue().get(token); - if(ObjectUtils.isEmpty(isLogout)){ + if(ObjectUtils.isEmpty(isLogout)){ // 비어있다면 //유효한 토큰이면 JwtTokenProvider를 통해 Authentication 객체를 생성 Authentication authentication = jwtAuthenticationProvider.getAuthentication(token); diff --git a/src/main/java/wowmarket/wow_server/login/service/UserServiceImpl.java b/src/main/java/wowmarket/wow_server/login/service/UserServiceImpl.java index ed96016..837062d 100644 --- a/src/main/java/wowmarket/wow_server/login/service/UserServiceImpl.java +++ b/src/main/java/wowmarket/wow_server/login/service/UserServiceImpl.java @@ -62,6 +62,7 @@ public TokenResponseDto signIn(UserSignInRequestDto requestDto) throws Exception throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "잘못된 비밀번호입니다"); } + System.out.println("ci/cd 성공"); String accessToken = jwtTokenProvider.createAccessToken(user.getUsername(), user.getRole().name()); String refreshToken = jwtTokenProvider.createRefreshToken(); diff --git a/src/main/java/wowmarket/wow_server/register/controller/RegisterController.java b/src/main/java/wowmarket/wow_server/register/controller/RegisterController.java index 5410585..dda815a 100644 --- a/src/main/java/wowmarket/wow_server/register/controller/RegisterController.java +++ b/src/main/java/wowmarket/wow_server/register/controller/RegisterController.java @@ -43,13 +43,13 @@ public ResponseEntity registerDemand(@Valid @RequestBody RegisterDemandProjectDt * @return presigned url */ @GetMapping("/image") - public ResponseEntity RegisterProject(String dirname){ + public ResponseEntity RegisterProject(@RequestParam String dirname){ return new ResponseEntity(awsS3Uploader.getPreSignedURL(dirname), HttpStatus.OK); } @GetMapping(value = {"/project", "/demand"}) public ResponseEntity sendCategories(){ - return new ResponseEntity<>(registerService.findCategories(), HttpStatus.OK); + return new ResponseEntity(registerService.findCategories(), HttpStatus.OK); }