Skip to content

Commit

Permalink
fix(camunda8): respect CAMUNDA_OAUTH_STRATEGY (#209)
Browse files Browse the repository at this point in the history
The C8 constructor now respects CAMUNDA_OAUTH_STRATEGY
  • Loading branch information
jwulf authored Jul 9, 2024
1 parent 19c4c5c commit 70c9954
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/c8/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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<CamundaPlatform8Configuration> = {}) {
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 {
Expand Down

0 comments on commit 70c9954

Please sign in to comment.