Skip to content

Commit

Permalink
Merge pull request #133 from UMC-WOWMARKET/refactor/yj-leez
Browse files Browse the repository at this point in the history
[fix] ci/cd check
  • Loading branch information
yj-leez authored Nov 2, 2023
2 parents a0b9530 + e756798 commit 136f738
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/main/java/wowmarket/wow_server/global/S3Uploader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit 136f738

Please sign in to comment.