Skip to content

Commit

Permalink
chore: fix operate client auth (SaaS)
Browse files Browse the repository at this point in the history
  • Loading branch information
chillleader committed Dec 27, 2023
1 parent c138a8e commit 9718890
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ camunda.connector.inbound.log.size=10

# Disabling the default Operate client, we are configuring our own
camunda.operate.client.enabled=false

debug=true
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
public class MockSaaSConfiguration {

public static final String OPERATE_CLIENT_URL =
"https://operate.cloud.dev.ultrawombat.com/myClusterId";
public static final String OPERATE_CLIENT_BASEURL = "operate.cloud.dev.ultrawombat.com";
"https://hel-1.operate.ultrawombat.com/8e97d8aa-d4f1-4a94-93dc-968cc6485749";
public static final String OPERATE_CLIENT_BASEURL = "operate.ultrawombat.com";
public static final String OPERATE_CLIENT_AUTH_URL =
"https://login.cloud.dev.ultrawombat.com/oauth/token";
public static final String OPERATE_CLIENT_CLIENT_ID = "clientId";
public static final String OPERATE_CLIENT_SECRET = "secret";
"https://login.cloud.ultrawombat.com/oauth/token";
public static final String OPERATE_CLIENT_CLIENT_ID = "D80h1NNe23gx.k7SUmM~.MhdRlo1Xgzi";
public static final String OPERATE_CLIENT_SECRET = "QzkfQ-r-v1ro3cMCSsmADgpfbF0jgYWU2NT1wES_LrEGLsZKb_EXGz-YRvkCO3YL";

private final Map<String, String> secrets =
Map.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static org.assertj.core.api.Assertions.assertThat;

import io.camunda.common.auth.Authentication;
import io.camunda.zeebe.spring.client.properties.OperateClientConfigurationProperties;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -34,12 +35,14 @@
"camunda.connector.auth.issuer=https://weblogin.cloud.dev.ultrawombat.com/",
"camunda.operate.client.url=" + MockSaaSConfiguration.OPERATE_CLIENT_URL,
"camunda.operate.client.authUrl=" + MockSaaSConfiguration.OPERATE_CLIENT_AUTH_URL,
"camunda.operate.client.baseUrl=" + MockSaaSConfiguration.OPERATE_CLIENT_BASEURL
"camunda.operate.client.baseUrl=" + MockSaaSConfiguration.OPERATE_CLIENT_BASEURL,
"debug=true"
})
@ActiveProfiles("test")
public class TestSpringContextStartup {

@Autowired private OperateClientConfigurationProperties operateProperties;
@Autowired private Authentication authentication;

@Test
public void contextLoaded() {
Expand All @@ -61,4 +64,9 @@ public void operatePropertiesAreSet() {
assertThat(operateProperties.getClientSecret())
.isEqualTo(MockSaaSConfiguration.OPERATE_CLIENT_SECRET);
}

@Test
public void authenticationTest() throws InterruptedException {
Thread.sleep(30000);
}
}

0 comments on commit 9718890

Please sign in to comment.