From 20efafd8e7812603dae66d525e8c218b4f196a32 Mon Sep 17 00:00:00 2001 From: Jiwoo Kim Date: Thu, 8 Aug 2024 16:28:18 +0900 Subject: [PATCH] [Feat] fcm api migration #209 (#210) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * setting(firebase-admin): 버전 8.1.0 에서 9.3.0 으로 업데이트 * setting: FCM 파일 변경 * feat(FirebaseConfig): Firebase app bean 생성 방식 변경 --- .github/workflows/decrypt.sh | 6 +++--- build.gradle | 2 +- .../kustacks/kuring/config/FirebaseConfig.java | 11 +++++++---- src/main/resources/application-dev.yml | 2 +- src/main/resources/application-local.yml | 2 +- src/main/resources/application-prod.yml | 2 +- ...k-firebase-adminsdk-87nwq-5ba04dfc12.json.gpg | Bin 1726 -> 0 bytes ...k-firebase-adminsdk-87nwq-ae6a2df931.json.gpg | Bin 0 -> 1749 bytes src/test/resources/application-test.yml | 2 +- 9 files changed, 15 insertions(+), 12 deletions(-) delete mode 100644 src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-5ba04dfc12.json.gpg create mode 100644 src/main/resources/third/ku-stack-firebase-adminsdk-87nwq-ae6a2df931.json.gpg 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 614c710a181d9414247af3da5bd15175137ad3c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1726 zcmV;v20{6Z4Fm@R0^7{PK>IfpH_@*@v6ljBTo*MfXwTlK9No{ThNSR3b|V+h5@@J1rQ&= zQ-PJmJl%!A>Te8Cl?h-g>J-Bgp9%v|<1K=GVY)KlPQ?UxUh}RM3#eY3fU(z@CE#GO zFOPbIM4n!?ST-i~Y%JwVpZ3H&gjc_`i~TqnUQKE0<1nR4%=<%jsYM10@Cust6sx~g zdw1VXoZ>ZjeR~t%@5uU@QWN_@-M%=;`13^j-~n+#gu^c5rEJ8XtcP!R(cIxo&cJ-e z*@PHWbmudt=Oo#IadyiIsgGo>8e2oB2DsM|(UW~iNpyMFU3V8!3E4O9J9Y8(De18G zrhl4`uM*P-yAY+PECV9U2)__m`ZYg@HG_?0*Yk@hLFQw6T_3vbW{&2oxGD9_IQt6V zwAL}K&t1oQW|JzdG(dbkaVbNn>A+Hh0Rsei$jVZGlE%^adC{RN+$qQO!#v#Vq41RJ zBt!xt!RS825hnPzw~ne;38=h5t`Fq(FN*8|6r27~v^hr1*u+wbV@fG3KWVA*CxD{t zR2&$vNdFd2+BZ`^-1lb1AQJFrt14(*I9e;QnncvGMiRedtnMww(}Y3 z-Ld`4=Hr^hjZs>iEmk@^&}SwW9u2atCmpsjbK7)H@}*0~bg@dnH#%kn>hz z`=HzOFyQZR2@H%WRa%v~IH;iP%!(^LC z9qqqIMMljuRPvE0`VR8V^aPqJp3f{!P&Pci7Em%?{xrI?ib3us6&-6L^#5k7j_Sf? zh&e4s2$O9WwG&smN>ybesE^I}-#uCj=>83I~!DtRDmMp)suVxuD} z@(NvBBB}he@;v1W;nuP8YYKFaWc(2x{oUxY9}B!!+B&az3|c$ukojA`dXRaJ^t4=C z)lTkX7PTa?V{$sUiVlh?G>y1)&yojLzGB%F0JzjJ2iYqXa3P5PkdNElXCNa=(|VXZ z*=NWGkK2nq9%Mvtw=ux-qd>Hwn10uOaIEEo4hxQAXd#-$5d?N>pQpt})4F1llJ`FX zF;Gwk#gZB6`;;=taKEjjT0?jr^+yxXfP}F(PV8Pl_EGzV6PM(uik!Xz(N6H*KWeXfPXad+Q)D7X1Y3TF~Jh!<5H5RC{ zBuyC_m5)yDzp?MT9jc=frW4t6`xWU$CvB#9`Jc|stYR@|=MU~k4cR?1e^orxiJv=g Utl32-FTemudaGxHya(?#a7$fLbpQYW 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 0000000000000000000000000000000000000000..62cc37806ceb2109409dc3806fe6440be256b9d1 GIT binary patch literal 1749 zcmV;`1}gcC4Fm}T2=%f~!1wO;l>5@^0jfkk+a&`dn3{!Sroh z=sFg4*+9ezV;M@Q=4}XGXV4KH@@9?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