Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion server/collusic-be/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ gradle-app.setting

### Gradle Patch ###
# Java heap dump
*.hprof
*.hprof
**/out
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private void authenticateWithRefreshToken(HttpServletRequest request, HttpServle
chain.doFilter(request, response);
} catch (ExpiredTokenException | EntityNotFoundException | AbnormalAccessException e) {
tokenService.deleteRefreshToken(refreshToken);
CookieUtils.expireCookie(response, "refreshToken");
throw e;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
import com.collusic.collusicbe.global.exception.jwt.ExpiredTokenException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.jsonwebtoken.*;
import lombok.extern.slf4j.Slf4j;

import io.jsonwebtoken.Claims;
import io.jsonwebtoken.ExpiredJwtException;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.MalformedJwtException;
import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.SignatureException;
import io.jsonwebtoken.UnsupportedJwtException;
import java.time.Instant;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class JWTUtil {
Expand Down Expand Up @@ -90,4 +95,5 @@ private static Map<String, Object> jwtHeaders() {
headers.put("alg", SignatureAlgorithm.HS256);
return headers;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
import com.amazonaws.services.s3.model.CannedAccessControlList;
import com.amazonaws.services.s3.model.ObjectMetadata;
import com.amazonaws.services.s3.model.PutObjectRequest;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.Optional;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.Optional;

@Slf4j
@RequiredArgsConstructor
@Service
Expand Down Expand Up @@ -45,7 +44,7 @@ public String upload(String nickname, @ModelAttribute MultipartFile multipartFil
objectMetadata.setContentLength(multipartFile.getSize());

s3Client.putObject(new PutObjectRequest(bucket, path.toString(), multipartFile.getInputStream(), objectMetadata)
.withCannedAcl(CannedAccessControlList.PublicRead));
.withCannedAcl(CannedAccessControlList.PublicRead));

return cloudFrontDomain + path;
}
Expand Down Expand Up @@ -109,8 +108,9 @@ public String uploadAudioFile(MultipartFile audioFile) throws IOException {
objectMetadata.setContentLength(audioFile.getSize());

s3Client.putObject(new PutObjectRequest(bucket, path.toString(), audioFile.getInputStream(), objectMetadata)
.withCannedAcl(CannedAccessControlList.PublicRead));
.withCannedAcl(CannedAccessControlList.PublicRead));

return cloudFrontDomain + path;
return cloudFrontDomain + "/" + path;
}

}
6 changes: 3 additions & 3 deletions server/collusic-be/src/main/resources/application-dev_db.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
spring:
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:testdb;MODE=MYSQL
username: sa
password:
url: ENC(gnyYY2my5ZaFbvuc1ShsFN8N/6HyTS1sQ5UD+qe72zTg/xZCwIDJsttUCG56/ZZfmIRoFEy6c0gJgFE1FhmB9lYNO9nGF2bf8F75TJqccuicBum0mkyqp30RmK7tC4VoKmHw97c6MRAyx3Iv7LagNw==)
username: ENC(mf26xrSdlsDGLOp2uRVtYQ==)
password: ENC(B9/bakG1kuaw3NeCNI4dq6K/zkFiyO7uSWx6IR7jUQA=)

jpa:
show-sql: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: ENC(0UN3QoywTt1aetAUuH2wBmNQ81GfewuEflb08Q7KfEv+AZ82o3C65RruLLWFtOemgsLQ/+xmqmv/O45y/NrUTDv/hOYG+9lC6/4w/TQ6H778gFuUKVxYyh9/k6egITMTRkfcW/VDeJJfWh+KVMBSyAlmrFZRo7nFnsZCjuXRG9W1d2SkNqJJ9Ik044jnVPv2)
url: ENC(UGndU3lx2AdAtuUBkeDqoZNFWNVtiLKgCb4VNNobbK9khWEsKypyQgRfyc5gNbyWjCPYowzsLH3b+S4W5b8YR4AvNwmOkhFihe3+gXI4GgWHdjopECQldkFLaJBRR9HFl2Ir6fQydv6ENNImswxwCaBuAYBQJK9AyW1/l0PXE3ETuM+MR9fVj2u8lZdeYntG)
username: ENC(mf26xrSdlsDGLOp2uRVtYQ==)
password: ENC(B9/bakG1kuaw3NeCNI4dq6K/zkFiyO7uSWx6IR7jUQA=)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public void setUp() {
public void decryptTest() {

String decryptedText = jasyptStringEncryptor.decrypt(defaultEncryptedText);

assertThat(decryptedText).isEqualTo(defaultRawText);
}

Expand Down