Skip to content

Commit d241ebf

Browse files
author
“PororoAndFriends”
committed
gcs key 의존성 제거
1 parent 5640bdf commit d241ebf

File tree

2 files changed

+51
-51
lines changed

2 files changed

+51
-51
lines changed

backend/src/main/java/moadong/global/config/SecurityConfig.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public class SecurityConfig {
4040

4141
private final JwtProvider jwtProvider;
4242
private final CustomUserDetailService userDetailsService;
43-
@Value("${spring.cloud.gcp.credentials.location}")
44-
private String credentialsLocation;
43+
// @Value("${spring.cloud.gcp.credentials.location}")
44+
// private String credentialsLocation;
4545

4646
public SecurityConfig(JwtProvider jwtProvider, CustomUserDetailService userDetailsService) {
4747
this.jwtProvider = jwtProvider;
@@ -62,14 +62,14 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
6262
return http.build();
6363
}
6464

65-
@Bean
66-
public Storage storage() throws IOException {
67-
InputStream keyFile = ResourceUtils.getURL(credentialsLocation).openStream();
68-
return StorageOptions.newBuilder()
69-
.setCredentials(GoogleCredentials.fromStream(keyFile))
70-
.build()
71-
.getService();
72-
}
65+
// @Bean
66+
// public Storage storage() throws IOException {
67+
// InputStream keyFile = ResourceUtils.getURL(credentialsLocation).openStream();
68+
// return StorageOptions.newBuilder()
69+
// .setCredentials(GoogleCredentials.fromStream(keyFile))
70+
// .build()
71+
// .getService();
72+
// }
7373

7474
@Bean
7575
public PasswordEncoder passwordEncoder() {
Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
package moadong.media.util;
2-
3-
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
4-
import com.google.api.client.json.jackson2.JacksonFactory;
5-
import com.google.api.services.drive.Drive;
6-
import com.google.api.services.drive.DriveScopes;
7-
import com.google.auth.http.HttpCredentialsAdapter;
8-
import com.google.auth.oauth2.GoogleCredentials;
9-
import java.io.InputStream;
10-
import java.util.Collections;
11-
import org.springframework.beans.factory.annotation.Value;
12-
import org.springframework.context.annotation.Bean;
13-
import org.springframework.context.annotation.Configuration;
14-
import org.springframework.util.ResourceUtils;
15-
16-
@Configuration
17-
public class GoogleDriveConfig {
18-
19-
@Value("${spring.cloud.gcp.credentials.location}")
20-
private String credentialsLocation;
21-
22-
@Value("${google.application.name}")
23-
private String applicationName;
24-
25-
@Bean
26-
public Drive googleDriveService() throws Exception {
27-
InputStream in = ResourceUtils.getURL(credentialsLocation).openStream();
28-
GoogleCredentials credentials = GoogleCredentials.fromStream(in)
29-
.createScoped(Collections.singleton(DriveScopes.DRIVE));
30-
31-
return new Drive.Builder(
32-
GoogleNetHttpTransport.newTrustedTransport(),
33-
JacksonFactory.getDefaultInstance(),
34-
new HttpCredentialsAdapter(credentials))
35-
.setApplicationName(applicationName)
36-
.build();
37-
38-
}
39-
40-
41-
}
1+
//package moadong.media.util;
2+
//
3+
//import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
4+
//import com.google.api.client.json.jackson2.JacksonFactory;
5+
//import com.google.api.services.drive.Drive;
6+
//import com.google.api.services.drive.DriveScopes;
7+
//import com.google.auth.http.HttpCredentialsAdapter;
8+
//import com.google.auth.oauth2.GoogleCredentials;
9+
//import java.io.InputStream;
10+
//import java.util.Collections;
11+
//import org.springframework.beans.factory.annotation.Value;
12+
//import org.springframework.context.annotation.Bean;
13+
//import org.springframework.context.annotation.Configuration;
14+
//import org.springframework.util.ResourceUtils;
15+
//
16+
//@Configuration
17+
//public class GoogleDriveConfig {
18+
//
19+
// @Value("${spring.cloud.gcp.credentials.location}")
20+
// private String credentialsLocation;
21+
//
22+
// @Value("${google.application.name}")
23+
// private String applicationName;
24+
//
25+
// @Bean
26+
// public Drive googleDriveService() throws Exception {
27+
// InputStream in = ResourceUtils.getURL(credentialsLocation).openStream();
28+
// GoogleCredentials credentials = GoogleCredentials.fromStream(in)
29+
// .createScoped(Collections.singleton(DriveScopes.DRIVE));
30+
//
31+
// return new Drive.Builder(
32+
// GoogleNetHttpTransport.newTrustedTransport(),
33+
// JacksonFactory.getDefaultInstance(),
34+
// new HttpCredentialsAdapter(credentials))
35+
// .setApplicationName(applicationName)
36+
// .build();
37+
//
38+
// }
39+
//
40+
//
41+
//}

0 commit comments

Comments
 (0)