diff --git a/.github/workflows/decrypt.sh b/.github/workflows/decrypt.sh index d12d1fc5..77ec579e 100644 --- a/.github/workflows/decrypt.sh +++ b/.github/workflows/decrypt.sh @@ -1,7 +1,7 @@ #!/bin/sh -gpg --batch --yes --decrypt --passphrase "$GPG_PASSPHRASE" --output src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-5ba04dfc12.json src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-5ba04dfc12.json.gpg +gpg --batch --yes --decrypt --passphrase "$GPG_PASSPHRASE" --output src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-ae6a2df931.json src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-ae6a2df931.json.gpg -if [ -f src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-5ba04dfc12.json ]; then +if [ -f src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-ae6a2df931.json ]; then echo "Decryption Success!" -fi \ No newline at end of file +fi diff --git a/build.gradle b/build.gradle index 31cd488c..eafaebd3 100644 --- a/build.gradle +++ b/build.gradle @@ -85,7 +85,7 @@ dependencies { implementation 'org.jsoup:jsoup:1.14.3' // Firebase - implementation 'com.google.firebase:firebase-admin:8.1.0' + implementation 'com.google.firebase:firebase-admin:9.3.0' // RestDocs asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor' diff --git a/src/main/java/com/kustacks/kuring/config/FirebaseConfig.java b/src/main/java/com/kustacks/kuring/config/FirebaseConfig.java index 127b580f..34b2c230 100644 --- a/src/main/java/com/kustacks/kuring/config/FirebaseConfig.java +++ b/src/main/java/com/kustacks/kuring/config/FirebaseConfig.java @@ -22,12 +22,15 @@ FirebaseMessaging firebaseMessaging(FirebaseApp firebaseApp) { @Bean FirebaseApp firebaseApp(@Value("${firebase.file-path}") String filePath) throws IOException { - FirebaseOptions options = FirebaseOptions.builder() - .setCredentials(GoogleCredentials.fromStream(new ClassPathResource(filePath).getInputStream())) + GoogleCredentials googleCredentials = GoogleCredentials + .fromStream(new ClassPathResource(filePath).getInputStream()); + + FirebaseOptions firebaseOptions = FirebaseOptions.builder() + .setCredentials(googleCredentials) .build(); - if(FirebaseApp.getApps().isEmpty()) { - return FirebaseApp.initializeApp(options); + if (FirebaseApp.getApps().isEmpty()) { + return FirebaseApp.initializeApp(firebaseOptions); } return FirebaseApp.getInstance(); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 55cea450..a74a32d1 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -144,7 +144,7 @@ auth: login-url: https://kuis.konkuk.ac.kr/Login/login.do firebase: - file-path: third/ku-stack-firebase-adminsdk-87nwq-5ba04dfc12.json + file-path: third/ku-stack-firebase-adminsdk-87nwq-ae6a2df931.json admin: password: ${ADMIN_PASSWORD} diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 0db1bfc7..e429895d 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -147,7 +147,7 @@ auth: login-url: https://kuis.konkuk.ac.kr/Login/login.do firebase: - file-path: third/ku-stack-firebase-adminsdk-87nwq-5ba04dfc12.json + file-path: third/ku-stack-firebase-adminsdk-87nwq-ae6a2df931.json admin: password: ${ADMIN_PASSWORD} diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 253e4906..8137f084 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -104,7 +104,7 @@ auth: login-url: https://kuis.konkuk.ac.kr/Login/login.do firebase: - file-path: third/ku-stack-firebase-adminsdk-87nwq-5ba04dfc12.json + file-path: third/ku-stack-firebase-adminsdk-87nwq-ae6a2df931.json admin: password: ${ADMIN_PASSWORD} diff --git a/src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-5ba04dfc12.json.gpg b/src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-5ba04dfc12.json.gpg deleted file mode 100644 index 614c710a..00000000 Binary files a/src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-5ba04dfc12.json.gpg and /dev/null differ diff --git a/src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-ae6a2df931.json.gpg b/src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-ae6a2df931.json.gpg new file mode 100644 index 00000000..62cc3780 Binary files /dev/null and b/src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-ae6a2df931.json.gpg differ diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index ca921743..6b0fb912 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -89,7 +89,7 @@ server: environment: test firebase: - file-path: third/ku-stack-firebase-adminsdk-87nwq-5ba04dfc12.json + file-path: third/ku-stack-firebase-adminsdk-87nwq-ae6a2df931.json admin: id: admin@email.com