Skip to content

Commit b4c0c80

Browse files
committed
chore: 불필요한 google credential 설정 제거
1 parent a0754f0 commit b4c0c80

3 files changed

Lines changed: 2 additions & 17 deletions

File tree

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,17 @@
11
package com.letsrecordit.letsrecorditimageserver.config.gcp
22

3-
import com.google.auth.oauth2.GoogleCredentials
43
import com.google.cloud.storage.Storage
54
import com.google.cloud.storage.StorageOptions
6-
import org.springframework.beans.factory.annotation.Value
75
import org.springframework.context.annotation.Bean
86
import org.springframework.context.annotation.Configuration
97
import org.springframework.context.annotation.Profile
10-
import org.springframework.util.ResourceUtils
118

129
@Configuration
1310
@Profile("!test")
14-
class GCSConfig(
15-
@Value("\${spring.cloud.gcp.storage.credentials.location}")
16-
private val keyFileName: String,
17-
) {
11+
class GCSConfig() {
1812

1913
@Bean
2014
fun storage(): Storage {
21-
val keyFile = ResourceUtils.getURL(keyFileName).openStream()
22-
23-
return StorageOptions.newBuilder()
24-
.setCredentials(GoogleCredentials.fromStream(keyFile))
25-
.build()
26-
.service
15+
return StorageOptions.getDefaultInstance().service;
2716
}
2817
}

src/main/resources/application-local.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ spring:
1313
cloud:
1414
gcp:
1515
storage:
16-
credentials:
17-
location: ${GCP_CREDENTIAL_LOCATION}
1816
project-id: ${GCP_PROJECT_ID}
1917
bucket: ${GCP_BUCKET_NAME}
2018

src/main/resources/application-prod.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ spring:
1414
cloud:
1515
gcp:
1616
storage:
17-
credentials:
18-
location: ${GCP_CREDENTIAL_LOCATION}
1917
project-id: ${GCP_PROJECT_ID}
2018
bucket: ${GCP_BUCKET_NAME}
2119

0 commit comments

Comments
 (0)