Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
java-version: 21

- uses: gradle/actions/setup-gradle@v3
if: ${{ !env.ACT }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ private String makeToken(Date expiry, User user, LoginType loginType) {
private Claims getClaims(String token) {
return Jwts.parser()
.setSigningKey(Base64.getEncoder().encodeToString(jwtProperties.getSecretKey().getBytes()))
.build()
.parseClaimsJws(token)
.getBody();
}
Expand All @@ -124,4 +125,4 @@ public CustomUserDetails(Long userId, String username, String password, Collecti
this.team = team;
}
}
}
}
27 changes: 12 additions & 15 deletions src/main/java/inha/gdgoc/global/config/s3/S3Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@
@Configuration
public class S3Config {

@Bean
public Region awsRegion(@Value("${cloud.aws.region.static}") String region) {
return Region.of(region);
}
@Bean
public Region awsRegion(@Value("${spring.cloud.aws.region.static}") String region) {
return Region.of(region);
}
Comment on lines +14 to +17
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | πŸ”΄ Critical

μ„€μ • 뢈일치: application-local.yml의 속성 ν‚€λ₯Ό μ—…λ°μ΄νŠΈν•΄μ•Ό ν•©λ‹ˆλ‹€.

@Value μ£Όμ„μ—μ„œ 속성 ν‚€κ°€ spring.cloud.aws.region.static으둜 λ³€κ²½λ˜μ—ˆμ§€λ§Œ, src/main/resources/application-local.yml 파일의 54번째 μ€„μ—λŠ” μ—¬μ „νžˆ cloud.aws.region.static (spring 접두사 없이)으둜 λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

μ΄λŠ” Spring Cloud AWS 3.x둜의 λ§ˆμ΄κ·Έλ ˆμ΄μ…˜μœΌλ‘œ λ³΄μ΄λŠ”λ°, λͺ¨λ“  속성 킀에 spring. 접두사가 ν•„μš”ν•©λ‹ˆλ‹€. 이 뢈일치둜 인해 local ν”„λ‘œνŒŒμΌλ‘œ μ‹€ν–‰ μ‹œ 빈 생성이 μ‹€νŒ¨ν•©λ‹ˆλ‹€.

πŸ”§ application-local.yml μˆ˜μ • μ œμ•ˆ

src/main/resources/application-local.yml νŒŒμΌμ—μ„œ λ‹€μŒκ³Ό 같이 μˆ˜μ •μ΄ ν•„μš”ν•©λ‹ˆλ‹€:

   cloud:
     aws:
       credentials:
         access-key: ${AWS_ACCESS_KEY_ID}
         secret-key: ${AWS_SECRET_ACCESS_KEY}
       region:
-        static: ${AWS_REGION}
+        static: ${AWS_REGION}
+
+# Spring Cloud AWS 3.x 속성
+spring:
+  cloud:
+    aws:
+      region:
+        static: ${AWS_REGION}

λ˜λŠ” λͺ¨λ“  AWS 섀정을 spring.cloud.aws λ„€μž„μŠ€νŽ˜μ΄μŠ€λ‘œ μ΄λ™ν•˜λŠ” 것을 ꢌμž₯ν•©λ‹ˆλ‹€.

Committable suggestion skipped: line range outside the PR's diff.

πŸ€– Prompt for AI Agents
In @src/main/java/inha/gdgoc/global/config/s3/S3Config.java around lines 14 -
17, μ• ν”Œλ¦¬μΌ€μ΄μ…˜ 둜컬 μ„€μ •κ³Ό μ½”λ“œμ˜ ν”„λ‘œνΌν‹° ν‚€κ°€ λΆˆμΌμΉ˜ν•΄
awsRegion(@Value("${spring.cloud.aws.region.static}") String region) 빈 생성이
μ‹€νŒ¨ν•©λ‹ˆλ‹€; src/main/resources/application-local.ymlμ—μ„œ cloud.aws.region.staticλ₯Ό
spring.cloud.aws.region.static둜 λ³€κ²½ν•˜κ±°λ‚˜ λͺ¨λ“  AWS 섀정을 spring.cloud.aws λ„€μž„μŠ€νŽ˜μ΄μŠ€λ‘œ ν†΅μΌν•˜μ—¬
@Value에 μ‚¬μš©λœ 킀와 μΌμΉ˜μ‹œν‚€κ³  둜컬 ν”„λ‘œνŒŒμΌλ‘œ μ‹€ν–‰ μ‹œ 빈이 정상 μƒμ„±λ˜λ„λ‘ μˆ˜μ •ν•˜μ„Έμš”.


@Bean
public AwsCredentialsProvider awsCredentialsProvider() {
return DefaultCredentialsProvider.create();
}
@Bean
public AwsCredentialsProvider awsCredentialsProvider() {
return DefaultCredentialsProvider.create();
}

@Bean
public S3Client s3Client(Region region, AwsCredentialsProvider provider) {
return S3Client.builder()
.region(region)
.credentialsProvider(provider)
.build();
}
@Bean
public S3Client s3Client(Region region, AwsCredentialsProvider provider) {
return S3Client.builder().region(region).credentialsProvider(provider).build();
}
}
4 changes: 2 additions & 2 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ spring:
jackson:
time-zone: Asia/Seoul
datasource:
url: jdbc:postgresql://localhost:5432/gdgoc
username: postgres
url: "jdbc:postgresql://localhost:5432/gdgoc"
username: "postgres"
password:
servlet:
multipart:
Expand Down
Loading