diff --git a/docs/configuration/tls.md b/docs/configuration/tls.md index a7f1e30687..1919d918ff 100644 --- a/docs/configuration/tls.md +++ b/docs/configuration/tls.md @@ -104,7 +104,7 @@ A wildcard SAN matches one label only, so `*.localhost.floci.io` covers `api.loc Only a name under a local suffix is accepted: `localhost`, `localhost.floci.io`, `localhost.localstack.cloud`, `FLOCI_HOSTNAME`, the `FLOCI_BASE_URL` host, and every `FLOCI_DNS_EXTRA_SUFFIXES` entry. Any other name is refused with a warning, so a Floci certificate can never cover a public name. This only applies to the generated certificate; a user-provided one is never changed. -Names are added by the custom domain operations: API Gateway `CreateDomainName`, IoT Core `CreateDomainConfiguration` with a `domainName`, and Cognito `CreateUserPoolDomain` with a `CustomDomainConfig`. The AWS operation succeeds either way; a name outside the local suffixes, or a reissue that fails, is logged as a warning. +Names are added by the custom domain operations: API Gateway `CreateDomainName`, IoT Core `CreateDomainConfiguration` with a `domainName`, and Cognito `CreateUserPoolDomain` with a `CustomDomainConfig`. EventBridge V2 `CreateEventSource` and `DescribeEventSource` add `*.c01.events-webhook..`, which covers every webhook source of that Region. The AWS operation succeeds either way; a name outside the local suffixes, or a reissue that fails, is logged as a warning. ### Containers Floci Launches diff --git a/docs/services/eventbridgev2.md b/docs/services/eventbridgev2.md index a78cffa47b..2f98a27c2a 100644 --- a/docs/services/eventbridgev2.md +++ b/docs/services/eventbridgev2.md @@ -130,6 +130,8 @@ Floci serves event sources of the `WebhookEventsConfiguration` kind. A request w - A source name is unique per account and Region, across event buses. - The webhook URL is `://.c01.events-webhook..//`. The scheme and authority are those of Floci's base URL. A POST to it publishes an event, as described below. + With TLS on, Floci's generated certificate names the webhook hosts of a Region once a source is created or + described there. A user-provided certificate must name `*.c01.events-webhook..` itself. - Each source has a Secrets Manager secret named `events-webhook!`, owned by `events-webhook`. It holds the static token, the HMAC secret, or the Basic credential as `{"username":"...","password":"..."}`. A credential the request leaves out is generated. The secret ARN is in `EventSourceDetails.WebhookDetails.SecretArn`. diff --git a/src/main/java/io/floci/aws/services/eventbridgev2/EventBridgeV2EventSources.java b/src/main/java/io/floci/aws/services/eventbridgev2/EventBridgeV2EventSources.java index 723f8480a5..c7a58bc7d9 100644 --- a/src/main/java/io/floci/aws/services/eventbridgev2/EventBridgeV2EventSources.java +++ b/src/main/java/io/floci/aws/services/eventbridgev2/EventBridgeV2EventSources.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import io.floci.aws.config.EmulatorConfig; +import io.floci.aws.config.TlsCertificateManager; import io.floci.aws.core.common.AwsArnUtils; import io.floci.aws.core.common.AwsException; import io.floci.aws.core.common.Digests; @@ -46,6 +47,7 @@ import java.util.function.Function; @ApplicationScoped public class EventBridgeV2EventSources implements Resettable { private static final String OWNING_SERVICE = "events-webhook"; + private static final String WEBHOOK_HOST_LABELS = "c01.events-webhook."; private static final Logger LOG = Logger.getLogger(EventBridgeV2EventSources.class); private static final int GENERATED_SECRET_BYTES = 32; @@ -64,22 +66,26 @@ public class EventBridgeV2EventSources implements Resettable { private final URI baseUrl; private final SecureRandom random = new SecureRandom(); private final WebhookDeduplication deduplication; + private final TlsCertificateManager certificateManager; @Inject public EventBridgeV2EventSources(StorageFactory storageFactory, SecretsManagerService secrets, - RegionResolver regionResolver, EmulatorConfig config) { + RegionResolver regionResolver, EmulatorConfig config, + TlsCertificateManager certificateManager) { this(storageFactory.create("eventbridgev2", "eventbridgev2-event-sources.json", new TypeReference>() {}), - secrets, regionResolver, Clock.systemUTC(), config.effectiveBaseUrl()); + secrets, regionResolver, Clock.systemUTC(), config.effectiveBaseUrl(), certificateManager); } EventBridgeV2EventSources(AccountAwareStorageBackend sources, SecretsManagerService secrets, - RegionResolver regionResolver, Clock clock, String baseUrl) { + RegionResolver regionResolver, Clock clock, String baseUrl, + TlsCertificateManager certificateManager) { this.sources = sources; this.secrets = secrets; this.regionResolver = regionResolver; this.clock = clock; this.baseUrl = URI.create(baseUrl); + this.certificateManager = certificateManager; this.deduplication = new WebhookDeduplication(clock); } @@ -377,11 +383,23 @@ public class EventBridgeV2EventSources implements Resettable { /** The URL a source receives its events at, in the scheme of Floci's own base URL. */ String webhookUrl(EventSourceV2 source) { - return baseUrl.getScheme() + "://" + source.getWebhookHostId() + ".c01.events-webhook." - + AwsArnUtils.parse(source.getArn()).region() + "." + baseUrl.getAuthority() + "/" + return baseUrl.getScheme() + "://" + source.getWebhookHostId() + "." + + webhookDomain(AwsArnUtils.parse(source.getArn()).region()) + baseUrl.getAuthority() + "/" + source.getWebhookToken() + "/"; } + private static String webhookDomain(String region) { + return WEBHOOK_HOST_LABELS + region + "."; + } + + /** + * Has the server certificate name the webhook hosts of the Region. Blocks until the HTTPS listener has + * switched certificates, so call it with no lock held. + */ + void coverWebhookHosts(String region) { + certificateManager.ensureHost("*." + webhookDomain(region) + baseUrl.getHost()); + } + record LocatedSource(String accountId, EventSourceV2 source) { } diff --git a/src/main/java/io/floci/aws/services/eventbridgev2/EventBridgeV2Service.java b/src/main/java/io/floci/aws/services/eventbridgev2/EventBridgeV2Service.java index c26c610e50..7512abdbf0 100644 --- a/src/main/java/io/floci/aws/services/eventbridgev2/EventBridgeV2Service.java +++ b/src/main/java/io/floci/aws/services/eventbridgev2/EventBridgeV2Service.java @@ -414,11 +414,23 @@ public class EventBridgeV2Service implements Resettable { // ──────────────────────────── Event sources ──────────────────────────── - public synchronized EventSourceV2 createEventSource(JsonNode request, String region) { + public EventSourceV2 createEventSource(JsonNode request, String region) { + EventSourceV2 source = storeEventSource(request, region); + eventSources.coverWebhookHosts(region); + return source; + } + + private synchronized EventSourceV2 storeEventSource(JsonNode request, String region) { return eventSources.create(request, region, name -> buses.get(storageKey(region, name))); } - public synchronized EventSourceV2 describeEventSource(JsonNode request, String region) { + public EventSourceV2 describeEventSource(JsonNode request, String region) { + EventSourceV2 source = findEventSource(request, region); + eventSources.coverWebhookHosts(region); + return source; + } + + private synchronized EventSourceV2 findEventSource(JsonNode request, String region) { return eventSources.describe(request, region); } diff --git a/src/test/java/io/floci/aws/config/TlsEnsureHostIntegrationTest.java b/src/test/java/io/floci/aws/config/TlsEnsureHostIntegrationTest.java index ff86e43619..022eedf4fe 100644 --- a/src/test/java/io/floci/aws/config/TlsEnsureHostIntegrationTest.java +++ b/src/test/java/io/floci/aws/config/TlsEnsureHostIntegrationTest.java @@ -7,15 +7,9 @@ import org.eclipse.microprofile.config.inject.ConfigProperty; import org.junit.jupiter.api.Test; import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SNIHostName; import javax.net.ssl.SSLHandshakeException; -import javax.net.ssl.SSLParameters; -import javax.net.ssl.SSLSocket; -import java.net.InetAddress; -import java.net.InetSocketAddress; import java.net.URI; import java.security.cert.X509Certificate; -import java.util.List; import java.util.Set; import static io.floci.aws.config.TlsTestSupport.dnsSans; @@ -82,22 +76,8 @@ class TlsEnsureHostIntegrationTest { handshake(true); } - /** - * Connects by IP so the JDK has no peer host of its own and verifies the certificate against - * the SNI name; the fixture leaf carries no {@code 127.0.0.1} SAN, so nothing else can match. - */ private X509Certificate handshake(boolean verifyIdentity) throws Exception { - try (SSLSocket socket = (SSLSocket) trustOnlyTheCa().getSocketFactory().createSocket()) { - socket.connect(new InetSocketAddress(InetAddress.getByName("127.0.0.1"), sslPort), 5000); - SSLParameters params = socket.getSSLParameters(); - params.setServerNames(List.of(new SNIHostName(NEW_HOST))); - if (verifyIdentity) { - params.setEndpointIdentificationAlgorithm("HTTPS"); - } - socket.setSSLParameters(params); - socket.startHandshake(); - return (X509Certificate) socket.getSession().getPeerCertificates()[0]; - } + return TlsTestSupport.handshake(sslPort, NEW_HOST, verifyIdentity); } /** A plain HTTPS client with the JDK's default hostname verifier, for the configured name. */ diff --git a/src/test/java/io/floci/aws/config/TlsEventBridgeWebhookHostIntegrationTest.java b/src/test/java/io/floci/aws/config/TlsEventBridgeWebhookHostIntegrationTest.java new file mode 100644 index 0000000000..58f096f722 --- /dev/null +++ b/src/test/java/io/floci/aws/config/TlsEventBridgeWebhookHostIntegrationTest.java @@ -0,0 +1,58 @@ +package io.floci.aws.config; + +import io.floci.aws.testing.AwsTestClients; +import io.quarkus.test.junit.QuarkusTest; +import io.quarkus.test.junit.TestProfile; +import org.eclipse.microprofile.config.inject.ConfigProperty; +import org.junit.jupiter.api.Test; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.eventbridgev2.EventBridgeV2Client; +import software.amazon.awssdk.services.eventbridgev2.model.CreateEventSourceResponse; +import software.amazon.awssdk.services.eventbridgev2.model.EventSourceConfiguration; +import software.amazon.awssdk.services.eventbridgev2.model.WebhookAuthConfiguration; + +import javax.net.ssl.SSLHandshakeException; +import java.net.URI; + +import static io.floci.aws.config.TlsTestSupport.handshake; +import static io.restassured.RestAssured.given; +import static org.junit.jupiter.api.Assertions.assertThrows; + +/** + * A client that trusts only the local CA and verifies the host name accepts the webhook URL that + * CreateEventSource answers, with no restart in between. + */ +@QuarkusTest +@TestProfile(SelfSignedTlsProfile.class) +class TlsEventBridgeWebhookHostIntegrationTest { + + private static final String ROLE = "arn:aws:iam::000000000000:role/WebhookRole"; + private static final Region REGION = Region.EU_WEST_2; + + @ConfigProperty(name = "quarkus.http.test-ssl-port", defaultValue = "0") + int sslPort; + + @Test + void theHostOfTheWebhookUrlCreateEventSourceReturnsPassesIdentityVerification() throws Exception { + String suffix = Long.toString(System.nanoTime(), 36); + try (EventBridgeV2Client events = AwsTestClients.create(EventBridgeV2Client.builder(), "000000000000", + REGION)) { + String bus = events.createEventBus(request -> request.name("v2-tls-" + suffix)).eventBusArn(); + String probe = "probe.c01.events-webhook.eu-west-2.localhost"; + assertThrows(SSLHandshakeException.class, () -> handshake(sslPort, probe, true), + "precondition: the Region has no webhook host in the certificate"); + + CreateEventSourceResponse created = events.createEventSource(request -> request.name("hook-" + suffix) + .eventBusArn(bus) + .configuration(EventSourceConfiguration.fromWebhookEventsConfiguration(webhook -> webhook + .roleArn(ROLE).authConfiguration(WebhookAuthConfiguration.builder() + .staticTokenAuthConfiguration(token -> token.tokenHttpHeader("X-Token") + .secretValue("s3cret-token")).build())))); + + String host = URI.create(created.eventSourceDetails().webhookDetails().webhookUrl()).getHost(); + handshake(sslPort, host, true); + } finally { + given().when().post("/_floci/state/reset").then().statusCode(200); + } + } +} diff --git a/src/test/java/io/floci/aws/config/TlsTestSupport.java b/src/test/java/io/floci/aws/config/TlsTestSupport.java index 6328640826..bcc8ce3ac2 100644 --- a/src/test/java/io/floci/aws/config/TlsTestSupport.java +++ b/src/test/java/io/floci/aws/config/TlsTestSupport.java @@ -4,7 +4,12 @@ import io.floci.aws.services.acm.CertificateGenerator; import io.floci.aws.services.acm.model.KeyAlgorithm; import io.floci.aws.testing.TlsTrust; +import javax.net.ssl.SNIHostName; import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLSocket; +import java.net.InetAddress; +import java.net.InetSocketAddress; import java.nio.file.Files; import java.nio.file.Path; import java.security.cert.X509Certificate; @@ -36,4 +41,22 @@ final class TlsTestSupport { } return names; } + + /** + * Connects by IP so the JDK has no peer host of its own and verifies the certificate against the SNI + * name. The fixture leaf carries no {@code 127.0.0.1} SAN, so nothing else can match. + */ + static X509Certificate handshake(int port, String serverName, boolean verifyIdentity) throws Exception { + try (SSLSocket socket = (SSLSocket) trustOnlyTheCa().getSocketFactory().createSocket()) { + socket.connect(new InetSocketAddress(InetAddress.getByName("127.0.0.1"), port), 5000); + SSLParameters params = socket.getSSLParameters(); + params.setServerNames(List.of(new SNIHostName(serverName))); + if (verifyIdentity) { + params.setEndpointIdentificationAlgorithm("HTTPS"); + } + socket.setSSLParameters(params); + socket.startHandshake(); + return (X509Certificate) socket.getSession().getPeerCertificates()[0]; + } + } } diff --git a/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2EventSourceIntegrationTest.java b/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2EventSourceIntegrationTest.java index b09319cac7..ec5647d552 100644 --- a/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2EventSourceIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2EventSourceIntegrationTest.java @@ -4,8 +4,10 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.dataformat.cbor.CBORFactory; +import io.floci.aws.config.TlsCertificateManager; import io.floci.aws.testing.AwsTestClients; import io.floci.aws.testing.RestAssuredJsonUtils; +import io.quarkus.test.InjectMock; import io.quarkus.test.junit.QuarkusTest; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -35,6 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.verify; /** Webhook event sources of EventBridge V2 and the managed secrets that hold their credentials, through the SDKs. */ @QuarkusTest @@ -43,11 +46,28 @@ class EventBridgeV2EventSourceIntegrationTest { private static final String ROLE = "arn:aws:iam::000000000000:role/WebhookRole"; private static final ObjectMapper CBOR_MAPPER = new ObjectMapper(new CBORFactory()); + @InjectMock + TlsCertificateManager certificateManager; + @BeforeAll static void configureContentTypes() { RestAssuredJsonUtils.configureAwsContentTypes(); } + @Test + void createEventSourceAsksTheCertificateToNameTheWebhookHostsOfTheRegion() { + String suffix = suffix(); + try (EventBridgeV2Client events = events()) { + String bus = events.createEventBus(request -> request.name("v2-tls-" + suffix)).eventBusArn(); + + events.createEventSource(request -> request.name("hook-" + suffix).eventBusArn(bus) + .configuration(EventSourceConfiguration.fromWebhookEventsConfiguration(webhook -> webhook + .roleArn(ROLE).authConfiguration(staticToken("X-Token", "s3cret-token"))))); + + verify(certificateManager).ensureHost("*.c01.events-webhook.us-east-1.localhost"); + } + } + @Test void aWebhookEventSourceLivesThroughCreateDescribeUpdateAndDelete() { String suffix = suffix(); diff --git a/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2EventSourcesTest.java b/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2EventSourcesTest.java index b7dde24649..0563c39002 100644 --- a/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2EventSourcesTest.java +++ b/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2EventSourcesTest.java @@ -3,6 +3,7 @@ package io.floci.aws.services.eventbridgev2; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; +import io.floci.aws.config.TlsCertificateManager; import io.floci.aws.core.common.AwsException; import io.floci.aws.core.common.PaginatedResult; import io.floci.aws.core.common.RegionResolver; @@ -54,6 +55,7 @@ class EventBridgeV2EventSourcesTest { private static final String BASIC_AUTH = "{\"BasicHttpAuthConfiguration\":{}}"; private SecretsManagerService secrets; + private TlsCertificateManager certificateManager; private EventBridgeV2Service service; private TestClock clock; private String bus; @@ -69,8 +71,10 @@ class EventBridgeV2EventSourcesTest { when(secrets.describeSecret(any(), any())).thenReturn(new Secret()); clock = new TestClock(NOW); RegionResolver regionResolver = new RegionResolver(REGION, ACCOUNT); + certificateManager = mock(TlsCertificateManager.class); EventBridgeV2EventSources eventSources = new EventBridgeV2EventSources( - AccountAwareStorageBackend.inMemory(ACCOUNT), secrets, regionResolver, clock, "http://floci.test:4566"); + AccountAwareStorageBackend.inMemory(ACCOUNT), secrets, regionResolver, clock, "http://floci.test:4566", + certificateManager); service = new EventBridgeV2Service(AccountAwareStorageBackend.inMemory(ACCOUNT), AccountAwareStorageBackend.inMemory(ACCOUNT), regionResolver, mock(EventBridgeV2Delivery.class), eventSources, clock, true); @@ -95,6 +99,33 @@ class EventBridgeV2EventSourcesTest { assertTrue(source.getWebhookHostId().startsWith("a")); } + @Test + void createAsksTheCertificateToNameTheWebhookHostsOfTheRegion() { + service.createEventSource(create("hook", bus, STATIC_AUTH), REGION); + + verify(certificateManager).ensureHost("*.c01.events-webhook.us-east-1.floci.test"); + } + + @Test + void refusedCreatesAskForNoCertificateName() { + assertThrows(AwsException.class, () -> service.createEventSource( + create("hook", "arn:aws:events:us-east-1:000000000000:event-bus/missing", STATIC_AUTH), REGION)); + service.createEventSource(create("hook", bus, STATIC_AUTH), REGION); + assertThrows(AwsException.class, () -> service.createEventSource( + create("hook", bus, BASIC_AUTH), REGION)); + + verify(certificateManager, times(1)).ensureHost(any()); + } + + @Test + void describeAsksTheCertificateToNameTheWebhookHostsOfTheRegion() { + EventSourceV2 source = service.createEventSource(create("hook", bus, STATIC_AUTH), REGION); + + service.describeEventSource(json("{\"EventSourceArn\":\"" + source.getArn() + "\"}"), REGION); + + verify(certificateManager, times(2)).ensureHost("*.c01.events-webhook.us-east-1.floci.test"); + } + @Test void createKeepsTheSecretOutOfTheStoredConfiguration() { EventSourceV2 source = service.createEventSource(create("hook", bus, @@ -369,7 +400,8 @@ class EventBridgeV2EventSourcesTest { IllegalStateException failure = new IllegalStateException("disk full"); doThrow(failure).when(failing).put(any(), any()); EventBridgeV2EventSources eventSources = new EventBridgeV2EventSources(failing, secrets, - new RegionResolver(REGION, ACCOUNT), clock, "http://floci.test:4566"); + new RegionResolver(REGION, ACCOUNT), clock, "http://floci.test:4566", + certificateManager); EventBusV2 existing = new EventBusV2(); existing.setArn(bus); diff --git a/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2ServiceTest.java b/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2ServiceTest.java index 6cb324559f..80a4729d14 100644 --- a/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2ServiceTest.java +++ b/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2ServiceTest.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import io.floci.aws.config.TlsCertificateManager; import io.floci.aws.core.common.AwsException; import io.floci.aws.core.common.PaginatedResult; import io.floci.aws.core.common.RegionResolver; @@ -64,7 +65,7 @@ class EventBridgeV2ServiceTest { Clock clock = Clock.fixed(NOW, ZoneOffset.UTC); EventBridgeV2EventSources eventSources = new EventBridgeV2EventSources( AccountAwareStorageBackend.inMemory(ACCOUNT), mock(SecretsManagerService.class), regionResolver, clock, - "http://floci.test:4566"); + "http://floci.test:4566", mock(TlsCertificateManager.class)); service = new EventBridgeV2Service(AccountAwareStorageBackend.inMemory(ACCOUNT), AccountAwareStorageBackend.inMemory(ACCOUNT), regionResolver, delivery, eventSources, clock, true); } diff --git a/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2WebhooksTest.java b/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2WebhooksTest.java index 20d2a28adb..cd5650ae11 100644 --- a/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2WebhooksTest.java +++ b/src/test/java/io/floci/aws/services/eventbridgev2/EventBridgeV2WebhooksTest.java @@ -2,6 +2,7 @@ package io.floci.aws.services.eventbridgev2; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import io.floci.aws.config.TlsCertificateManager; import io.floci.aws.core.common.AwsException; import io.floci.aws.core.common.RegionResolver; import io.floci.aws.core.storage.AccountAwareStorageBackend; @@ -86,7 +87,8 @@ class EventBridgeV2WebhooksTest { clock = new ManualClock(Instant.parse("2026-11-25T06:00:00.123Z")); RegionResolver regionResolver = new RegionResolver(REGION, ACCOUNT); sources = new EventBridgeV2EventSources( - AccountAwareStorageBackend.inMemory(ACCOUNT), secrets, regionResolver, clock, "http://floci.test:4566"); + AccountAwareStorageBackend.inMemory(ACCOUNT), secrets, regionResolver, clock, "http://floci.test:4566", + mock(TlsCertificateManager.class)); service = new EventBridgeV2Service(AccountAwareStorageBackend.inMemory(ACCOUNT), AccountAwareStorageBackend.inMemory(ACCOUNT), regionResolver, delivery, sources, clock, true); webhooks = new EventBridgeV2Webhooks(service, sources, secrets, clock); diff --git a/src/test/java/io/floci/aws/services/eventbridgev2/WebhookSourceFixture.java b/src/test/java/io/floci/aws/services/eventbridgev2/WebhookSourceFixture.java index 42e4d8aa12..9bb13c9079 100644 --- a/src/test/java/io/floci/aws/services/eventbridgev2/WebhookSourceFixture.java +++ b/src/test/java/io/floci/aws/services/eventbridgev2/WebhookSourceFixture.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import io.floci.aws.config.EmulatorConfig; +import io.floci.aws.config.TlsCertificateManager; import io.floci.aws.core.common.RegionResolver; import io.floci.aws.core.storage.AccountAwareStorageBackend; import io.floci.aws.core.storage.StorageFactory; @@ -49,7 +50,8 @@ final class WebhookSourceFixture { secrets = new SecretsManagerService(factory, config, regionResolver, null, MAPPER, null); clock = new ManualClock(NOW); EventBridgeV2EventSources sources = new EventBridgeV2EventSources( - AccountAwareStorageBackend.inMemory(ACCOUNT), secrets, regionResolver, clock, "http://floci.test:4566"); + AccountAwareStorageBackend.inMemory(ACCOUNT), secrets, regionResolver, clock, "http://floci.test:4566", + mock(TlsCertificateManager.class)); service = new EventBridgeV2Service(AccountAwareStorageBackend.inMemory(ACCOUNT), AccountAwareStorageBackend.inMemory(ACCOUNT), regionResolver, delivery, sources, clock, true); webhooks = new EventBridgeV2Webhooks(service, sources, secrets, clock);