Skip to content

Commit 54d4e20

Browse files
committed
fix: secure connection
- replace useTLS to CAMUNDA_SECURE_CONNECTION - adjusted test cases
1 parent 2c161ab commit 54d4e20

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

app/lib/zeebe-api/zeebe-api.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ class ZeebeAPI {
406406

407407
// (0) set `useTLS` according to the protocol
408408
const tlsOptions = {
409-
useTLS: options.useTLS || /^https:\/\//.test(url)
409+
CAMUNDA_SECURE_CONNECTION: options.CAMUNDA_SECURE_CONNECTION || /^https:\/\//.test(url)
410410
};
411411

412412
// (1) use certificate from flag

app/test/spec/zeebe-api/zeebe-api-spec.js

+10-12
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@ describe('ZeebeAPI', function() {
18131813
});
18141814

18151815

1816-
it('should set `useTLS` to true for https endpoint', async function() {
1816+
it('should set `CAMUNDA_SECURE_CONNECTION` to true for https endpoint', async function() {
18171817

18181818
// given
18191819
let usedConfig;
@@ -1835,11 +1835,11 @@ describe('ZeebeAPI', function() {
18351835
await zeebeAPI.deploy(parameters);
18361836

18371837
// then
1838-
expect(usedConfig).to.have.property('useTLS', true);
1838+
expect(usedConfig).to.have.property('CAMUNDA_SECURE_CONNECTION', true);
18391839
});
18401840

18411841

1842-
it('should set `useTLS=false` for http endpoint (no auth)', async function() {
1842+
it('should set `CAMUNDA_SECURE_CONNECTION=false` for http endpoint (no auth)', async function() {
18431843

18441844
// given
18451845
let usedConfig;
@@ -1861,11 +1861,11 @@ describe('ZeebeAPI', function() {
18611861
await zeebeAPI.deploy(parameters);
18621862

18631863
// then
1864-
expect(usedConfig).to.have.property('useTLS', false);
1864+
expect(usedConfig).to.have.property('CAMUNDA_SECURE_CONNECTION', false);
18651865
});
18661866

18671867

1868-
it('should set `useTLS=false` for http endpoint (oauth)', async function() {
1868+
it('should set `CAMUNDA_SECURE_CONNECTION=false` for http endpoint (oauth)', async function() {
18691869

18701870
// given
18711871
let usedConfig;
@@ -1888,11 +1888,11 @@ describe('ZeebeAPI', function() {
18881888
await zeebeAPI.deploy(parameters);
18891889

18901890
// then
1891-
expect(usedConfig).to.have.property('useTLS', false);
1891+
expect(usedConfig).to.have.property('CAMUNDA_SECURE_CONNECTION', false);
18921892
});
18931893

18941894

1895-
it('should set `useTLS=true` for no protocol endpoint (cloud)', async function() {
1895+
it('should set `CAMUNDA_SECURE_CONNECTION=true` for no protocol endpoint (cloud)', async function() {
18961896

18971897
// given
18981898
let usedConfig;
@@ -1914,7 +1914,7 @@ describe('ZeebeAPI', function() {
19141914
await zeebeAPI.deploy(parameters);
19151915

19161916
// then
1917-
expect(usedConfig).to.have.property('useTLS', true);
1917+
expect(usedConfig).to.have.property('CAMUNDA_SECURE_CONNECTION', true);
19181918
});
19191919

19201920

@@ -1939,8 +1939,6 @@ describe('ZeebeAPI', function() {
19391939
// when
19401940
await zeebeAPI.deploy(parameters);
19411941

1942-
console.log(usedConfig, 'config');
1943-
19441942
// then
19451943
expect(usedConfig).to.have.property('CAMUNDA_SECURE_CONNECTION', true);
19461944
});
@@ -2302,7 +2300,7 @@ describe('ZeebeAPI', function() {
23022300
CAMUNDA_AUTH_STRATEGY: 'BASIC',
23032301
CAMUNDA_BASIC_AUTH_USERNAME: '******',
23042302
CAMUNDA_BASIC_AUTH_PASSWORD: '******',
2305-
useTLS: false
2303+
CAMUNDA_SECURE_CONNECTION: false
23062304
}
23072305
});
23082306

@@ -2377,7 +2375,7 @@ describe('ZeebeAPI', function() {
23772375
ZEEBE_CLIENT_SECRET: '******',
23782376
CAMUNDA_CONSOLE_OAUTH_AUDIENCE: 'audience',
23792377
CAMUNDA_OAUTH_URL: 'oauthURL',
2380-
useTLS: false
2378+
CAMUNDA_SECURE_CONNECTION: false
23812379
}
23822380
});
23832381

0 commit comments

Comments
 (0)