Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(zeebe): add support for ZEEBE_INSECURE_CONNECTION env var #215

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/__tests__/config/jest.cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const cleanUp = async () => {
await zeebe.cancelProcessInstance(key)
console.log(`Cancelled process instance ${key}`)
} catch (e) {
console.log(e)
if (!(e as Error).message.startsWith('5 NOT_FOUND')) {
console.log('Failed to cancel process instance', key)
console.log((e as Error).message)
Expand Down
5 changes: 5 additions & 0 deletions src/lib/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ const getMainEnv = () =>

const getZeebeEnv = () =>
createEnv({
ZEEBE_INSECURE_CONNECTION: {
type: 'boolean',
optional: true,
default: false,
},
/** Log level of Zeebe Client and Workers - 'DEBUG' | 'INFO' | 'NONE'. Defaults to 'INFO' */
ZEEBE_CLIENT_LOG_LEVEL: {
type: 'string',
Expand Down
4 changes: 3 additions & 1 deletion src/zeebe/zb/ZeebeGrpcClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ export class ZeebeGrpcClient extends TypedEmitter<
this.maxRetryTimeout = Duration.seconds.of(
config.zeebeGrpcSettings.ZEEBE_GRPC_CLIENT_MAX_RETRY_TIMEOUT_SECONDS
)
this.useTLS = config.CAMUNDA_SECURE_CONNECTION
this.useTLS =
config.CAMUNDA_SECURE_CONNECTION &&
!config.zeebeGrpcSettings.ZEEBE_INSECURE_CONNECTION
const certChainPath = config.CAMUNDA_CUSTOM_CERT_CHAIN_PATH
const privateKeyPath = config.CAMUNDA_CUSTOM_PRIVATE_KEY_PATH

Expand Down