-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #410 from APP-Android2/408-feature-api보안-강화를-위한-gc…
…p-api-적용 [#408] [Feature] 구글 시크릿 매니저 -> 파이어스토어 적용
- Loading branch information
Showing
5 changed files
with
32 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
app/src/main/java/kr/co/lion/modigm/db/FirestoreKeyProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package kr.co.lion.modigm.db | ||
|
||
import com.google.firebase.firestore.FirebaseFirestore | ||
import kotlinx.coroutines.tasks.await | ||
|
||
class FirestoreKeyProvider { | ||
private val firestore = FirebaseFirestore.getInstance() | ||
|
||
// Firestore에서 AWS 키를 가져오는 함수 | ||
suspend fun getAwsKeys(): Triple<String, String, String> { | ||
val document = firestore.collection("keys").document("aws_keys").get().await() | ||
val accessKey = document.getString("accessKey") ?: throw IllegalStateException("Access Key not found") | ||
val secretKey = document.getString("secretKey") ?: throw IllegalStateException("Secret Key not found") | ||
val bucketName = document.getString("bucketName") ?: throw IllegalStateException("Bucket Name not found") | ||
|
||
return Triple(accessKey, secretKey, bucketName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters