From 992565401be7062949f8e5673652bb7f59c287a2 Mon Sep 17 00:00:00 2001 From: Josh Wulf Date: Tue, 9 Jul 2024 13:24:34 +1200 Subject: [PATCH] fix(camunda8): respect CAMUNDA_OAUTH_STRATEGY The C8 constructor now respects CAMUNDA_OAUTH_STRATEGY --- src/c8/index.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/c8/index.ts b/src/c8/index.ts index d542a63b..2c6b55a7 100644 --- a/src/c8/index.ts +++ b/src/c8/index.ts @@ -2,10 +2,11 @@ import { AdminApiClient } from '../admin' import { CamundaEnvironmentConfigurator, CamundaPlatform8Configuration, + constructOAuthProvider, DeepPartial, } from '../lib' import { ModelerApiClient } from '../modeler' -import { OAuthProvider } from '../oauth' +import { IOAuthProvider } from '../oauth' import { OperateApiClient } from '../operate' import { OptimizeApiClient } from '../optimize' import { TasklistApiClient } from '../tasklist' @@ -39,15 +40,12 @@ export class Camunda8 { private zeebeGrpcApiClient?: ZeebeGrpcClient private zeebeRestClient?: ZeebeRestClient private configuration: CamundaPlatform8Configuration - private oAuthProvider?: OAuthProvider + private oAuthProvider: IOAuthProvider constructor(config: DeepPartial = {}) { this.configuration = CamundaEnvironmentConfigurator.mergeConfigWithEnvironment(config) - // Respect Oauth disabled flag - if (!this.configuration.CAMUNDA_OAUTH_DISABLED) { - this.oAuthProvider = new OAuthProvider({ config: this.configuration }) - } + this.oAuthProvider = constructOAuthProvider(this.configuration) } public getOperateApiClient(): OperateApiClient {