diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-02-17 15:00:33 +0100 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-02-17 15:00:33 +0100 |
| commit | e69d8ea8ec9db7cbb21cfcf7de0ef423ea5ea177 (patch) | |
| tree | ae322f7af49a614fdc3d672cb3d19dcb2e336a4d /opendc-web/opendc-web-runner/src/main/kotlin | |
| parent | 02c215ad57e1e4d56c54d22be58e1845bdeebf25 (diff) | |
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.
Diffstat (limited to 'opendc-web/opendc-web-runner/src/main/kotlin')
| -rw-r--r-- | opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/Main.kt | 12 |
1 files changed, 11 insertions, 1 deletions
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 @@ -82,6 +82,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. */ private val authClientId by option( @@ -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" } |
