Search code examples
kotlinaws-amplifykotlin-multiplatform

Storing API keys and accessing them in commonTest in Kotlin Multiplatform


I am looking for a way to store AWS secrets (Cognito ID and others) to use in my tests. All of the ways I found included third party plugins, like vault from HachiCorp. I haven't found a solution that allows me to easily have them accessible for local testing. I use Github Secrets for my Github Actions. The tests are in commonTest module.


Solution

  • You can use BuildKonfig, since the latest release it allows adding directly values from the gradle file. You can add your values only for test builds using gradle flags.