-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ellet
committed
Dec 2, 2023
1 parent
1073b85
commit a87b92c
Showing
23 changed files
with
257 additions
and
157 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
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,28 @@ | ||
package plugins | ||
|
||
import io.ktor.server.application.* | ||
import net.freshplatform.ktor_server.firebase_app_check.FirebaseAppCheckPlugin | ||
import net.freshplatform.ktor_server.firebase_app_check.core.FirebaseAppCheckSecureStrategy | ||
import net.freshplatform.ktor_server.firebase_app_check.services.FirebaseAppCheckTokenVerifierServiceImpl | ||
import net.freshplatform.ktor_server.firebase_app_check.utils.FirebaseAppCheckMessages | ||
|
||
fun Application.configureAppCheck() { | ||
install(FirebaseAppCheckPlugin) { | ||
firebaseProjectNumber = System.getenv("FIREBASE_PROJECT_NUMBER") | ||
?: throw MissingEnvironmentVariableException("FIREBASE_PROJECT_NUMBER") | ||
firebaseProjectId = System.getenv("FIREBASE_PROJECT_ID") | ||
?: throw MissingEnvironmentVariableException("FIREBASE_PROJECT_ID") | ||
isShouldVerifyToken = true | ||
serviceImpl = FirebaseAppCheckTokenVerifierServiceImpl() | ||
secureStrategy = FirebaseAppCheckSecureStrategy.ProtectSpecificRoutes | ||
pluginMessagesBuilder = { configuration -> | ||
// Example of override a response message | ||
FirebaseAppCheckMessages( | ||
configuration, | ||
appCheckIsNotDefinedResponse = mapOf( | ||
"error" to "${configuration.firebaseAppCheckHeaderName} is required" | ||
), | ||
) | ||
} | ||
} | ||
} |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,14 +1 @@ | ||
kotlin.code.style=official | ||
|
||
# Versions | ||
|
||
# Shared | ||
kotlin.version=1.9.21 | ||
ktor.version=2.3.6 | ||
|
||
# Example | ||
logback.version=1.4.11 | ||
|
||
# Library | ||
auth0JwksRsa.version=0.22.1 | ||
auth0JavaJwt.version=4.4.0 | ||
kotlin.code.style=official |
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 |
---|---|---|
@@ -1,5 +1,28 @@ | ||
[versions] | ||
kotlin = "1.9.21" | ||
ktor = "2.3.6" | ||
library = "0.0.5-dev" | ||
|
||
# Example | ||
logback = "1.4.11" | ||
|
||
# Library | ||
auth0-java-jwt = "4.4.0" | ||
auth0-java-jwksRsa = "0.22.1" | ||
|
||
kotlinx-coroutines = "1.7.3" | ||
kotlinx-serialization = "1.6.2" | ||
|
||
[libraries] | ||
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } | ||
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } | ||
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" } | ||
|
||
# JVM | ||
auth0-java-jwt = { module = "com.auth0:java-jwt", version.ref = "auth0-java-jwt" } | ||
auth0-java-jwksRsa = { module = "com.auth0:jwks-rsa", version.ref = "auth0-java-jwksRsa" } | ||
|
||
[plugins] | ||
[plugins] | ||
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } | ||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } | ||
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } |
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
4 changes: 3 additions & 1 deletion
4
...n/net/freshplatform/ktor_server/firebase_app_check/core/FirebaseAppCheckSecureStrategy.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
Oops, something went wrong.