public void UseBadEndpointId() { var request = new PutEventsRequest { EndpointId = "badactor.com?foo=bar" }; var internalRequest = EventBridgeTestUtils.RunMockRequest(request, PutEventsRequestMarshaller.Instance); }
public void UseEmptyEndpointId() { var request = new PutEventsRequest { EndpointId = "" }; var internalRequest = EventBridgeTestUtils.RunMockRequest(request, PutEventsRequestMarshaller.Instance); }
public void UseDefaultEndpointWhenEndpointIdIsNotSet() { var request = new PutEventsRequest { EndpointId = null }; var internalRequest = EventBridgeTestUtils.RunMockRequest(request, PutEventsRequestMarshaller.Instance); Assert.AreEqual("https://events.us-east-1.amazonaws.com/", internalRequest.Endpoint.ToString()); CheckV4Authorization(internalRequest); }
public void UseMrapEndpointWhenEndpointIdIsSet() { var request = new PutEventsRequest { EndpointId = "abc123.456def" }; var internalRequest = EventBridgeTestUtils.RunMockRequest(request, PutEventsRequestMarshaller.Instance); Assert.AreEqual("https://abc123.456def.endpoint.events.amazonaws.com/", internalRequest.Endpoint.ToString()); CheckV4aAuthorization(internalRequest); Assert.AreEqual("*", internalRequest.AuthenticationRegion); Assert.AreEqual("*", internalRequest.Headers["x-amz-region-set"]); }
public void UseFIPSEndpointWithEndpointIdSet() { var request = new PutEventsRequest { EndpointId = "abc123.456def" }; var config = new AmazonEventBridgeConfig { RegionEndpoint = RegionEndpoint.USEast1, UseFIPSEndpoint = true }; var internalRequest = EventBridgeTestUtils.RunMockRequest(request, PutEventsRequestMarshaller.Instance, config); }
public void UseOverrideEndpointWhenEndpointIdIsNotSet() { var request = new PutEventsRequest { EndpointId = null }; var config = new AmazonEventBridgeConfig { ServiceURL = "https://example.org" }; var internalRequest = EventBridgeTestUtils.RunMockRequest(request, PutEventsRequestMarshaller.Instance, config); Assert.AreEqual("https://example.org/", internalRequest.Endpoint.ToString()); CheckV4Authorization(internalRequest); }
public void UseDefaultIsoEndpointWhenEndpointIdIsNotSet() { var request = new PutEventsRequest { EndpointId = null }; var config = new AmazonEventBridgeConfig { RegionEndpoint = RegionEndpoint.USIsoEast1 }; var internalRequest = EventBridgeTestUtils.RunMockRequest(request, PutEventsRequestMarshaller.Instance, config); Assert.AreEqual("https://events.us-iso-east-1.c2s.ic.gov/", internalRequest.Endpoint.ToString()); CheckV4Authorization(internalRequest); }
public void UseDualStackEndpointWithEndpointIdNotSet() { var request = new PutEventsRequest { EndpointId = null }; var config = new AmazonEventBridgeConfig { RegionEndpoint = RegionEndpoint.USEast1, UseDualstackEndpoint = true }; var internalRequest = EventBridgeTestUtils.RunMockRequest(request, PutEventsRequestMarshaller.Instance, config); Assert.AreEqual("https://events.us-east-1.api.aws/", internalRequest.Endpoint.ToString()); CheckV4Authorization(internalRequest); }
public void UseOverrideEndpointWhenEndpointIdIsSet() { var request = new PutEventsRequest { EndpointId = "abc123.456def" }; var config = new AmazonEventBridgeConfig { ServiceURL = "https://example.org" }; var internalRequest = EventBridgeTestUtils.RunMockRequest(request, PutEventsRequestMarshaller.Instance, config); Assert.AreEqual("https://example.org/", internalRequest.Endpoint.ToString()); CheckV4aAuthorization(internalRequest); Assert.AreEqual("*", internalRequest.AuthenticationRegion); Assert.AreEqual("*", internalRequest.Headers["x-amz-region-set"]); }
public void UseDualStackEndpointWithEndpointIdSet() { var request = new PutEventsRequest { EndpointId = "abc123.456def" }; var config = new AmazonEventBridgeConfig { RegionEndpoint = RegionEndpoint.USEast1, UseDualstackEndpoint = true }; var internalRequest = EventBridgeTestUtils.RunMockRequest(request, PutEventsRequestMarshaller.Instance, config); Assert.AreEqual("https://abc123.456def.endpoint.events.api.aws/", internalRequest.Endpoint.ToString()); CheckV4aAuthorization(internalRequest); Assert.AreEqual("*", internalRequest.AuthenticationRegion); Assert.AreEqual("*", internalRequest.Headers["x-amz-region-set"]); }