A Gradle plugin for managing Firebase project IAM permissions, written in Kotlin.
- Manage editor and viewer permissions for multiple Firebase projects
- Simple DSL for defining permissions
- Automatically applies permissions using Google Cloud Resource Manager API
- Written in Kotlin with full Kotlin DSL support
com.google.gms.google-services
applied.- Appropriate permissions to modify IAM policies on the target Firebase projects
- Authentication set up service account credentials
Add the plugin to your build script:
plugins {
id("io.github.bhargavms.firebase-iam") version "1.0.0"
}
plugins {
id 'io.github.bhargavms.firebase-iam' version '1.0.0'
}
Configure the plugin in your build file:
configure<com.firebase.iam.FirebaseIamExtension> {
project("my-project-1") {
credentialFile = project.file("firebase-project-1.json")
editors = listOf("[email protected]", "[email protected]")
viewers = listOf("[email protected]", "[email protected]")
}
project("my-project-2") {
credentialFile = project.file("firebase-project-2.json")
editors = listOf("[email protected]")
viewers = listOf("[email protected]", "[email protected]")
}
}
firebaseIam {
project("my-project-1") {
it.credentialFile = project.file("firebase-project-1.json")
it.editors = ["[email protected]", "[email protected]"]
it.viewers = ["[email protected]", "[email protected]"]
}
project("my-project-2") {
it.credentialFile = project.file("firebase-project-2.json")
it.editors = ["[email protected]"]
it.viewers = ["[email protected]", "[email protected]"]
}
}
Apply the IAM permissions by running:
./gradlew syncFirebasePermissions