コード例 #1
0
        public void UseBadEndpointId()
        {
            var request = new PutEventsRequest
            {
                EndpointId = "badactor.com?foo=bar"
            };

            var internalRequest = EventBridgeTestUtils.RunMockRequest(request, PutEventsRequestMarshaller.Instance);
        }
コード例 #2
0
        public void UseEmptyEndpointId()
        {
            var request = new PutEventsRequest
            {
                EndpointId = ""
            };

            var internalRequest = EventBridgeTestUtils.RunMockRequest(request, PutEventsRequestMarshaller.Instance);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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"]);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        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"]);
        }
コード例 #10
0
        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"]);
        }