-
Notifications
You must be signed in to change notification settings - Fork 1
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 #56 from dietmap/multitenancy
Add support for multiple Google Play accounts handled on a single yaak instance
- Loading branch information
Showing
6 changed files
with
133 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package com.dietmap.yaak.api.config | ||
|
||
object ApiCommons { | ||
const val API_KEY_HEADER : String = "Authorization" | ||
const val API_KEY_HEADER: String = "Authorization" | ||
const val TENANT_HEADER: String = "X-Tenant" | ||
} |
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
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/com/dietmap/yaak/domain/googleplay/AndroidPublisherService.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,14 @@ | ||
package com.dietmap.yaak.domain.googleplay | ||
|
||
import com.dietmap.yaak.domain.googleplay.AndroidPublisherClientConfiguration.Companion.DEFAULT_TENANT | ||
import com.google.api.services.androidpublisher.AndroidPublisher | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty | ||
import org.springframework.stereotype.Service | ||
|
||
@ConditionalOnProperty("yaak.google-play.enabled", havingValue = "true") | ||
@Service | ||
class AndroidPublisherService(private val androidPublishers: Map<String, AndroidPublisher>) { | ||
|
||
fun tenant(tenant: String?) = androidPublishers.getOrDefault(tenant?.toUpperCase() ?: DEFAULT_TENANT, androidPublishers[DEFAULT_TENANT])!! | ||
|
||
} |
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