use of io.camunda.zeebe.gateway.impl.configuration.GatewayCfg in project zeebe by camunda.
the class SecurityTest method shouldNotStartWithTlsEnabledAndWrongKey.
@Test
void shouldNotStartWithTlsEnabledAndWrongKey() {
// given
final GatewayCfg cfg = createGatewayCfg();
cfg.getSecurity().setPrivateKeyPath(new File("/tmp/i-dont-exist.key"));
// when
gateway = buildGateway(cfg);
// then
assertThatCode(() -> gateway.start()).isInstanceOf(IllegalArgumentException.class).hasMessage("Expected to find a private key file at the provided location '%s' but none was found.", cfg.getSecurity().getPrivateKeyPath());
}
use of io.camunda.zeebe.gateway.impl.configuration.GatewayCfg in project zeebe by camunda.
the class StandaloneGatewaySecurityTest method shouldNotStartWithTlsEnabledAndNoCert.
@Test
void shouldNotStartWithTlsEnabledAndNoCert() {
// given
final GatewayCfg cfg = createGatewayCfg();
cfg.getCluster().getSecurity().setCertificateChainPath(null);
// when
gateway = buildGateway(cfg);
// then
assertThatCode(() -> gateway.run()).isInstanceOf(IllegalArgumentException.class).hasMessage("Expected to have a valid certificate chain path for cluster security, but none " + "configured");
}
use of io.camunda.zeebe.gateway.impl.configuration.GatewayCfg in project zeebe by camunda.
the class StandaloneGatewaySecurityTest method shouldStartWithTlsEnabled.
@Test
void shouldStartWithTlsEnabled() throws Exception {
// given
final GatewayCfg cfg = createGatewayCfg();
// when
gateway = buildGateway(cfg);
gateway.run();
// then
final var clusterAddress = new InetSocketAddress(cfg.getCluster().getHost(), cfg.getCluster().getPort());
SslAssert.assertThat(clusterAddress).isSecuredBy(certificate);
}
use of io.camunda.zeebe.gateway.impl.configuration.GatewayCfg in project zeebe by camunda.
the class StandaloneGatewaySecurityTest method shouldNotStartWithTlsEnabledAndWrongCert.
@Test
void shouldNotStartWithTlsEnabledAndWrongCert() {
// given
final GatewayCfg cfg = createGatewayCfg();
cfg.getCluster().getSecurity().setCertificateChainPath(new File("/tmp/i-dont-exist.crt"));
// when
gateway = buildGateway(cfg);
// then
assertThatCode(() -> gateway.run()).isInstanceOf(IllegalArgumentException.class).hasMessage("Expected the configured cluster security certificate chain path " + "'/tmp/i-dont-exist.crt' to point to a readable file, but it does not");
}
use of io.camunda.zeebe.gateway.impl.configuration.GatewayCfg in project zeebe by camunda.
the class UnavailableBrokersTest method setUp.
@BeforeAll
static void setUp() throws IOException {
final NetworkCfg networkCfg = new NetworkCfg().setPort(SocketUtil.getNextAddress().getPort());
final GatewayCfg config = new GatewayCfg().setNetwork(networkCfg);
config.init(InetAddress.getLocalHost().getHostName());
cluster = AtomixCluster.builder().build();
cluster.start();
actorScheduler = ActorScheduler.newActorScheduler().build();
actorScheduler.start();
gateway = new Gateway(new GatewayCfg().setNetwork(networkCfg), cluster.getMessagingService(), cluster.getMembershipService(), cluster.getEventService(), actorScheduler);
gateway.start();
final String gatewayAddress = NetUtil.toSocketAddressString(networkCfg.toSocketAddress());
client = ZeebeClient.newClientBuilder().gatewayAddress(gatewayAddress).usePlaintext().build();
}
Aggregations