From e69d8ea8ec9db7cbb21cfcf7de0ef423ea5ea177 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 17 Feb 2022 15:00:33 +0100 Subject: fix(web/runner): Support custom audience in web runner This change adds support for custom audience values in the web runner. If the audience used by the user is different from the default value (https://api.opendc.org/v2/), then the runner fails to obtain a valid access token for the API. --- .../src/main/kotlin/org/opendc/web/runner/Main.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/Main.kt b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/Main.kt index 8f4e9d6d..94ef8f8e 100644 --- a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/Main.kt +++ b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/Main.kt @@ -81,6 +81,16 @@ class RunnerCli : CliktCommand(name = "runner") { ) .required() + /** + * The auth domain to use. + */ + private val authAudience by option( + "--auth-audience", + help = "auth audience of the OpenDC API", + envvar = "AUTH0_AUDIENCE" + ) + .required() + /** * The auth client ID to use. */ @@ -231,7 +241,7 @@ class RunnerCli : CliktCommand(name = "runner") { override fun run(): Unit = runBlocking(Dispatchers.Default) { logger.info { "Starting OpenDC web runner" } - val client = ApiClient(baseUrl = apiUrl, AuthConfiguration(authDomain, authClientId, authClientSecret)) + val client = ApiClient(baseUrl = apiUrl, AuthConfiguration(authDomain, authClientId, authClientSecret), authAudience) val manager = ScenarioManager(client) logger.info { "Watching for queued scenarios" } -- cgit v1.2.3