File tree Expand file tree Collapse file tree
user-service/src/main/java/club/gach_dong/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,22 +22,24 @@ public class GcpStorageConfig {
2222 @ Value ("${spring.cloud.gcp.storage.project-id}" )
2323 private String projectId ;
2424
25+ @ Value ("${GCP_SERVICE_KEY}" )
26+ private String credentialsJson ;
27+
2528 @ Bean
2629 public Storage gcpStorage () throws IOException {
2730 GoogleCredentials credentials = GoogleCredentials .fromStream (
2831 new ByteArrayInputStream (credentialsJson .getBytes (StandardCharsets .UTF_8 ))
2932 );
3033
3134 return StorageOptions .newBuilder ()
32- .setCredentials (credentialsPath )
35+ .setCredentials (credentials )
3336 .setProjectId (projectId )
3437 .build ()
3538 .getService ();
3639 }
37- }
3840
39- @ Bean
40- public String bucketName () {
41- return bucketName ;
42- }
41+ @ Bean
42+ public String bucketName () {
43+ return bucketName ;
44+ }
4345}
You can’t perform that action at this time.
0 commit comments