1585 1585 | out.insert("signingName".to_string(), "s3".to_string().into());
|
1586 1586 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
1587 1587 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1588 1588 | out
|
1589 1589 | })]
|
1590 1590 | )
|
1591 1591 | .build()
|
1592 1592 | );
|
1593 1593 | }
|
1594 1594 |
|
1595 - | /// virtual addressing, aws-global region with Copy Source, and Key uses the global endpoint. Copy Source and Key parameters should not be used in endpoint evaluation.
|
1596 - | #[test]
|
1597 - | fn test_58() {
|
1598 - | let params = crate::config::endpoint::Params::builder()
|
1599 - | .region("aws-global".to_string())
|
1600 - | .bucket("bucket-name".to_string())
|
1601 - | .use_fips(false)
|
1602 - | .use_dual_stack(false)
|
1603 - | .accelerate(false)
|
1604 - | .copy_source("/copy/source".to_string())
|
1605 - | .key("key".to_string())
|
1606 - | .build()
|
1607 - | .expect("invalid params");
|
1608 - | let resolver = crate::config::endpoint::DefaultResolver::new();
|
1609 - | let endpoint = resolver.resolve_endpoint(¶ms);
|
1610 - | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3.amazonaws.com");
|
1611 - | assert_eq!(
|
1612 - | endpoint,
|
1613 - | ::aws_smithy_types::endpoint::Endpoint::builder()
|
1614 - | .url("https://bucket-name.s3.amazonaws.com")
|
1615 - | .property(
|
1616 - | "authSchemes",
|
1617 - | vec![::aws_smithy_types::Document::from({
|
1618 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
1619 - | out.insert("name".to_string(), "sigv4".to_string().into());
|
1620 - | out.insert("signingName".to_string(), "s3".to_string().into());
|
1621 - | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
1622 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1623 - | out
|
1624 - | })]
|
1625 - | )
|
1626 - | .build()
|
1627 - | );
|
1628 - | }
|
1629 - |
|
1630 1595 | /// virtual addressing, aws-global region with fips uses the regional fips endpoint
|
1631 1596 | #[test]
|
1632 - | fn test_59() {
|
1597 + | fn test_58() {
|
1633 1598 | let params = crate::config::endpoint::Params::builder()
|
1634 1599 | .region("aws-global".to_string())
|
1635 1600 | .bucket("bucket-name".to_string())
|
1636 1601 | .use_fips(true)
|
1637 1602 | .use_dual_stack(false)
|
1638 1603 | .accelerate(false)
|
1639 1604 | .build()
|
1640 1605 | .expect("invalid params");
|
1641 1606 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
1642 1607 | let endpoint = resolver.resolve_endpoint(¶ms);
|
1643 1608 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-fips.us-east-1.amazonaws.com");
|
1644 1609 | assert_eq!(
|
1645 1610 | endpoint,
|
1646 1611 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
1647 1612 | .url("https://bucket-name.s3-fips.us-east-1.amazonaws.com")
|
1648 1613 | .property(
|
1649 1614 | "authSchemes",
|
1650 1615 | vec![::aws_smithy_types::Document::from({
|
1651 1616 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
1652 1617 | out.insert("name".to_string(), "sigv4".to_string().into());
|
1653 1618 | out.insert("signingName".to_string(), "s3".to_string().into());
|
1654 1619 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
1655 1620 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1656 1621 | out
|
1657 1622 | })]
|
1658 1623 | )
|
1659 1624 | .build()
|
1660 1625 | );
|
1661 1626 | }
|
1662 1627 |
|
1663 1628 | /// virtual addressing, aws-global region with dualstack uses the regional dualstack endpoint
|
1664 1629 | #[test]
|
1665 - | fn test_60() {
|
1630 + | fn test_59() {
|
1666 1631 | let params = crate::config::endpoint::Params::builder()
|
1667 1632 | .region("aws-global".to_string())
|
1668 1633 | .bucket("bucket-name".to_string())
|
1669 1634 | .use_fips(false)
|
1670 1635 | .use_dual_stack(true)
|
1671 1636 | .accelerate(false)
|
1672 1637 | .build()
|
1673 1638 | .expect("invalid params");
|
1674 1639 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
1675 1640 | let endpoint = resolver.resolve_endpoint(¶ms);
|
1676 1641 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3.dualstack.us-east-1.amazonaws.com");
|
1677 1642 | assert_eq!(
|
1678 1643 | endpoint,
|
1679 1644 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
1680 1645 | .url("https://bucket-name.s3.dualstack.us-east-1.amazonaws.com")
|
1681 1646 | .property(
|
1682 1647 | "authSchemes",
|
1683 1648 | vec![::aws_smithy_types::Document::from({
|
1684 1649 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
1685 1650 | out.insert("name".to_string(), "sigv4".to_string().into());
|
1686 1651 | out.insert("signingName".to_string(), "s3".to_string().into());
|
1687 1652 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
1688 1653 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1689 1654 | out
|
1690 1655 | })]
|
1691 1656 | )
|
1692 1657 | .build()
|
1693 1658 | );
|
1694 1659 | }
|
1695 1660 |
|
1696 1661 | /// virtual addressing, aws-global region with fips/dualstack uses the regional fips/dualstack endpoint
|
1697 1662 | #[test]
|
1698 - | fn test_61() {
|
1663 + | fn test_60() {
|
1699 1664 | let params = crate::config::endpoint::Params::builder()
|
1700 1665 | .region("aws-global".to_string())
|
1701 1666 | .bucket("bucket-name".to_string())
|
1702 1667 | .use_fips(true)
|
1703 1668 | .use_dual_stack(true)
|
1704 1669 | .accelerate(false)
|
1705 1670 | .build()
|
1706 1671 | .expect("invalid params");
|
1707 1672 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
1708 1673 | let endpoint = resolver.resolve_endpoint(¶ms);
|
1709 1674 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-fips.dualstack.us-east-1.amazonaws.com");
|
1710 1675 | assert_eq!(
|
1711 1676 | endpoint,
|
1712 1677 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
1713 1678 | .url("https://bucket-name.s3-fips.dualstack.us-east-1.amazonaws.com")
|
1714 1679 | .property(
|
1715 1680 | "authSchemes",
|
1716 1681 | vec![::aws_smithy_types::Document::from({
|
1717 1682 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
1718 1683 | out.insert("name".to_string(), "sigv4".to_string().into());
|
1719 1684 | out.insert("signingName".to_string(), "s3".to_string().into());
|
1720 1685 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
1721 1686 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1722 1687 | out
|
1723 1688 | })]
|
1724 1689 | )
|
1725 1690 | .build()
|
1726 1691 | );
|
1727 1692 | }
|
1728 1693 |
|
1729 1694 | /// virtual addressing, aws-global region with accelerate uses the global accelerate endpoint
|
1730 1695 | #[test]
|
1731 - | fn test_62() {
|
1696 + | fn test_61() {
|
1732 1697 | let params = crate::config::endpoint::Params::builder()
|
1733 1698 | .region("aws-global".to_string())
|
1734 1699 | .bucket("bucket-name".to_string())
|
1735 1700 | .use_fips(false)
|
1736 1701 | .use_dual_stack(false)
|
1737 1702 | .accelerate(true)
|
1738 1703 | .build()
|
1739 1704 | .expect("invalid params");
|
1740 1705 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
1741 1706 | let endpoint = resolver.resolve_endpoint(¶ms);
|
1742 1707 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-accelerate.amazonaws.com");
|
1743 1708 | assert_eq!(
|
1744 1709 | endpoint,
|
1745 1710 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
1746 1711 | .url("https://bucket-name.s3-accelerate.amazonaws.com")
|
1747 1712 | .property(
|
1748 1713 | "authSchemes",
|
1749 1714 | vec![::aws_smithy_types::Document::from({
|
1750 1715 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
1751 1716 | out.insert("name".to_string(), "sigv4".to_string().into());
|
1752 1717 | out.insert("signingName".to_string(), "s3".to_string().into());
|
1753 1718 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
1754 1719 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1755 1720 | out
|
1756 1721 | })]
|
1757 1722 | )
|
1758 1723 | .build()
|
1759 1724 | );
|
1760 1725 | }
|
1761 1726 |
|
1762 1727 | /// virtual addressing, aws-global region with custom endpoint
|
1763 1728 | #[test]
|
1764 - | fn test_63() {
|
1729 + | fn test_62() {
|
1765 1730 | let params = crate::config::endpoint::Params::builder()
|
1766 1731 | .region("aws-global".to_string())
|
1767 1732 | .endpoint("https://example.com".to_string())
|
1768 1733 | .bucket("bucket-name".to_string())
|
1769 1734 | .use_fips(false)
|
1770 1735 | .use_dual_stack(false)
|
1771 1736 | .accelerate(false)
|
1772 1737 | .build()
|
1773 1738 | .expect("invalid params");
|
1774 1739 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
1775 1740 | let endpoint = resolver.resolve_endpoint(¶ms);
|
1776 1741 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.example.com");
|
1777 1742 | assert_eq!(
|
1778 1743 | endpoint,
|
1779 1744 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
1780 1745 | .url("https://bucket-name.example.com")
|
1781 1746 | .property(
|
1782 1747 | "authSchemes",
|
1783 1748 | vec![::aws_smithy_types::Document::from({
|
1784 1749 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
1785 1750 | out.insert("name".to_string(), "sigv4".to_string().into());
|
1786 1751 | out.insert("signingName".to_string(), "s3".to_string().into());
|
1787 1752 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
1788 1753 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1789 1754 | out
|
1790 1755 | })]
|
1791 1756 | )
|
1792 1757 | .build()
|
1793 1758 | );
|
1794 1759 | }
|
1795 1760 |
|
1796 1761 | /// virtual addressing, UseGlobalEndpoint and us-east-1 region uses the global endpoint
|
1797 1762 | #[test]
|
1798 - | fn test_64() {
|
1763 + | fn test_63() {
|
1799 1764 | let params = crate::config::endpoint::Params::builder()
|
1800 1765 | .region("us-east-1".to_string())
|
1801 1766 | .use_global_endpoint(true)
|
1802 1767 | .bucket("bucket-name".to_string())
|
1803 1768 | .use_fips(false)
|
1804 1769 | .use_dual_stack(false)
|
1805 1770 | .accelerate(false)
|
1806 1771 | .build()
|
1807 1772 | .expect("invalid params");
|
1808 1773 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
1809 1774 | let endpoint = resolver.resolve_endpoint(¶ms);
|
1810 1775 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3.amazonaws.com");
|
1811 1776 | assert_eq!(
|
1812 1777 | endpoint,
|
1813 1778 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
1814 1779 | .url("https://bucket-name.s3.amazonaws.com")
|
1815 1780 | .property(
|
1816 1781 | "authSchemes",
|
1817 1782 | vec![::aws_smithy_types::Document::from({
|
1818 1783 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
1819 1784 | out.insert("name".to_string(), "sigv4".to_string().into());
|
1820 1785 | out.insert("signingName".to_string(), "s3".to_string().into());
|
1821 1786 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
1822 1787 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1823 1788 | out
|
1824 1789 | })]
|
1825 1790 | )
|
1826 1791 | .build()
|
1827 1792 | );
|
1828 1793 | }
|
1829 1794 |
|
1830 1795 | /// virtual addressing, UseGlobalEndpoint and us-west-2 region uses the regional endpoint
|
1831 1796 | #[test]
|
1832 - | fn test_65() {
|
1797 + | fn test_64() {
|
1833 1798 | let params = crate::config::endpoint::Params::builder()
|
1834 1799 | .region("us-west-2".to_string())
|
1835 1800 | .use_global_endpoint(true)
|
1836 1801 | .bucket("bucket-name".to_string())
|
1837 1802 | .use_fips(false)
|
1838 1803 | .use_dual_stack(false)
|
1839 1804 | .accelerate(false)
|
1840 1805 | .build()
|
1841 1806 | .expect("invalid params");
|
1842 1807 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
1843 1808 | let endpoint = resolver.resolve_endpoint(¶ms);
|
1844 1809 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3.us-west-2.amazonaws.com");
|
1845 1810 | assert_eq!(
|
1846 1811 | endpoint,
|
1847 1812 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
1848 1813 | .url("https://bucket-name.s3.us-west-2.amazonaws.com")
|
1849 1814 | .property(
|
1850 1815 | "authSchemes",
|
1851 1816 | vec![::aws_smithy_types::Document::from({
|
1852 1817 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
1853 1818 | out.insert("name".to_string(), "sigv4".to_string().into());
|
1854 1819 | out.insert("signingName".to_string(), "s3".to_string().into());
|
1855 1820 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
1856 1821 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1857 1822 | out
|
1858 1823 | })]
|
1859 1824 | )
|
1860 1825 | .build()
|
1861 1826 | );
|
1862 1827 | }
|
1863 1828 |
|
1864 1829 | /// virtual addressing, UseGlobalEndpoint and us-east-1 region and fips uses the regional fips endpoint
|
1865 1830 | #[test]
|
1866 - | fn test_66() {
|
1831 + | fn test_65() {
|
1867 1832 | let params = crate::config::endpoint::Params::builder()
|
1868 1833 | .region("us-east-1".to_string())
|
1869 1834 | .use_global_endpoint(true)
|
1870 1835 | .bucket("bucket-name".to_string())
|
1871 1836 | .use_fips(true)
|
1872 1837 | .use_dual_stack(false)
|
1873 1838 | .accelerate(false)
|
1874 1839 | .build()
|
1875 1840 | .expect("invalid params");
|
1876 1841 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
1877 1842 | let endpoint = resolver.resolve_endpoint(¶ms);
|
1878 1843 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-fips.us-east-1.amazonaws.com");
|
1879 1844 | assert_eq!(
|
1880 1845 | endpoint,
|
1881 1846 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
1882 1847 | .url("https://bucket-name.s3-fips.us-east-1.amazonaws.com")
|
1883 1848 | .property(
|
1884 1849 | "authSchemes",
|
1885 1850 | vec![::aws_smithy_types::Document::from({
|
1886 1851 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
1887 1852 | out.insert("name".to_string(), "sigv4".to_string().into());
|
1888 1853 | out.insert("signingName".to_string(), "s3".to_string().into());
|
1889 1854 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
1890 1855 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1891 1856 | out
|
1892 1857 | })]
|
1893 1858 | )
|
1894 1859 | .build()
|
1895 1860 | );
|
1896 1861 | }
|
1897 1862 |
|
1898 1863 | /// virtual addressing, UseGlobalEndpoint and us-east-1 region and dualstack uses the regional dualstack endpoint
|
1899 1864 | #[test]
|
1900 - | fn test_67() {
|
1865 + | fn test_66() {
|
1901 1866 | let params = crate::config::endpoint::Params::builder()
|
1902 1867 | .region("us-east-1".to_string())
|
1903 1868 | .use_global_endpoint(true)
|
1904 1869 | .bucket("bucket-name".to_string())
|
1905 1870 | .use_fips(false)
|
1906 1871 | .use_dual_stack(true)
|
1907 1872 | .accelerate(false)
|
1908 1873 | .build()
|
1909 1874 | .expect("invalid params");
|
1910 1875 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
1911 1876 | let endpoint = resolver.resolve_endpoint(¶ms);
|
1912 1877 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3.dualstack.us-east-1.amazonaws.com");
|
1913 1878 | assert_eq!(
|
1914 1879 | endpoint,
|
1915 1880 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
1916 1881 | .url("https://bucket-name.s3.dualstack.us-east-1.amazonaws.com")
|
1917 1882 | .property(
|
1918 1883 | "authSchemes",
|
1919 1884 | vec![::aws_smithy_types::Document::from({
|
1920 1885 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
1921 1886 | out.insert("name".to_string(), "sigv4".to_string().into());
|
1922 1887 | out.insert("signingName".to_string(), "s3".to_string().into());
|
1923 1888 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
1924 1889 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1925 1890 | out
|
1926 1891 | })]
|
1927 1892 | )
|
1928 1893 | .build()
|
1929 1894 | );
|
1930 1895 | }
|
1931 1896 |
|
1932 1897 | /// virtual addressing, UseGlobalEndpoint and us-east-1 region and accelerate uses the global accelerate endpoint
|
1933 1898 | #[test]
|
1934 - | fn test_68() {
|
1899 + | fn test_67() {
|
1935 1900 | let params = crate::config::endpoint::Params::builder()
|
1936 1901 | .region("us-east-1".to_string())
|
1937 1902 | .use_global_endpoint(true)
|
1938 1903 | .bucket("bucket-name".to_string())
|
1939 1904 | .use_fips(false)
|
1940 1905 | .use_dual_stack(false)
|
1941 1906 | .accelerate(true)
|
1942 1907 | .build()
|
1943 1908 | .expect("invalid params");
|
1944 1909 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
1945 1910 | let endpoint = resolver.resolve_endpoint(¶ms);
|
1946 1911 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-accelerate.amazonaws.com");
|
1947 1912 | assert_eq!(
|
1948 1913 | endpoint,
|
1949 1914 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
1950 1915 | .url("https://bucket-name.s3-accelerate.amazonaws.com")
|
1951 1916 | .property(
|
1952 1917 | "authSchemes",
|
1953 1918 | vec![::aws_smithy_types::Document::from({
|
1954 1919 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
1955 1920 | out.insert("name".to_string(), "sigv4".to_string().into());
|
1956 1921 | out.insert("signingName".to_string(), "s3".to_string().into());
|
1957 1922 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
1958 1923 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1959 1924 | out
|
1960 1925 | })]
|
1961 1926 | )
|
1962 1927 | .build()
|
1963 1928 | );
|
1964 1929 | }
|
1965 1930 |
|
1966 1931 | /// virtual addressing, UseGlobalEndpoint and us-east-1 region with custom endpoint
|
1967 1932 | #[test]
|
1968 - | fn test_69() {
|
1933 + | fn test_68() {
|
1969 1934 | let params = crate::config::endpoint::Params::builder()
|
1970 1935 | .region("us-east-1".to_string())
|
1971 1936 | .endpoint("https://example.com".to_string())
|
1972 1937 | .use_global_endpoint(true)
|
1973 1938 | .bucket("bucket-name".to_string())
|
1974 1939 | .use_fips(false)
|
1975 1940 | .use_dual_stack(false)
|
1976 1941 | .accelerate(false)
|
1977 1942 | .build()
|
1978 1943 | .expect("invalid params");
|
1979 1944 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
1980 1945 | let endpoint = resolver.resolve_endpoint(¶ms);
|
1981 1946 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.example.com");
|
1982 1947 | assert_eq!(
|
1983 1948 | endpoint,
|
1984 1949 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
1985 1950 | .url("https://bucket-name.example.com")
|
1986 1951 | .property(
|
1987 1952 | "authSchemes",
|
1988 1953 | vec![::aws_smithy_types::Document::from({
|
1989 1954 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
1990 1955 | out.insert("name".to_string(), "sigv4".to_string().into());
|
1991 1956 | out.insert("signingName".to_string(), "s3".to_string().into());
|
1992 1957 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
1993 1958 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
1994 1959 | out
|
1995 1960 | })]
|
1996 1961 | )
|
1997 1962 | .build()
|
1998 1963 | );
|
1999 1964 | }
|
2000 1965 |
|
2001 1966 | /// ForcePathStyle, aws-global region uses the global endpoint
|
2002 1967 | #[test]
|
2003 - | fn test_70() {
|
1968 + | fn test_69() {
|
2004 1969 | let params = crate::config::endpoint::Params::builder()
|
2005 1970 | .region("aws-global".to_string())
|
2006 1971 | .bucket("bucket-name".to_string())
|
2007 1972 | .force_path_style(true)
|
2008 1973 | .use_fips(false)
|
2009 1974 | .use_dual_stack(false)
|
2010 1975 | .accelerate(false)
|
2011 1976 | .build()
|
2012 1977 | .expect("invalid params");
|
2013 1978 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2014 1979 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2015 1980 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.amazonaws.com/bucket-name");
|
2016 1981 | assert_eq!(
|
2017 1982 | endpoint,
|
2018 1983 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2019 1984 | .url("https://s3.amazonaws.com/bucket-name")
|
2020 1985 | .property(
|
2021 1986 | "authSchemes",
|
2022 1987 | vec![::aws_smithy_types::Document::from({
|
2023 1988 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2024 1989 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2025 1990 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2026 1991 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2027 1992 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2028 1993 | out
|
2029 1994 | })]
|
2030 1995 | )
|
2031 1996 | .build()
|
2032 1997 | );
|
2033 1998 | }
|
2034 1999 |
|
2035 2000 | /// ForcePathStyle, aws-global region with fips is invalid
|
2036 2001 | #[test]
|
2037 - | fn test_71() {
|
2002 + | fn test_70() {
|
2038 2003 | let params = crate::config::endpoint::Params::builder()
|
2039 2004 | .region("aws-global".to_string())
|
2040 2005 | .bucket("bucket-name".to_string())
|
2041 2006 | .force_path_style(true)
|
2042 2007 | .use_fips(true)
|
2043 2008 | .use_dual_stack(false)
|
2044 2009 | .accelerate(false)
|
2045 2010 | .build()
|
2046 2011 | .expect("invalid params");
|
2047 2012 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2048 2013 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2049 2014 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.us-east-1.amazonaws.com/bucket-name");
|
2050 2015 | assert_eq!(
|
2051 2016 | endpoint,
|
2052 2017 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2053 2018 | .url("https://s3-fips.us-east-1.amazonaws.com/bucket-name")
|
2054 2019 | .property(
|
2055 2020 | "authSchemes",
|
2056 2021 | vec![::aws_smithy_types::Document::from({
|
2057 2022 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2058 2023 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2059 2024 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2060 2025 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2061 2026 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2062 2027 | out
|
2063 2028 | })]
|
2064 2029 | )
|
2065 2030 | .build()
|
2066 2031 | );
|
2067 2032 | }
|
2068 2033 |
|
2069 2034 | /// ForcePathStyle, aws-global region with dualstack uses regional dualstack endpoint
|
2070 2035 | #[test]
|
2071 - | fn test_72() {
|
2036 + | fn test_71() {
|
2072 2037 | let params = crate::config::endpoint::Params::builder()
|
2073 2038 | .region("aws-global".to_string())
|
2074 2039 | .bucket("bucket-name".to_string())
|
2075 2040 | .force_path_style(true)
|
2076 2041 | .use_fips(false)
|
2077 2042 | .use_dual_stack(true)
|
2078 2043 | .accelerate(false)
|
2079 2044 | .build()
|
2080 2045 | .expect("invalid params");
|
2081 2046 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2082 2047 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2083 2048 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.dualstack.us-east-1.amazonaws.com/bucket-name");
|
2084 2049 | assert_eq!(
|
2085 2050 | endpoint,
|
2086 2051 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2087 2052 | .url("https://s3.dualstack.us-east-1.amazonaws.com/bucket-name")
|
2088 2053 | .property(
|
2089 2054 | "authSchemes",
|
2090 2055 | vec![::aws_smithy_types::Document::from({
|
2091 2056 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2092 2057 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2093 2058 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2094 2059 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2095 2060 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2096 2061 | out
|
2097 2062 | })]
|
2098 2063 | )
|
2099 2064 | .build()
|
2100 2065 | );
|
2101 2066 | }
|
2102 2067 |
|
2103 2068 | /// ForcePathStyle, aws-global region custom endpoint uses the custom endpoint
|
2104 2069 | #[test]
|
2105 - | fn test_73() {
|
2070 + | fn test_72() {
|
2106 2071 | let params = crate::config::endpoint::Params::builder()
|
2107 2072 | .region("aws-global".to_string())
|
2108 2073 | .endpoint("https://example.com".to_string())
|
2109 2074 | .bucket("bucket-name".to_string())
|
2110 2075 | .force_path_style(true)
|
2111 2076 | .use_fips(false)
|
2112 2077 | .use_dual_stack(false)
|
2113 2078 | .accelerate(false)
|
2114 2079 | .build()
|
2115 2080 | .expect("invalid params");
|
2116 2081 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2117 2082 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2118 2083 | let endpoint = endpoint.expect("Expected valid endpoint: https://example.com/bucket-name");
|
2119 2084 | assert_eq!(
|
2120 2085 | endpoint,
|
2121 2086 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2122 2087 | .url("https://example.com/bucket-name")
|
2123 2088 | .property(
|
2124 2089 | "authSchemes",
|
2125 2090 | vec![::aws_smithy_types::Document::from({
|
2126 2091 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2127 2092 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2128 2093 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2129 2094 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2130 2095 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2131 2096 | out
|
2132 2097 | })]
|
2133 2098 | )
|
2134 2099 | .build()
|
2135 2100 | );
|
2136 2101 | }
|
2137 2102 |
|
2138 2103 | /// ForcePathStyle, UseGlobalEndpoint us-east-1 region uses the global endpoint
|
2139 2104 | #[test]
|
2140 - | fn test_74() {
|
2105 + | fn test_73() {
|
2141 2106 | let params = crate::config::endpoint::Params::builder()
|
2142 2107 | .region("us-east-1".to_string())
|
2143 2108 | .bucket("bucket-name".to_string())
|
2144 2109 | .use_global_endpoint(true)
|
2145 2110 | .force_path_style(true)
|
2146 2111 | .use_fips(false)
|
2147 2112 | .use_dual_stack(false)
|
2148 2113 | .accelerate(false)
|
2149 2114 | .build()
|
2150 2115 | .expect("invalid params");
|
2151 2116 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2152 2117 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2153 2118 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.amazonaws.com/bucket-name");
|
2154 2119 | assert_eq!(
|
2155 2120 | endpoint,
|
2156 2121 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2157 2122 | .url("https://s3.amazonaws.com/bucket-name")
|
2158 2123 | .property(
|
2159 2124 | "authSchemes",
|
2160 2125 | vec![::aws_smithy_types::Document::from({
|
2161 2126 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2162 2127 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2163 2128 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2164 2129 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2165 2130 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2166 2131 | out
|
2167 2132 | })]
|
2168 2133 | )
|
2169 2134 | .build()
|
2170 2135 | );
|
2171 2136 | }
|
2172 2137 |
|
2173 2138 | /// ForcePathStyle, UseGlobalEndpoint us-west-2 region uses the regional endpoint
|
2174 2139 | #[test]
|
2175 - | fn test_75() {
|
2140 + | fn test_74() {
|
2176 2141 | let params = crate::config::endpoint::Params::builder()
|
2177 2142 | .region("us-west-2".to_string())
|
2178 2143 | .bucket("bucket-name".to_string())
|
2179 2144 | .use_global_endpoint(true)
|
2180 2145 | .force_path_style(true)
|
2181 2146 | .use_fips(false)
|
2182 2147 | .use_dual_stack(false)
|
2183 2148 | .accelerate(false)
|
2184 2149 | .build()
|
2185 2150 | .expect("invalid params");
|
2186 2151 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2187 2152 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2188 2153 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.us-west-2.amazonaws.com/bucket-name");
|
2189 2154 | assert_eq!(
|
2190 2155 | endpoint,
|
2191 2156 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2192 2157 | .url("https://s3.us-west-2.amazonaws.com/bucket-name")
|
2193 2158 | .property(
|
2194 2159 | "authSchemes",
|
2195 2160 | vec![::aws_smithy_types::Document::from({
|
2196 2161 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2197 2162 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2198 2163 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2199 2164 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
2200 2165 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2201 2166 | out
|
2202 2167 | })]
|
2203 2168 | )
|
2204 2169 | .build()
|
2205 2170 | );
|
2206 2171 | }
|
2207 2172 |
|
2208 2173 | /// ForcePathStyle, UseGlobalEndpoint us-east-1 region, dualstack uses the regional dualstack endpoint
|
2209 2174 | #[test]
|
2210 - | fn test_76() {
|
2175 + | fn test_75() {
|
2211 2176 | let params = crate::config::endpoint::Params::builder()
|
2212 2177 | .region("us-east-1".to_string())
|
2213 2178 | .bucket("bucket-name".to_string())
|
2214 2179 | .use_global_endpoint(true)
|
2215 2180 | .force_path_style(true)
|
2216 2181 | .use_fips(false)
|
2217 2182 | .use_dual_stack(true)
|
2218 2183 | .accelerate(false)
|
2219 2184 | .build()
|
2220 2185 | .expect("invalid params");
|
2221 2186 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2222 2187 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2223 2188 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.dualstack.us-east-1.amazonaws.com/bucket-name");
|
2224 2189 | assert_eq!(
|
2225 2190 | endpoint,
|
2226 2191 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2227 2192 | .url("https://s3.dualstack.us-east-1.amazonaws.com/bucket-name")
|
2228 2193 | .property(
|
2229 2194 | "authSchemes",
|
2230 2195 | vec![::aws_smithy_types::Document::from({
|
2231 2196 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2232 2197 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2233 2198 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2234 2199 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2235 2200 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2236 2201 | out
|
2237 2202 | })]
|
2238 2203 | )
|
2239 2204 | .build()
|
2240 2205 | );
|
2241 2206 | }
|
2242 2207 |
|
2243 2208 | /// ForcePathStyle, UseGlobalEndpoint us-east-1 region custom endpoint uses the custom endpoint
|
2244 2209 | #[test]
|
2245 - | fn test_77() {
|
2210 + | fn test_76() {
|
2246 2211 | let params = crate::config::endpoint::Params::builder()
|
2247 2212 | .region("us-east-1".to_string())
|
2248 2213 | .bucket("bucket-name".to_string())
|
2249 2214 | .endpoint("https://example.com".to_string())
|
2250 2215 | .use_global_endpoint(true)
|
2251 2216 | .force_path_style(true)
|
2252 2217 | .use_fips(false)
|
2253 2218 | .use_dual_stack(false)
|
2254 2219 | .accelerate(false)
|
2255 2220 | .build()
|
2256 2221 | .expect("invalid params");
|
2257 2222 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2258 2223 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2259 2224 | let endpoint = endpoint.expect("Expected valid endpoint: https://example.com/bucket-name");
|
2260 2225 | assert_eq!(
|
2261 2226 | endpoint,
|
2262 2227 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2263 2228 | .url("https://example.com/bucket-name")
|
2264 2229 | .property(
|
2265 2230 | "authSchemes",
|
2266 2231 | vec![::aws_smithy_types::Document::from({
|
2267 2232 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2268 2233 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2269 2234 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2270 2235 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2271 2236 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2272 2237 | out
|
2273 2238 | })]
|
2274 2239 | )
|
2275 2240 | .build()
|
2276 2241 | );
|
2277 2242 | }
|
2278 2243 |
|
2279 2244 | /// ARN with aws-global region and UseArnRegion uses the regional endpoint
|
2280 2245 | #[test]
|
2281 - | fn test_78() {
|
2246 + | fn test_77() {
|
2282 2247 | let params = crate::config::endpoint::Params::builder()
|
2283 2248 | .region("aws-global".to_string())
|
2284 2249 | .use_arn_region(true)
|
2285 2250 | .use_fips(false)
|
2286 2251 | .use_dual_stack(false)
|
2287 2252 | .accelerate(false)
|
2288 2253 | .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
|
2289 2254 | .build()
|
2290 2255 | .expect("invalid params");
|
2291 2256 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2292 2257 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2293 2258 | let endpoint =
|
2294 2259 | endpoint.expect("Expected valid endpoint: https://reports-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com");
|
2295 2260 | assert_eq!(
|
2296 2261 | endpoint,
|
2297 2262 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2298 2263 | .url("https://reports-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com")
|
2299 2264 | .property(
|
2300 2265 | "authSchemes",
|
2301 - | vec![
|
2302 - | ::aws_smithy_types::Document::from({
|
2303 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2304 - | out.insert("name".to_string(), "sigv4a".to_string().into());
|
2305 - | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
2306 - | out.insert(
|
2307 - | "signingRegionSet".to_string(),
|
2308 - | vec![::aws_smithy_types::Document::from("*".to_string())].into(),
|
2309 - | );
|
2310 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2311 - | out
|
2312 - | }),
|
2313 - | ::aws_smithy_types::Document::from({
|
2266 + | vec![::aws_smithy_types::Document::from({
|
2314 2267 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2315 2268 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2316 2269 | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
2317 2270 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2318 2271 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2319 2272 | out
|
2320 - | })
|
2321 - | ]
|
2273 + | })]
|
2322 2274 | )
|
2323 2275 | .build()
|
2324 2276 | );
|
2325 2277 | }
|
2326 2278 |
|
2327 2279 | /// cross partition MRAP ARN is an error
|
2328 2280 | #[test]
|
2329 - | fn test_79() {
|
2281 + | fn test_78() {
|
2330 2282 | let params = crate::config::endpoint::Params::builder()
|
2331 2283 | .bucket("arn:aws-cn:s3::123456789012:accesspoint:mfzwi23gnjvgw.mrap".to_string())
|
2332 2284 | .region("us-west-1".to_string())
|
2333 2285 | .build()
|
2334 2286 | .expect("invalid params");
|
2335 2287 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2336 2288 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2337 2289 | let error = endpoint.expect_err("expected error: Client was configured for partition `aws` but bucket referred to partition `aws-cn` [cross partition MRAP ARN is an error]");
|
2338 2290 | assert_eq!(
|
2339 2291 | format!("{}", error),
|
2340 2292 | "Client was configured for partition `aws` but bucket referred to partition `aws-cn`"
|
2341 2293 | )
|
2342 2294 | }
|
2343 2295 |
|
2344 2296 | /// Endpoint override, accesspoint with HTTP, port
|
2345 2297 | #[test]
|
2346 - | fn test_80() {
|
2298 + | fn test_79() {
|
2347 2299 | let params = crate::config::endpoint::Params::builder()
|
2348 2300 | .endpoint("http://beta.example.com:1234".to_string())
|
2349 2301 | .region("us-west-2".to_string())
|
2350 2302 | .bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
|
2351 2303 | .build()
|
2352 2304 | .expect("invalid params");
|
2353 2305 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2354 2306 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2355 2307 | let endpoint = endpoint.expect("Expected valid endpoint: http://myendpoint-123456789012.beta.example.com:1234");
|
2356 2308 | assert_eq!(
|
2357 2309 | endpoint,
|
2358 2310 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2359 2311 | .url("http://myendpoint-123456789012.beta.example.com:1234")
|
2360 2312 | .property(
|
2361 2313 | "authSchemes",
|
2362 2314 | vec![::aws_smithy_types::Document::from({
|
2363 2315 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2364 2316 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2365 2317 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2366 2318 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
2367 2319 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2368 2320 | out
|
2369 2321 | })]
|
2370 2322 | )
|
2371 2323 | .build()
|
2372 2324 | );
|
2373 2325 | }
|
2374 2326 |
|
2375 2327 | /// Endpoint override, accesspoint with http, path, query, and port
|
2376 2328 | #[test]
|
2377 - | fn test_81() {
|
2329 + | fn test_80() {
|
2378 2330 | let params = crate::config::endpoint::Params::builder()
|
2379 2331 | .region("us-west-2".to_string())
|
2380 2332 | .bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
|
2381 2333 | .endpoint("http://beta.example.com:1234/path".to_string())
|
2382 2334 | .use_fips(false)
|
2383 2335 | .use_dual_stack(false)
|
2384 2336 | .accelerate(false)
|
2385 2337 | .build()
|
2386 2338 | .expect("invalid params");
|
2387 2339 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2388 2340 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2389 2341 | let endpoint = endpoint.expect("Expected valid endpoint: http://myendpoint-123456789012.beta.example.com:1234/path");
|
2390 2342 | assert_eq!(
|
2391 2343 | endpoint,
|
2392 2344 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2393 2345 | .url("http://myendpoint-123456789012.beta.example.com:1234/path")
|
2394 2346 | .property(
|
2395 2347 | "authSchemes",
|
2396 2348 | vec![::aws_smithy_types::Document::from({
|
2397 2349 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2398 2350 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2399 2351 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2400 2352 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
2401 2353 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2402 2354 | out
|
2403 2355 | })]
|
2404 2356 | )
|
2405 2357 | .build()
|
2406 2358 | );
|
2407 2359 | }
|
2408 2360 |
|
2409 2361 | /// non-bucket endpoint override with FIPS = error
|
2410 2362 | #[test]
|
2411 - | fn test_82() {
|
2363 + | fn test_81() {
|
2412 2364 | let params = crate::config::endpoint::Params::builder()
|
2413 2365 | .region("us-west-2".to_string())
|
2414 2366 | .endpoint("http://beta.example.com:1234/path".to_string())
|
2415 2367 | .use_fips(true)
|
2416 2368 | .use_dual_stack(false)
|
2417 2369 | .build()
|
2418 2370 | .expect("invalid params");
|
2419 2371 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2420 2372 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2421 2373 | let error =
|
2422 2374 | endpoint.expect_err("expected error: A custom endpoint cannot be combined with FIPS [non-bucket endpoint override with FIPS = error]");
|
2423 2375 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with FIPS")
|
2424 2376 | }
|
2425 2377 |
|
2426 2378 | /// FIPS + dualstack + custom endpoint
|
2427 2379 | #[test]
|
2428 - | fn test_83() {
|
2380 + | fn test_82() {
|
2429 2381 | let params = crate::config::endpoint::Params::builder()
|
2430 2382 | .region("us-west-2".to_string())
|
2431 2383 | .endpoint("http://beta.example.com:1234/path".to_string())
|
2432 2384 | .use_fips(true)
|
2433 2385 | .use_dual_stack(true)
|
2434 2386 | .build()
|
2435 2387 | .expect("invalid params");
|
2436 2388 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2437 2389 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2438 2390 | let error =
|
2439 2391 | endpoint.expect_err("expected error: Cannot set dual-stack in combination with a custom endpoint. [FIPS + dualstack + custom endpoint]");
|
2440 2392 | assert_eq!(format!("{}", error), "Cannot set dual-stack in combination with a custom endpoint.")
|
2441 2393 | }
|
2442 2394 |
|
2443 2395 | /// dualstack + custom endpoint
|
2444 2396 | #[test]
|
2445 - | fn test_84() {
|
2397 + | fn test_83() {
|
2446 2398 | let params = crate::config::endpoint::Params::builder()
|
2447 2399 | .region("us-west-2".to_string())
|
2448 2400 | .endpoint("http://beta.example.com:1234/path".to_string())
|
2449 2401 | .use_fips(false)
|
2450 2402 | .use_dual_stack(true)
|
2451 2403 | .build()
|
2452 2404 | .expect("invalid params");
|
2453 2405 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2454 2406 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2455 2407 | let error = endpoint.expect_err("expected error: Cannot set dual-stack in combination with a custom endpoint. [dualstack + custom endpoint]");
|
2456 2408 | assert_eq!(format!("{}", error), "Cannot set dual-stack in combination with a custom endpoint.")
|
2457 2409 | }
|
2458 2410 |
|
2459 2411 | /// custom endpoint without FIPS/dualstack
|
2460 2412 | #[test]
|
2461 - | fn test_85() {
|
2413 + | fn test_84() {
|
2462 2414 | let params = crate::config::endpoint::Params::builder()
|
2463 2415 | .region("us-west-2".to_string())
|
2464 2416 | .endpoint("http://beta.example.com:1234/path".to_string())
|
2465 2417 | .use_fips(false)
|
2466 2418 | .use_dual_stack(false)
|
2467 2419 | .build()
|
2468 2420 | .expect("invalid params");
|
2469 2421 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2470 2422 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2471 2423 | let endpoint = endpoint.expect("Expected valid endpoint: http://beta.example.com:1234/path");
|
2472 2424 | assert_eq!(
|
2473 2425 | endpoint,
|
2474 2426 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2475 2427 | .url("http://beta.example.com:1234/path")
|
2476 2428 | .property(
|
2477 2429 | "authSchemes",
|
2478 2430 | vec![::aws_smithy_types::Document::from({
|
2479 2431 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2480 2432 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2481 2433 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2482 2434 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
2483 2435 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2484 2436 | out
|
2485 2437 | })]
|
2486 2438 | )
|
2487 2439 | .build()
|
2488 2440 | );
|
2489 2441 | }
|
2490 2442 |
|
2491 2443 | /// s3 object lambda with access points disabled
|
2492 2444 | #[test]
|
2493 - | fn test_86() {
|
2445 + | fn test_85() {
|
2494 2446 | let params = crate::config::endpoint::Params::builder()
|
2495 2447 | .region("us-west-2".to_string())
|
2496 2448 | .bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint:myendpoint".to_string())
|
2497 2449 | .disable_access_points(true)
|
2498 2450 | .build()
|
2499 2451 | .expect("invalid params");
|
2500 2452 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2501 2453 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2502 2454 | let error =
|
2503 2455 | endpoint.expect_err("expected error: Access points are not supported for this operation [s3 object lambda with access points disabled]");
|
2504 2456 | assert_eq!(format!("{}", error), "Access points are not supported for this operation")
|
2505 2457 | }
|
2506 2458 |
|
2507 2459 | /// non bucket + FIPS
|
2508 2460 | #[test]
|
2509 - | fn test_87() {
|
2461 + | fn test_86() {
|
2510 2462 | let params = crate::config::endpoint::Params::builder()
|
2511 2463 | .region("us-west-2".to_string())
|
2512 2464 | .use_fips(true)
|
2513 2465 | .use_dual_stack(false)
|
2514 2466 | .build()
|
2515 2467 | .expect("invalid params");
|
2516 2468 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2517 2469 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2518 2470 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.us-west-2.amazonaws.com");
|
2519 2471 | assert_eq!(
|
2520 2472 | endpoint,
|
2521 2473 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2522 2474 | .url("https://s3-fips.us-west-2.amazonaws.com")
|
2523 2475 | .property(
|
2524 2476 | "authSchemes",
|
2525 2477 | vec![::aws_smithy_types::Document::from({
|
2526 2478 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2527 2479 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2528 2480 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2529 2481 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
2530 2482 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2531 2483 | out
|
2532 2484 | })]
|
2533 2485 | )
|
2534 2486 | .build()
|
2535 2487 | );
|
2536 2488 | }
|
2537 2489 |
|
2538 2490 | /// standard non bucket endpoint
|
2539 2491 | #[test]
|
2540 - | fn test_88() {
|
2492 + | fn test_87() {
|
2541 2493 | let params = crate::config::endpoint::Params::builder()
|
2542 2494 | .region("us-west-2".to_string())
|
2543 2495 | .use_fips(false)
|
2544 2496 | .use_dual_stack(false)
|
2545 2497 | .build()
|
2546 2498 | .expect("invalid params");
|
2547 2499 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2548 2500 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2549 2501 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.us-west-2.amazonaws.com");
|
2550 2502 | assert_eq!(
|
2551 2503 | endpoint,
|
2552 2504 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2553 2505 | .url("https://s3.us-west-2.amazonaws.com")
|
2554 2506 | .property(
|
2555 2507 | "authSchemes",
|
2556 2508 | vec![::aws_smithy_types::Document::from({
|
2557 2509 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2558 2510 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2559 2511 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2560 2512 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
2561 2513 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2562 2514 | out
|
2563 2515 | })]
|
2564 2516 | )
|
2565 2517 | .build()
|
2566 2518 | );
|
2567 2519 | }
|
2568 2520 |
|
2569 2521 | /// non bucket endpoint with FIPS + Dualstack
|
2570 2522 | #[test]
|
2571 - | fn test_89() {
|
2523 + | fn test_88() {
|
2572 2524 | let params = crate::config::endpoint::Params::builder()
|
2573 2525 | .region("us-west-2".to_string())
|
2574 2526 | .use_fips(true)
|
2575 2527 | .use_dual_stack(true)
|
2576 2528 | .build()
|
2577 2529 | .expect("invalid params");
|
2578 2530 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2579 2531 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2580 2532 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.dualstack.us-west-2.amazonaws.com");
|
2581 2533 | assert_eq!(
|
2582 2534 | endpoint,
|
2583 2535 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2584 2536 | .url("https://s3-fips.dualstack.us-west-2.amazonaws.com")
|
2585 2537 | .property(
|
2586 2538 | "authSchemes",
|
2587 2539 | vec![::aws_smithy_types::Document::from({
|
2588 2540 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2589 2541 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2590 2542 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2591 2543 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
2592 2544 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2593 2545 | out
|
2594 2546 | })]
|
2595 2547 | )
|
2596 2548 | .build()
|
2597 2549 | );
|
2598 2550 | }
|
2599 2551 |
|
2600 2552 | /// non bucket endpoint with dualstack
|
2601 2553 | #[test]
|
2602 - | fn test_90() {
|
2554 + | fn test_89() {
|
2603 2555 | let params = crate::config::endpoint::Params::builder()
|
2604 2556 | .region("us-west-2".to_string())
|
2605 2557 | .use_fips(false)
|
2606 2558 | .use_dual_stack(true)
|
2607 2559 | .build()
|
2608 2560 | .expect("invalid params");
|
2609 2561 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2610 2562 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2611 2563 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.dualstack.us-west-2.amazonaws.com");
|
2612 2564 | assert_eq!(
|
2613 2565 | endpoint,
|
2614 2566 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2615 2567 | .url("https://s3.dualstack.us-west-2.amazonaws.com")
|
2616 2568 | .property(
|
2617 2569 | "authSchemes",
|
2618 2570 | vec![::aws_smithy_types::Document::from({
|
2619 2571 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2620 2572 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2621 2573 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2622 2574 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
2623 2575 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2624 2576 | out
|
2625 2577 | })]
|
2626 2578 | )
|
2627 2579 | .build()
|
2628 2580 | );
|
2629 2581 | }
|
2630 2582 |
|
2631 2583 | /// use global endpoint + IP address endpoint override
|
2632 2584 | #[test]
|
2633 - | fn test_91() {
|
2585 + | fn test_90() {
|
2634 2586 | let params = crate::config::endpoint::Params::builder()
|
2635 2587 | .region("us-east-1".to_string())
|
2636 2588 | .bucket("bucket".to_string())
|
2637 2589 | .use_fips(false)
|
2638 2590 | .use_dual_stack(false)
|
2639 2591 | .endpoint("http://127.0.0.1".to_string())
|
2640 2592 | .use_global_endpoint(true)
|
2641 2593 | .build()
|
2642 2594 | .expect("invalid params");
|
2643 2595 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2644 2596 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2645 2597 | let endpoint = endpoint.expect("Expected valid endpoint: http://127.0.0.1/bucket");
|
2646 2598 | assert_eq!(
|
2647 2599 | endpoint,
|
2648 2600 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2649 2601 | .url("http://127.0.0.1/bucket")
|
2650 2602 | .property(
|
2651 2603 | "authSchemes",
|
2652 2604 | vec![::aws_smithy_types::Document::from({
|
2653 2605 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2654 2606 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2655 2607 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2656 2608 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2657 2609 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2658 2610 | out
|
2659 2611 | })]
|
2660 2612 | )
|
2661 2613 | .build()
|
2662 2614 | );
|
2663 2615 | }
|
2664 2616 |
|
2665 2617 | /// non-dns endpoint + global endpoint
|
2666 2618 | #[test]
|
2667 - | fn test_92() {
|
2619 + | fn test_91() {
|
2668 2620 | let params = crate::config::endpoint::Params::builder()
|
2669 2621 | .region("us-east-1".to_string())
|
2670 2622 | .bucket("bucket!".to_string())
|
2671 2623 | .use_fips(false)
|
2672 2624 | .use_dual_stack(false)
|
2673 2625 | .use_global_endpoint(true)
|
2674 2626 | .build()
|
2675 2627 | .expect("invalid params");
|
2676 2628 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2677 2629 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2678 2630 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.amazonaws.com/bucket%21");
|
2679 2631 | assert_eq!(
|
2680 2632 | endpoint,
|
2681 2633 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2682 2634 | .url("https://s3.amazonaws.com/bucket%21")
|
2683 2635 | .property(
|
2684 2636 | "authSchemes",
|
2685 2637 | vec![::aws_smithy_types::Document::from({
|
2686 2638 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2687 2639 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2688 2640 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2689 2641 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2690 2642 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2691 2643 | out
|
2692 2644 | })]
|
2693 2645 | )
|
2694 2646 | .build()
|
2695 2647 | );
|
2696 2648 | }
|
2697 2649 |
|
2698 2650 | /// endpoint override + use global endpoint
|
2699 2651 | #[test]
|
2700 - | fn test_93() {
|
2652 + | fn test_92() {
|
2701 2653 | let params = crate::config::endpoint::Params::builder()
|
2702 2654 | .region("us-east-1".to_string())
|
2703 2655 | .bucket("bucket!".to_string())
|
2704 2656 | .use_fips(false)
|
2705 2657 | .use_dual_stack(false)
|
2706 2658 | .use_global_endpoint(true)
|
2707 2659 | .endpoint("http://foo.com".to_string())
|
2708 2660 | .build()
|
2709 2661 | .expect("invalid params");
|
2710 2662 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2711 2663 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2712 2664 | let endpoint = endpoint.expect("Expected valid endpoint: http://foo.com/bucket%21");
|
2713 2665 | assert_eq!(
|
2714 2666 | endpoint,
|
2715 2667 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2716 2668 | .url("http://foo.com/bucket%21")
|
2717 2669 | .property(
|
2718 2670 | "authSchemes",
|
2719 2671 | vec![::aws_smithy_types::Document::from({
|
2720 2672 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2721 2673 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2722 2674 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2723 2675 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2724 2676 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2725 2677 | out
|
2726 2678 | })]
|
2727 2679 | )
|
2728 2680 | .build()
|
2729 2681 | );
|
2730 2682 | }
|
2731 2683 |
|
2732 2684 | /// FIPS + dualstack + non-bucket endpoint
|
2733 2685 | #[test]
|
2734 - | fn test_94() {
|
2686 + | fn test_93() {
|
2735 2687 | let params = crate::config::endpoint::Params::builder()
|
2736 2688 | .region("us-east-1".to_string())
|
2737 2689 | .bucket("bucket!".to_string())
|
2738 2690 | .use_fips(true)
|
2739 2691 | .use_dual_stack(true)
|
2740 2692 | .build()
|
2741 2693 | .expect("invalid params");
|
2742 2694 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2743 2695 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2744 2696 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.dualstack.us-east-1.amazonaws.com/bucket%21");
|
2745 2697 | assert_eq!(
|
2746 2698 | endpoint,
|
2747 2699 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2748 2700 | .url("https://s3-fips.dualstack.us-east-1.amazonaws.com/bucket%21")
|
2749 2701 | .property(
|
2750 2702 | "authSchemes",
|
2751 2703 | vec![::aws_smithy_types::Document::from({
|
2752 2704 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2753 2705 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2754 2706 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2755 2707 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2756 2708 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2757 2709 | out
|
2758 2710 | })]
|
2759 2711 | )
|
2760 2712 | .build()
|
2761 2713 | );
|
2762 2714 | }
|
2763 2715 |
|
2764 2716 | /// FIPS + dualstack + non-DNS endpoint
|
2765 2717 | #[test]
|
2766 - | fn test_95() {
|
2718 + | fn test_94() {
|
2767 2719 | let params = crate::config::endpoint::Params::builder()
|
2768 2720 | .region("us-east-1".to_string())
|
2769 2721 | .bucket("bucket!".to_string())
|
2770 2722 | .force_path_style(true)
|
2771 2723 | .use_fips(true)
|
2772 2724 | .use_dual_stack(true)
|
2773 2725 | .build()
|
2774 2726 | .expect("invalid params");
|
2775 2727 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2776 2728 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2777 2729 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.dualstack.us-east-1.amazonaws.com/bucket%21");
|
2778 2730 | assert_eq!(
|
2779 2731 | endpoint,
|
2780 2732 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2781 2733 | .url("https://s3-fips.dualstack.us-east-1.amazonaws.com/bucket%21")
|
2782 2734 | .property(
|
2783 2735 | "authSchemes",
|
2784 2736 | vec![::aws_smithy_types::Document::from({
|
2785 2737 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2786 2738 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2787 2739 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2788 2740 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2789 2741 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2790 2742 | out
|
2791 2743 | })]
|
2792 2744 | )
|
2793 2745 | .build()
|
2794 2746 | );
|
2795 2747 | }
|
2796 2748 |
|
2797 2749 | /// endpoint override + FIPS + dualstack (BUG)
|
2798 2750 | #[test]
|
2799 - | fn test_96() {
|
2751 + | fn test_95() {
|
2800 2752 | let params = crate::config::endpoint::Params::builder()
|
2801 2753 | .region("us-east-1".to_string())
|
2802 2754 | .bucket("bucket!".to_string())
|
2803 2755 | .force_path_style(true)
|
2804 2756 | .use_fips(true)
|
2805 2757 | .use_dual_stack(false)
|
2806 2758 | .endpoint("http://foo.com".to_string())
|
2807 2759 | .build()
|
2808 2760 | .expect("invalid params");
|
2809 2761 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2810 2762 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2811 2763 | let error =
|
2812 2764 | endpoint.expect_err("expected error: A custom endpoint cannot be combined with FIPS [endpoint override + FIPS + dualstack (BUG)]");
|
2813 2765 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with FIPS")
|
2814 2766 | }
|
2815 2767 |
|
2816 2768 | /// endpoint override + non-dns bucket + FIPS (BUG)
|
2817 2769 | #[test]
|
2818 - | fn test_97() {
|
2770 + | fn test_96() {
|
2819 2771 | let params = crate::config::endpoint::Params::builder()
|
2820 2772 | .region("us-east-1".to_string())
|
2821 2773 | .bucket("bucket!".to_string())
|
2822 2774 | .use_fips(true)
|
2823 2775 | .use_dual_stack(false)
|
2824 2776 | .endpoint("http://foo.com".to_string())
|
2825 2777 | .build()
|
2826 2778 | .expect("invalid params");
|
2827 2779 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2828 2780 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2829 2781 | let error =
|
2830 2782 | endpoint.expect_err("expected error: A custom endpoint cannot be combined with FIPS [endpoint override + non-dns bucket + FIPS (BUG)]");
|
2831 2783 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with FIPS")
|
2832 2784 | }
|
2833 2785 |
|
2834 2786 | /// FIPS + bucket endpoint + force path style
|
2835 2787 | #[test]
|
2836 - | fn test_98() {
|
2788 + | fn test_97() {
|
2837 2789 | let params = crate::config::endpoint::Params::builder()
|
2838 2790 | .region("us-east-1".to_string())
|
2839 2791 | .bucket("bucket!".to_string())
|
2840 2792 | .force_path_style(true)
|
2841 2793 | .use_fips(true)
|
2842 2794 | .use_dual_stack(false)
|
2843 2795 | .use_global_endpoint(true)
|
2844 2796 | .build()
|
2845 2797 | .expect("invalid params");
|
2846 2798 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2847 2799 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2848 2800 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.us-east-1.amazonaws.com/bucket%21");
|
2849 2801 | assert_eq!(
|
2850 2802 | endpoint,
|
2851 2803 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2852 2804 | .url("https://s3-fips.us-east-1.amazonaws.com/bucket%21")
|
2853 2805 | .property(
|
2854 2806 | "authSchemes",
|
2855 2807 | vec![::aws_smithy_types::Document::from({
|
2856 2808 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2857 2809 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2858 2810 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2859 2811 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2860 2812 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2861 2813 | out
|
2862 2814 | })]
|
2863 2815 | )
|
2864 2816 | .build()
|
2865 2817 | );
|
2866 2818 | }
|
2867 2819 |
|
2868 2820 | /// bucket + FIPS + force path style
|
2869 2821 | #[test]
|
2870 - | fn test_99() {
|
2822 + | fn test_98() {
|
2871 2823 | let params = crate::config::endpoint::Params::builder()
|
2872 2824 | .region("us-east-1".to_string())
|
2873 2825 | .bucket("bucket".to_string())
|
2874 2826 | .force_path_style(true)
|
2875 2827 | .use_fips(true)
|
2876 2828 | .use_dual_stack(true)
|
2877 2829 | .use_global_endpoint(true)
|
2878 2830 | .build()
|
2879 2831 | .expect("invalid params");
|
2880 2832 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2881 2833 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2882 2834 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.dualstack.us-east-1.amazonaws.com/bucket");
|
2883 2835 | assert_eq!(
|
2884 2836 | endpoint,
|
2885 2837 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2886 2838 | .url("https://s3-fips.dualstack.us-east-1.amazonaws.com/bucket")
|
2887 2839 | .property(
|
2888 2840 | "authSchemes",
|
2889 2841 | vec![::aws_smithy_types::Document::from({
|
2890 2842 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2891 2843 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2892 2844 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2893 2845 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2894 2846 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2895 2847 | out
|
2896 2848 | })]
|
2897 2849 | )
|
2898 2850 | .build()
|
2899 2851 | );
|
2900 2852 | }
|
2901 2853 |
|
2902 2854 | /// FIPS + dualstack + use global endpoint
|
2903 2855 | #[test]
|
2904 - | fn test_100() {
|
2856 + | fn test_99() {
|
2905 2857 | let params = crate::config::endpoint::Params::builder()
|
2906 2858 | .region("us-east-1".to_string())
|
2907 2859 | .bucket("bucket".to_string())
|
2908 2860 | .use_fips(true)
|
2909 2861 | .use_dual_stack(true)
|
2910 2862 | .use_global_endpoint(true)
|
2911 2863 | .build()
|
2912 2864 | .expect("invalid params");
|
2913 2865 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2914 2866 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2915 2867 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket.s3-fips.dualstack.us-east-1.amazonaws.com");
|
2916 2868 | assert_eq!(
|
2917 2869 | endpoint,
|
2918 2870 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2919 2871 | .url("https://bucket.s3-fips.dualstack.us-east-1.amazonaws.com")
|
2920 2872 | .property(
|
2921 2873 | "authSchemes",
|
2922 2874 | vec![::aws_smithy_types::Document::from({
|
2923 2875 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2924 2876 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2925 2877 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2926 2878 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2927 2879 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2928 2880 | out
|
2929 2881 | })]
|
2930 2882 | )
|
2931 2883 | .build()
|
2932 2884 | );
|
2933 2885 | }
|
2934 2886 |
|
2935 2887 | /// URI encoded bucket + use global endpoint
|
2936 2888 | #[test]
|
2937 - | fn test_101() {
|
2889 + | fn test_100() {
|
2938 2890 | let params = crate::config::endpoint::Params::builder()
|
2939 2891 | .region("us-east-1".to_string())
|
2940 2892 | .bucket("bucket!".to_string())
|
2941 2893 | .use_fips(true)
|
2942 2894 | .use_dual_stack(false)
|
2943 2895 | .use_global_endpoint(true)
|
2944 2896 | .endpoint("https://foo.com".to_string())
|
2945 2897 | .build()
|
2946 2898 | .expect("invalid params");
|
2947 2899 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2948 2900 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2949 2901 | let error = endpoint.expect_err("expected error: A custom endpoint cannot be combined with FIPS [URI encoded bucket + use global endpoint]");
|
2950 2902 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with FIPS")
|
2951 2903 | }
|
2952 2904 |
|
2953 2905 | /// FIPS + path based endpoint
|
2954 2906 | #[test]
|
2955 - | fn test_102() {
|
2907 + | fn test_101() {
|
2956 2908 | let params = crate::config::endpoint::Params::builder()
|
2957 2909 | .region("us-east-1".to_string())
|
2958 2910 | .bucket("bucket!".to_string())
|
2959 2911 | .use_fips(true)
|
2960 2912 | .use_dual_stack(false)
|
2961 2913 | .accelerate(false)
|
2962 2914 | .use_global_endpoint(true)
|
2963 2915 | .build()
|
2964 2916 | .expect("invalid params");
|
2965 2917 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
2966 2918 | let endpoint = resolver.resolve_endpoint(¶ms);
|
2967 2919 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.us-east-1.amazonaws.com/bucket%21");
|
2968 2920 | assert_eq!(
|
2969 2921 | endpoint,
|
2970 2922 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
2971 2923 | .url("https://s3-fips.us-east-1.amazonaws.com/bucket%21")
|
2972 2924 | .property(
|
2973 2925 | "authSchemes",
|
2974 2926 | vec![::aws_smithy_types::Document::from({
|
2975 2927 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
2976 2928 | out.insert("name".to_string(), "sigv4".to_string().into());
|
2977 2929 | out.insert("signingName".to_string(), "s3".to_string().into());
|
2978 2930 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
2979 2931 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
2980 2932 | out
|
2981 2933 | })]
|
2982 2934 | )
|
2983 2935 | .build()
|
2984 2936 | );
|
2985 2937 | }
|
2986 2938 |
|
2987 2939 | /// accelerate + dualstack + global endpoint
|
2988 2940 | #[test]
|
2989 - | fn test_103() {
|
2941 + | fn test_102() {
|
2990 2942 | let params = crate::config::endpoint::Params::builder()
|
2991 2943 | .region("us-east-1".to_string())
|
2992 2944 | .bucket("bucket".to_string())
|
2993 2945 | .use_fips(false)
|
2994 2946 | .use_dual_stack(true)
|
2995 2947 | .accelerate(true)
|
2996 2948 | .use_global_endpoint(true)
|
2997 2949 | .build()
|
2998 2950 | .expect("invalid params");
|
2999 2951 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3000 2952 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3001 2953 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket.s3-accelerate.dualstack.amazonaws.com");
|
3002 2954 | assert_eq!(
|
3003 2955 | endpoint,
|
3004 2956 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3005 2957 | .url("https://bucket.s3-accelerate.dualstack.amazonaws.com")
|
3006 2958 | .property(
|
3007 2959 | "authSchemes",
|
3008 2960 | vec![::aws_smithy_types::Document::from({
|
3009 2961 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3010 2962 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3011 2963 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3012 2964 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3013 2965 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3014 2966 | out
|
3015 2967 | })]
|
3016 2968 | )
|
3017 2969 | .build()
|
3018 2970 | );
|
3019 2971 | }
|
3020 2972 |
|
3021 2973 | /// dualstack + global endpoint + non URI safe bucket
|
3022 2974 | #[test]
|
3023 - | fn test_104() {
|
2975 + | fn test_103() {
|
3024 2976 | let params = crate::config::endpoint::Params::builder()
|
3025 2977 | .region("us-east-1".to_string())
|
3026 2978 | .bucket("bucket!".to_string())
|
3027 2979 | .accelerate(false)
|
3028 2980 | .use_dual_stack(true)
|
3029 2981 | .use_fips(false)
|
3030 2982 | .use_global_endpoint(true)
|
3031 2983 | .build()
|
3032 2984 | .expect("invalid params");
|
3033 2985 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3034 2986 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3035 2987 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.dualstack.us-east-1.amazonaws.com/bucket%21");
|
3036 2988 | assert_eq!(
|
3037 2989 | endpoint,
|
3038 2990 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3039 2991 | .url("https://s3.dualstack.us-east-1.amazonaws.com/bucket%21")
|
3040 2992 | .property(
|
3041 2993 | "authSchemes",
|
3042 2994 | vec![::aws_smithy_types::Document::from({
|
3043 2995 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3044 2996 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3045 2997 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3046 2998 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3047 2999 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3048 3000 | out
|
3049 3001 | })]
|
3050 3002 | )
|
3051 3003 | .build()
|
3052 3004 | );
|
3053 3005 | }
|
3054 3006 |
|
3055 3007 | /// FIPS + uri encoded bucket
|
3056 3008 | #[test]
|
3057 - | fn test_105() {
|
3009 + | fn test_104() {
|
3058 3010 | let params = crate::config::endpoint::Params::builder()
|
3059 3011 | .region("us-east-1".to_string())
|
3060 3012 | .bucket("bucket!".to_string())
|
3061 3013 | .force_path_style(true)
|
3062 3014 | .accelerate(false)
|
3063 3015 | .use_dual_stack(false)
|
3064 3016 | .use_fips(true)
|
3065 3017 | .use_global_endpoint(true)
|
3066 3018 | .build()
|
3067 3019 | .expect("invalid params");
|
3068 3020 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3069 3021 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3070 3022 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.us-east-1.amazonaws.com/bucket%21");
|
3071 3023 | assert_eq!(
|
3072 3024 | endpoint,
|
3073 3025 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3074 3026 | .url("https://s3-fips.us-east-1.amazonaws.com/bucket%21")
|
3075 3027 | .property(
|
3076 3028 | "authSchemes",
|
3077 3029 | vec![::aws_smithy_types::Document::from({
|
3078 3030 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3079 3031 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3080 3032 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3081 3033 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3082 3034 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3083 3035 | out
|
3084 3036 | })]
|
3085 3037 | )
|
3086 3038 | .build()
|
3087 3039 | );
|
3088 3040 | }
|
3089 3041 |
|
3090 3042 | /// endpoint override + non-uri safe endpoint + force path style
|
3091 3043 | #[test]
|
3092 - | fn test_106() {
|
3044 + | fn test_105() {
|
3093 3045 | let params = crate::config::endpoint::Params::builder()
|
3094 3046 | .region("us-east-1".to_string())
|
3095 3047 | .bucket("bucket!".to_string())
|
3096 3048 | .force_path_style(true)
|
3097 3049 | .accelerate(false)
|
3098 3050 | .use_dual_stack(false)
|
3099 3051 | .use_fips(true)
|
3100 3052 | .endpoint("http://foo.com".to_string())
|
3101 3053 | .use_global_endpoint(true)
|
3102 3054 | .build()
|
3103 3055 | .expect("invalid params");
|
3104 3056 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3105 3057 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3106 3058 | let error = endpoint.expect_err(
|
3107 3059 | "expected error: A custom endpoint cannot be combined with FIPS [endpoint override + non-uri safe endpoint + force path style]",
|
3108 3060 | );
|
3109 3061 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with FIPS")
|
3110 3062 | }
|
3111 3063 |
|
3112 3064 | /// FIPS + Dualstack + global endpoint + non-dns bucket
|
3113 3065 | #[test]
|
3114 - | fn test_107() {
|
3066 + | fn test_106() {
|
3115 3067 | let params = crate::config::endpoint::Params::builder()
|
3116 3068 | .region("us-east-1".to_string())
|
3117 3069 | .bucket("bucket!".to_string())
|
3118 3070 | .accelerate(false)
|
3119 3071 | .use_dual_stack(true)
|
3120 3072 | .use_fips(true)
|
3121 3073 | .use_global_endpoint(true)
|
3122 3074 | .build()
|
3123 3075 | .expect("invalid params");
|
3124 3076 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3125 3077 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3126 3078 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.dualstack.us-east-1.amazonaws.com/bucket%21");
|
3127 3079 | assert_eq!(
|
3128 3080 | endpoint,
|
3129 3081 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3130 3082 | .url("https://s3-fips.dualstack.us-east-1.amazonaws.com/bucket%21")
|
3131 3083 | .property(
|
3132 3084 | "authSchemes",
|
3133 3085 | vec![::aws_smithy_types::Document::from({
|
3134 3086 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3135 3087 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3136 3088 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3137 3089 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3138 3090 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3139 3091 | out
|
3140 3092 | })]
|
3141 3093 | )
|
3142 3094 | .build()
|
3143 3095 | );
|
3144 3096 | }
|
3145 3097 |
|
3146 3098 | /// endpoint override + FIPS + dualstack
|
3147 3099 | #[test]
|
3148 - | fn test_108() {
|
3100 + | fn test_107() {
|
3149 3101 | let params = crate::config::endpoint::Params::builder()
|
3150 3102 | .region("us-east-1".to_string())
|
3151 3103 | .use_dual_stack(true)
|
3152 3104 | .use_fips(true)
|
3153 3105 | .use_global_endpoint(true)
|
3154 3106 | .endpoint("http://foo.com".to_string())
|
3155 3107 | .build()
|
3156 3108 | .expect("invalid params");
|
3157 3109 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3158 3110 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3159 3111 | let error = endpoint
|
3160 3112 | .expect_err("expected error: Cannot set dual-stack in combination with a custom endpoint. [endpoint override + FIPS + dualstack]");
|
3161 3113 | assert_eq!(format!("{}", error), "Cannot set dual-stack in combination with a custom endpoint.")
|
3162 3114 | }
|
3163 3115 |
|
3164 3116 | /// non-bucket endpoint override + dualstack + global endpoint
|
3165 3117 | #[test]
|
3166 - | fn test_109() {
|
3118 + | fn test_108() {
|
3167 3119 | let params = crate::config::endpoint::Params::builder()
|
3168 3120 | .region("us-east-1".to_string())
|
3169 3121 | .use_fips(false)
|
3170 3122 | .use_dual_stack(true)
|
3171 3123 | .use_global_endpoint(true)
|
3172 3124 | .endpoint("http://foo.com".to_string())
|
3173 3125 | .build()
|
3174 3126 | .expect("invalid params");
|
3175 3127 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3176 3128 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3177 3129 | let error = endpoint.expect_err("expected error: Cannot set dual-stack in combination with a custom endpoint. [non-bucket endpoint override + dualstack + global endpoint]");
|
3178 3130 | assert_eq!(format!("{}", error), "Cannot set dual-stack in combination with a custom endpoint.")
|
3179 3131 | }
|
3180 3132 |
|
3181 3133 | /// Endpoint override + UseGlobalEndpoint + us-east-1
|
3182 3134 | #[test]
|
3183 - | fn test_110() {
|
3135 + | fn test_109() {
|
3184 3136 | let params = crate::config::endpoint::Params::builder()
|
3185 3137 | .region("us-east-1".to_string())
|
3186 3138 | .use_fips(true)
|
3187 3139 | .use_dual_stack(false)
|
3188 3140 | .use_global_endpoint(true)
|
3189 3141 | .endpoint("http://foo.com".to_string())
|
3190 3142 | .build()
|
3191 3143 | .expect("invalid params");
|
3192 3144 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3193 3145 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3194 3146 | let error =
|
3195 3147 | endpoint.expect_err("expected error: A custom endpoint cannot be combined with FIPS [Endpoint override + UseGlobalEndpoint + us-east-1]");
|
3196 3148 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with FIPS")
|
3197 3149 | }
|
3198 3150 |
|
3199 3151 | /// non-FIPS partition with FIPS set + custom endpoint
|
3200 3152 | #[test]
|
3201 - | fn test_111() {
|
3153 + | fn test_110() {
|
3202 3154 | let params = crate::config::endpoint::Params::builder()
|
3203 3155 | .region("cn-north-1".to_string())
|
3204 3156 | .use_fips(true)
|
3205 3157 | .use_dual_stack(false)
|
3206 3158 | .use_global_endpoint(true)
|
3207 3159 | .build()
|
3208 3160 | .expect("invalid params");
|
3209 3161 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3210 3162 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3211 3163 | let error = endpoint.expect_err("expected error: Partition does not support FIPS [non-FIPS partition with FIPS set + custom endpoint]");
|
3212 3164 | assert_eq!(format!("{}", error), "Partition does not support FIPS")
|
3213 3165 | }
|
3214 3166 |
|
3215 3167 | /// aws-global signs as us-east-1
|
3216 3168 | #[test]
|
3217 - | fn test_112() {
|
3169 + | fn test_111() {
|
3218 3170 | let params = crate::config::endpoint::Params::builder()
|
3219 3171 | .region("aws-global".to_string())
|
3220 3172 | .bucket("bucket!".to_string())
|
3221 3173 | .use_fips(true)
|
3222 3174 | .accelerate(false)
|
3223 3175 | .use_dual_stack(true)
|
3224 3176 | .build()
|
3225 3177 | .expect("invalid params");
|
3226 3178 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3227 3179 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3228 3180 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.dualstack.us-east-1.amazonaws.com/bucket%21");
|
3229 3181 | assert_eq!(
|
3230 3182 | endpoint,
|
3231 3183 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3232 3184 | .url("https://s3-fips.dualstack.us-east-1.amazonaws.com/bucket%21")
|
3233 3185 | .property(
|
3234 3186 | "authSchemes",
|
3235 3187 | vec![::aws_smithy_types::Document::from({
|
3236 3188 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3237 3189 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3238 3190 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3239 3191 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3240 3192 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3241 3193 | out
|
3242 3194 | })]
|
3243 3195 | )
|
3244 3196 | .build()
|
3245 3197 | );
|
3246 3198 | }
|
3247 3199 |
|
3248 3200 | /// aws-global signs as us-east-1
|
3249 3201 | #[test]
|
3250 - | fn test_113() {
|
3202 + | fn test_112() {
|
3251 3203 | let params = crate::config::endpoint::Params::builder()
|
3252 3204 | .region("aws-global".to_string())
|
3253 3205 | .bucket("bucket".to_string())
|
3254 3206 | .use_dual_stack(false)
|
3255 3207 | .use_fips(false)
|
3256 3208 | .accelerate(false)
|
3257 3209 | .endpoint("https://foo.com".to_string())
|
3258 3210 | .build()
|
3259 3211 | .expect("invalid params");
|
3260 3212 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3261 3213 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3262 3214 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket.foo.com");
|
3263 3215 | assert_eq!(
|
3264 3216 | endpoint,
|
3265 3217 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3266 3218 | .url("https://bucket.foo.com")
|
3267 3219 | .property(
|
3268 3220 | "authSchemes",
|
3269 3221 | vec![::aws_smithy_types::Document::from({
|
3270 3222 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3271 3223 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3272 3224 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3273 3225 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3274 3226 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3275 3227 | out
|
3276 3228 | })]
|
3277 3229 | )
|
3278 3230 | .build()
|
3279 3231 | );
|
3280 3232 | }
|
3281 3233 |
|
3282 3234 | /// aws-global + dualstack + path-only bucket
|
3283 3235 | #[test]
|
3284 - | fn test_114() {
|
3236 + | fn test_113() {
|
3285 3237 | let params = crate::config::endpoint::Params::builder()
|
3286 3238 | .region("aws-global".to_string())
|
3287 3239 | .bucket("bucket!".to_string())
|
3288 3240 | .use_dual_stack(true)
|
3289 3241 | .use_fips(false)
|
3290 3242 | .accelerate(false)
|
3291 3243 | .build()
|
3292 3244 | .expect("invalid params");
|
3293 3245 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3294 3246 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3295 3247 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.dualstack.us-east-1.amazonaws.com/bucket%21");
|
3296 3248 | assert_eq!(
|
3297 3249 | endpoint,
|
3298 3250 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3299 3251 | .url("https://s3.dualstack.us-east-1.amazonaws.com/bucket%21")
|
3300 3252 | .property(
|
3301 3253 | "authSchemes",
|
3302 3254 | vec![::aws_smithy_types::Document::from({
|
3303 3255 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3304 3256 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3305 3257 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3306 3258 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3307 3259 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3308 3260 | out
|
3309 3261 | })]
|
3310 3262 | )
|
3311 3263 | .build()
|
3312 3264 | );
|
3313 3265 | }
|
3314 3266 |
|
3315 3267 | /// aws-global + path-only bucket
|
3316 3268 | #[test]
|
3317 - | fn test_115() {
|
3269 + | fn test_114() {
|
3318 3270 | let params = crate::config::endpoint::Params::builder()
|
3319 3271 | .region("aws-global".to_string())
|
3320 3272 | .bucket("bucket!".to_string())
|
3321 3273 | .build()
|
3322 3274 | .expect("invalid params");
|
3323 3275 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3324 3276 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3325 3277 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.amazonaws.com/bucket%21");
|
3326 3278 | assert_eq!(
|
3327 3279 | endpoint,
|
3328 3280 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3329 3281 | .url("https://s3.amazonaws.com/bucket%21")
|
3330 3282 | .property(
|
3331 3283 | "authSchemes",
|
3332 3284 | vec![::aws_smithy_types::Document::from({
|
3333 3285 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3334 3286 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3335 3287 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3336 3288 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3337 3289 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3338 3290 | out
|
3339 3291 | })]
|
3340 3292 | )
|
3341 3293 | .build()
|
3342 3294 | );
|
3343 3295 | }
|
3344 3296 |
|
3345 3297 | /// aws-global + fips + custom endpoint
|
3346 3298 | #[test]
|
3347 - | fn test_116() {
|
3299 + | fn test_115() {
|
3348 3300 | let params = crate::config::endpoint::Params::builder()
|
3349 3301 | .region("aws-global".to_string())
|
3350 3302 | .bucket("bucket!".to_string())
|
3351 3303 | .use_dual_stack(false)
|
3352 3304 | .use_fips(true)
|
3353 3305 | .accelerate(false)
|
3354 3306 | .endpoint("http://foo.com".to_string())
|
3355 3307 | .build()
|
3356 3308 | .expect("invalid params");
|
3357 3309 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3358 3310 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3359 3311 | let error = endpoint.expect_err("expected error: A custom endpoint cannot be combined with FIPS [aws-global + fips + custom endpoint]");
|
3360 3312 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with FIPS")
|
3361 3313 | }
|
3362 3314 |
|
3363 3315 | /// aws-global, endpoint override & path only-bucket
|
3364 3316 | #[test]
|
3365 - | fn test_117() {
|
3317 + | fn test_116() {
|
3366 3318 | let params = crate::config::endpoint::Params::builder()
|
3367 3319 | .region("aws-global".to_string())
|
3368 3320 | .bucket("bucket!".to_string())
|
3369 3321 | .use_dual_stack(false)
|
3370 3322 | .use_fips(false)
|
3371 3323 | .accelerate(false)
|
3372 3324 | .endpoint("http://foo.com".to_string())
|
3373 3325 | .build()
|
3374 3326 | .expect("invalid params");
|
3375 3327 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3376 3328 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3377 3329 | let endpoint = endpoint.expect("Expected valid endpoint: http://foo.com/bucket%21");
|
3378 3330 | assert_eq!(
|
3379 3331 | endpoint,
|
3380 3332 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3381 3333 | .url("http://foo.com/bucket%21")
|
3382 3334 | .property(
|
3383 3335 | "authSchemes",
|
3384 3336 | vec![::aws_smithy_types::Document::from({
|
3385 3337 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3386 3338 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3387 3339 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3388 3340 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3389 3341 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3390 3342 | out
|
3391 3343 | })]
|
3392 3344 | )
|
3393 3345 | .build()
|
3394 3346 | );
|
3395 3347 | }
|
3396 3348 |
|
3397 3349 | /// aws-global + dualstack + custom endpoint
|
3398 3350 | #[test]
|
3399 - | fn test_118() {
|
3351 + | fn test_117() {
|
3400 3352 | let params = crate::config::endpoint::Params::builder()
|
3401 3353 | .region("aws-global".to_string())
|
3402 3354 | .use_dual_stack(true)
|
3403 3355 | .use_fips(false)
|
3404 3356 | .accelerate(false)
|
3405 3357 | .endpoint("http://foo.com".to_string())
|
3406 3358 | .build()
|
3407 3359 | .expect("invalid params");
|
3408 3360 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3409 3361 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3410 3362 | let error = endpoint
|
3411 3363 | .expect_err("expected error: Cannot set dual-stack in combination with a custom endpoint. [aws-global + dualstack + custom endpoint]");
|
3412 3364 | assert_eq!(format!("{}", error), "Cannot set dual-stack in combination with a custom endpoint.")
|
3413 3365 | }
|
3414 3366 |
|
3415 3367 | /// accelerate, dualstack + aws-global
|
3416 3368 | #[test]
|
3417 - | fn test_119() {
|
3369 + | fn test_118() {
|
3418 3370 | let params = crate::config::endpoint::Params::builder()
|
3419 3371 | .region("aws-global".to_string())
|
3420 3372 | .bucket("bucket".to_string())
|
3421 3373 | .use_dual_stack(true)
|
3422 3374 | .use_fips(false)
|
3423 3375 | .accelerate(true)
|
3424 3376 | .build()
|
3425 3377 | .expect("invalid params");
|
3426 3378 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3427 3379 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3428 3380 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket.s3-accelerate.dualstack.us-east-1.amazonaws.com");
|
3429 3381 | assert_eq!(
|
3430 3382 | endpoint,
|
3431 3383 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3432 3384 | .url("https://bucket.s3-accelerate.dualstack.us-east-1.amazonaws.com")
|
3433 3385 | .property(
|
3434 3386 | "authSchemes",
|
3435 3387 | vec![::aws_smithy_types::Document::from({
|
3436 3388 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3437 3389 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3438 3390 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3439 3391 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3440 3392 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3441 3393 | out
|
3442 3394 | })]
|
3443 3395 | )
|
3444 3396 | .build()
|
3445 3397 | );
|
3446 3398 | }
|
3447 3399 |
|
3448 3400 | /// FIPS + aws-global + path only bucket. This is not supported by S3 but we allow garbage in garbage out
|
3449 3401 | #[test]
|
3450 - | fn test_120() {
|
3402 + | fn test_119() {
|
3451 3403 | let params = crate::config::endpoint::Params::builder()
|
3452 3404 | .region("aws-global".to_string())
|
3453 3405 | .bucket("bucket!".to_string())
|
3454 3406 | .force_path_style(true)
|
3455 3407 | .use_dual_stack(true)
|
3456 3408 | .use_fips(true)
|
3457 3409 | .accelerate(false)
|
3458 3410 | .build()
|
3459 3411 | .expect("invalid params");
|
3460 3412 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3461 3413 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3462 3414 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.dualstack.us-east-1.amazonaws.com/bucket%21");
|
3463 3415 | assert_eq!(
|
3464 3416 | endpoint,
|
3465 3417 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3466 3418 | .url("https://s3-fips.dualstack.us-east-1.amazonaws.com/bucket%21")
|
3467 3419 | .property(
|
3468 3420 | "authSchemes",
|
3469 3421 | vec![::aws_smithy_types::Document::from({
|
3470 3422 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3471 3423 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3472 3424 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3473 3425 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3474 3426 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3475 3427 | out
|
3476 3428 | })]
|
3477 3429 | )
|
3478 3430 | .build()
|
3479 3431 | );
|
3480 3432 | }
|
3481 3433 |
|
3482 3434 | /// aws-global + FIPS + endpoint override.
|
3483 3435 | #[test]
|
3484 - | fn test_121() {
|
3436 + | fn test_120() {
|
3485 3437 | let params = crate::config::endpoint::Params::builder()
|
3486 3438 | .region("aws-global".to_string())
|
3487 3439 | .use_fips(true)
|
3488 3440 | .endpoint("http://foo.com".to_string())
|
3489 3441 | .build()
|
3490 3442 | .expect("invalid params");
|
3491 3443 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3492 3444 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3493 3445 | let error = endpoint.expect_err("expected error: A custom endpoint cannot be combined with FIPS [aws-global + FIPS + endpoint override.]");
|
3494 3446 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with FIPS")
|
3495 3447 | }
|
3496 3448 |
|
3497 3449 | /// force path style, FIPS, aws-global & endpoint override
|
3498 3450 | #[test]
|
3499 - | fn test_122() {
|
3451 + | fn test_121() {
|
3500 3452 | let params = crate::config::endpoint::Params::builder()
|
3501 3453 | .region("aws-global".to_string())
|
3502 3454 | .bucket("bucket!".to_string())
|
3503 3455 | .force_path_style(true)
|
3504 3456 | .use_fips(true)
|
3505 3457 | .endpoint("http://foo.com".to_string())
|
3506 3458 | .build()
|
3507 3459 | .expect("invalid params");
|
3508 3460 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3509 3461 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3510 3462 | let error = endpoint
|
3511 3463 | .expect_err("expected error: A custom endpoint cannot be combined with FIPS [force path style, FIPS, aws-global & endpoint override]");
|
3512 3464 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with FIPS")
|
3513 3465 | }
|
3514 3466 |
|
3515 3467 | /// ip address causes path style to be forced
|
3516 3468 | #[test]
|
3517 - | fn test_123() {
|
3469 + | fn test_122() {
|
3518 3470 | let params = crate::config::endpoint::Params::builder()
|
3519 3471 | .region("aws-global".to_string())
|
3520 3472 | .bucket("bucket".to_string())
|
3521 3473 | .endpoint("http://192.168.1.1".to_string())
|
3522 3474 | .build()
|
3523 3475 | .expect("invalid params");
|
3524 3476 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3525 3477 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3526 3478 | let endpoint = endpoint.expect("Expected valid endpoint: http://192.168.1.1/bucket");
|
3527 3479 | assert_eq!(
|
3528 3480 | endpoint,
|
3529 3481 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3530 3482 | .url("http://192.168.1.1/bucket")
|
3531 3483 | .property(
|
3532 3484 | "authSchemes",
|
3533 3485 | vec![::aws_smithy_types::Document::from({
|
3534 3486 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3535 3487 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3536 3488 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3537 3489 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3538 3490 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3539 3491 | out
|
3540 3492 | })]
|
3541 3493 | )
|
3542 3494 | .build()
|
3543 3495 | );
|
3544 3496 | }
|
3545 3497 |
|
3546 3498 | /// endpoint override with aws-global region
|
3547 3499 | #[test]
|
3548 - | fn test_124() {
|
3500 + | fn test_123() {
|
3549 3501 | let params = crate::config::endpoint::Params::builder()
|
3550 3502 | .region("aws-global".to_string())
|
3551 3503 | .use_fips(true)
|
3552 3504 | .use_dual_stack(true)
|
3553 3505 | .endpoint("http://foo.com".to_string())
|
3554 3506 | .build()
|
3555 3507 | .expect("invalid params");
|
3556 3508 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3557 3509 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3558 3510 | let error = endpoint
|
3559 3511 | .expect_err("expected error: Cannot set dual-stack in combination with a custom endpoint. [endpoint override with aws-global region]");
|
3560 3512 | assert_eq!(format!("{}", error), "Cannot set dual-stack in combination with a custom endpoint.")
|
3561 3513 | }
|
3562 3514 |
|
3563 3515 | /// FIPS + path-only (TODO: consider making this an error)
|
3564 3516 | #[test]
|
3565 - | fn test_125() {
|
3517 + | fn test_124() {
|
3566 3518 | let params = crate::config::endpoint::Params::builder()
|
3567 3519 | .region("aws-global".to_string())
|
3568 3520 | .bucket("bucket!".to_string())
|
3569 3521 | .use_fips(true)
|
3570 3522 | .build()
|
3571 3523 | .expect("invalid params");
|
3572 3524 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3573 3525 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3574 3526 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.us-east-1.amazonaws.com/bucket%21");
|
3575 3527 | assert_eq!(
|
3576 3528 | endpoint,
|
3577 3529 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3578 3530 | .url("https://s3-fips.us-east-1.amazonaws.com/bucket%21")
|
3579 3531 | .property(
|
3580 3532 | "authSchemes",
|
3581 3533 | vec![::aws_smithy_types::Document::from({
|
3582 3534 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3583 3535 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
3584 3536 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3585 3537 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3586 3538 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3587 3539 | out
|
3588 3540 | })]
|
3589 3541 | )
|
3590 3542 | .build()
|
3591 3543 | );
|
3592 3544 | }
|
3593 3545 |
|
3594 3546 | /// empty arn type
|
3595 3547 | #[test]
|
3596 - | fn test_126() {
|
3548 + | fn test_125() {
|
3597 3549 | let params = crate::config::endpoint::Params::builder()
|
3598 3550 | .region("us-east-2".to_string())
|
3599 3551 | .bucket("arn:aws:not-s3:us-west-2:123456789012::myendpoint".to_string())
|
3600 3552 | .build()
|
3601 3553 | .expect("invalid params");
|
3602 3554 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3603 3555 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3604 3556 | let error = endpoint.expect_err("expected error: Invalid ARN: No ARN type specified [empty arn type]");
|
3605 3557 | assert_eq!(format!("{}", error), "Invalid ARN: No ARN type specified")
|
3606 3558 | }
|
3607 3559 |
|
3608 3560 | /// path style can't be used with accelerate
|
3609 3561 | #[test]
|
3610 - | fn test_127() {
|
3562 + | fn test_126() {
|
3611 3563 | let params = crate::config::endpoint::Params::builder()
|
3612 3564 | .region("us-east-2".to_string())
|
3613 3565 | .bucket("bucket!".to_string())
|
3614 3566 | .accelerate(true)
|
3615 3567 | .build()
|
3616 3568 | .expect("invalid params");
|
3617 3569 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3618 3570 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3619 3571 | let error =
|
3620 3572 | endpoint.expect_err("expected error: Path-style addressing cannot be used with S3 Accelerate [path style can't be used with accelerate]");
|
3621 3573 | assert_eq!(format!("{}", error), "Path-style addressing cannot be used with S3 Accelerate")
|
3622 3574 | }
|
3623 3575 |
|
3624 3576 | /// invalid region
|
3625 3577 | #[test]
|
3626 - | fn test_128() {
|
3578 + | fn test_127() {
|
3627 3579 | let params = crate::config::endpoint::Params::builder()
|
3628 3580 | .region("us-east-2!".to_string())
|
3629 3581 | .bucket("bucket.subdomain".to_string())
|
3630 3582 | .endpoint("http://foo.com".to_string())
|
3631 3583 | .build()
|
3632 3584 | .expect("invalid params");
|
3633 3585 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3634 3586 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3635 3587 | let error = endpoint.expect_err("expected error: Invalid region: region was not a valid DNS name. [invalid region]");
|
3636 3588 | assert_eq!(format!("{}", error), "Invalid region: region was not a valid DNS name.")
|
3637 3589 | }
|
3638 3590 |
|
3639 3591 | /// invalid region
|
3640 3592 | #[test]
|
3641 - | fn test_129() {
|
3593 + | fn test_128() {
|
3642 3594 | let params = crate::config::endpoint::Params::builder()
|
3643 3595 | .region("us-east-2!".to_string())
|
3644 3596 | .bucket("bucket".to_string())
|
3645 3597 | .endpoint("http://foo.com".to_string())
|
3646 3598 | .build()
|
3647 3599 | .expect("invalid params");
|
3648 3600 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3649 3601 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3650 3602 | let error = endpoint.expect_err("expected error: Invalid region: region was not a valid DNS name. [invalid region]");
|
3651 3603 | assert_eq!(format!("{}", error), "Invalid region: region was not a valid DNS name.")
|
3652 3604 | }
|
3653 3605 |
|
3654 3606 | /// empty arn type
|
3655 3607 | #[test]
|
3656 - | fn test_130() {
|
3608 + | fn test_129() {
|
3657 3609 | let params = crate::config::endpoint::Params::builder()
|
3658 3610 | .region("us-east-2".to_string())
|
3659 3611 | .bucket("arn:aws:s3::123456789012:accesspoint:my_endpoint".to_string())
|
3660 3612 | .build()
|
3661 3613 | .expect("invalid params");
|
3662 3614 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3663 3615 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3664 3616 | let error = endpoint.expect_err("expected error: Invalid Access Point Name [empty arn type]");
|
3665 3617 | assert_eq!(format!("{}", error), "Invalid Access Point Name")
|
3666 3618 | }
|
3667 3619 |
|
3668 3620 | /// empty arn type
|
3669 3621 | #[test]
|
3670 - | fn test_131() {
|
3622 + | fn test_130() {
|
3671 3623 | let params = crate::config::endpoint::Params::builder()
|
3672 3624 | .region("us-east-2".to_string())
|
3673 3625 | .bucket("arn:aws:s3:cn-north-1:123456789012:accesspoint:my-endpoint".to_string())
|
3674 3626 | .use_arn_region(true)
|
3675 3627 | .build()
|
3676 3628 | .expect("invalid params");
|
3677 3629 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3678 3630 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3679 3631 | let error = endpoint.expect_err("expected error: Client was configured for partition `aws` but ARN (`arn:aws:s3:cn-north-1:123456789012:accesspoint:my-endpoint`) has `aws-cn` [empty arn type]");
|
3680 3632 | assert_eq!(
|
3681 3633 | format!("{}", error),
|
3682 3634 | "Client was configured for partition `aws` but ARN (`arn:aws:s3:cn-north-1:123456789012:accesspoint:my-endpoint`) has `aws-cn`"
|
3683 3635 | )
|
3684 3636 | }
|
3685 3637 |
|
3686 3638 | /// invalid arn region
|
3687 3639 | #[test]
|
3688 - | fn test_132() {
|
3640 + | fn test_131() {
|
3689 3641 | let params = crate::config::endpoint::Params::builder()
|
3690 3642 | .region("us-east-2".to_string())
|
3691 3643 | .bucket("arn:aws:s3-object-lambda:us-east_2:123456789012:accesspoint:my-endpoint".to_string())
|
3692 3644 | .use_arn_region(true)
|
3693 3645 | .build()
|
3694 3646 | .expect("invalid params");
|
3695 3647 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3696 3648 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3697 3649 | let error = endpoint.expect_err("expected error: Invalid region in ARN: `us-east_2` (invalid DNS name) [invalid arn region]");
|
3698 3650 | assert_eq!(format!("{}", error), "Invalid region in ARN: `us-east_2` (invalid DNS name)")
|
3699 3651 | }
|
3700 3652 |
|
3701 3653 | /// invalid ARN outpost
|
3702 3654 | #[test]
|
3703 - | fn test_133() {
|
3655 + | fn test_132() {
|
3704 3656 | let params = crate::config::endpoint::Params::builder()
|
3705 3657 | .region("us-east-2".to_string())
|
3706 3658 | .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost/op_01234567890123456/accesspoint/reports".to_string())
|
3707 3659 | .use_arn_region(true)
|
3708 3660 | .build()
|
3709 3661 | .expect("invalid params");
|
3710 3662 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3711 3663 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3712 3664 | let error = endpoint.expect_err(
|
3713 3665 | "expected error: Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `op_01234567890123456` [invalid ARN outpost]",
|
3714 3666 | );
|
3715 3667 | assert_eq!(
|
3716 3668 | format!("{}", error),
|
3717 3669 | "Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `op_01234567890123456`"
|
3718 3670 | )
|
3719 3671 | }
|
3720 3672 |
|
3721 3673 | /// invalid ARN
|
3722 3674 | #[test]
|
3723 - | fn test_134() {
|
3675 + | fn test_133() {
|
3724 3676 | let params = crate::config::endpoint::Params::builder()
|
3725 3677 | .region("us-east-2".to_string())
|
3726 3678 | .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-01234567890123456/reports".to_string())
|
3727 3679 | .build()
|
3728 3680 | .expect("invalid params");
|
3729 3681 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3730 3682 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3731 3683 | let error = endpoint.expect_err("expected error: Invalid ARN: expected an access point name [invalid ARN]");
|
3732 3684 | assert_eq!(format!("{}", error), "Invalid ARN: expected an access point name")
|
3733 3685 | }
|
3734 3686 |
|
3735 3687 | /// invalid ARN
|
3736 3688 | #[test]
|
3737 - | fn test_135() {
|
3689 + | fn test_134() {
|
3738 3690 | let params = crate::config::endpoint::Params::builder()
|
3739 3691 | .region("us-east-2".to_string())
|
3740 3692 | .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-01234567890123456".to_string())
|
3741 3693 | .build()
|
3742 3694 | .expect("invalid params");
|
3743 3695 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3744 3696 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3745 3697 | let error = endpoint.expect_err("expected error: Invalid ARN: Expected a 4-component resource [invalid ARN]");
|
3746 3698 | assert_eq!(format!("{}", error), "Invalid ARN: Expected a 4-component resource")
|
3747 3699 | }
|
3748 3700 |
|
3749 3701 | /// invalid outpost type
|
3750 3702 | #[test]
|
3751 - | fn test_136() {
|
3703 + | fn test_135() {
|
3752 3704 | let params = crate::config::endpoint::Params::builder()
|
3753 3705 | .region("us-east-2".to_string())
|
3754 3706 | .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-01234567890123456/not-accesspoint/reports".to_string())
|
3755 3707 | .build()
|
3756 3708 | .expect("invalid params");
|
3757 3709 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3758 3710 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3759 3711 | let error = endpoint.expect_err("expected error: Expected an outpost type `accesspoint`, found not-accesspoint [invalid outpost type]");
|
3760 3712 | assert_eq!(format!("{}", error), "Expected an outpost type `accesspoint`, found not-accesspoint")
|
3761 3713 | }
|
3762 3714 |
|
3763 3715 | /// invalid outpost type
|
3764 3716 | #[test]
|
3765 - | fn test_137() {
|
3717 + | fn test_136() {
|
3766 3718 | let params = crate::config::endpoint::Params::builder()
|
3767 3719 | .region("us-east-2".to_string())
|
3768 3720 | .bucket("arn:aws:s3-outposts:us-east_1:123456789012:outpost/op-01234567890123456/not-accesspoint/reports".to_string())
|
3769 3721 | .build()
|
3770 3722 | .expect("invalid params");
|
3771 3723 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3772 3724 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3773 3725 | let error = endpoint.expect_err("expected error: Invalid region in ARN: `us-east_1` (invalid DNS name) [invalid outpost type]");
|
3774 3726 | assert_eq!(format!("{}", error), "Invalid region in ARN: `us-east_1` (invalid DNS name)")
|
3775 3727 | }
|
3776 3728 |
|
3777 3729 | /// invalid outpost type
|
3778 3730 | #[test]
|
3779 - | fn test_138() {
|
3731 + | fn test_137() {
|
3780 3732 | let params = crate::config::endpoint::Params::builder()
|
3781 3733 | .region("us-east-2".to_string())
|
3782 3734 | .bucket("arn:aws:s3-outposts:us-east-1:12345_789012:outpost/op-01234567890123456/not-accesspoint/reports".to_string())
|
3783 3735 | .build()
|
3784 3736 | .expect("invalid params");
|
3785 3737 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3786 3738 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3787 3739 | let error = endpoint.expect_err(
|
3788 3740 | "expected error: Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `12345_789012` [invalid outpost type]",
|
3789 3741 | );
|
3790 3742 | assert_eq!(
|
3791 3743 | format!("{}", error),
|
3792 3744 | "Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `12345_789012`"
|
3793 3745 | )
|
3794 3746 | }
|
3795 3747 |
|
3796 3748 | /// invalid outpost type
|
3797 3749 | #[test]
|
3798 - | fn test_139() {
|
3750 + | fn test_138() {
|
3799 3751 | let params = crate::config::endpoint::Params::builder()
|
3800 3752 | .region("us-east-2".to_string())
|
3801 3753 | .bucket("arn:aws:s3-outposts:us-east-1:12345789012:outpost".to_string())
|
3802 3754 | .build()
|
3803 3755 | .expect("invalid params");
|
3804 3756 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3805 3757 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3806 3758 | let error = endpoint.expect_err("expected error: Invalid ARN: The Outpost Id was not set [invalid outpost type]");
|
3807 3759 | assert_eq!(format!("{}", error), "Invalid ARN: The Outpost Id was not set")
|
3808 3760 | }
|
3809 3761 |
|
3810 3762 | /// use global endpoint virtual addressing
|
3811 3763 | #[test]
|
3812 - | fn test_140() {
|
3764 + | fn test_139() {
|
3813 3765 | let params = crate::config::endpoint::Params::builder()
|
3814 3766 | .region("us-east-2".to_string())
|
3815 3767 | .bucket("bucket".to_string())
|
3816 3768 | .endpoint("http://example.com".to_string())
|
3817 3769 | .use_global_endpoint(true)
|
3818 3770 | .build()
|
3819 3771 | .expect("invalid params");
|
3820 3772 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3821 3773 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3822 3774 | let endpoint = endpoint.expect("Expected valid endpoint: http://bucket.example.com");
|
3823 3775 | assert_eq!(
|
3824 3776 | endpoint,
|
3825 3777 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3826 3778 | .url("http://bucket.example.com")
|
3827 3779 | .property(
|
3828 3780 | "authSchemes",
|
3829 3781 | vec![::aws_smithy_types::Document::from({
|
3830 3782 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3831 3783 | out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
|
3832 3784 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3833 3785 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3834 3786 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3835 3787 | out
|
3836 3788 | })]
|
3837 3789 | )
|
3838 3790 | .build()
|
3839 3791 | );
|
3840 3792 | }
|
3841 3793 |
|
3842 3794 | /// global endpoint + ip address
|
3843 3795 | #[test]
|
3844 - | fn test_141() {
|
3796 + | fn test_140() {
|
3845 3797 | let params = crate::config::endpoint::Params::builder()
|
3846 3798 | .region("us-east-2".to_string())
|
3847 3799 | .bucket("bucket".to_string())
|
3848 3800 | .endpoint("http://192.168.0.1".to_string())
|
3849 3801 | .use_global_endpoint(true)
|
3850 3802 | .build()
|
3851 3803 | .expect("invalid params");
|
3852 3804 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3853 3805 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3854 3806 | let endpoint = endpoint.expect("Expected valid endpoint: http://192.168.0.1/bucket");
|
3855 3807 | assert_eq!(
|
3856 3808 | endpoint,
|
3857 3809 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3858 3810 | .url("http://192.168.0.1/bucket")
|
3859 3811 | .property(
|
3860 3812 | "authSchemes",
|
3861 3813 | vec![::aws_smithy_types::Document::from({
|
3862 3814 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3863 3815 | out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
|
3864 3816 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3865 3817 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3866 3818 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3867 3819 | out
|
3868 3820 | })]
|
3869 3821 | )
|
3870 3822 | .build()
|
3871 3823 | );
|
3872 3824 | }
|
3873 3825 |
|
3874 3826 | /// invalid outpost type
|
3875 3827 | #[test]
|
3876 - | fn test_142() {
|
3828 + | fn test_141() {
|
3877 3829 | let params = crate::config::endpoint::Params::builder()
|
3878 3830 | .region("us-east-2".to_string())
|
3879 3831 | .bucket("bucket!".to_string())
|
3880 3832 | .use_global_endpoint(true)
|
3881 3833 | .build()
|
3882 3834 | .expect("invalid params");
|
3883 3835 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3884 3836 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3885 3837 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.us-east-2.amazonaws.com/bucket%21");
|
3886 3838 | assert_eq!(
|
3887 3839 | endpoint,
|
3888 3840 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3889 3841 | .url("https://s3.us-east-2.amazonaws.com/bucket%21")
|
3890 3842 | .property(
|
3891 3843 | "authSchemes",
|
3892 3844 | vec![::aws_smithy_types::Document::from({
|
3893 3845 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3894 3846 | out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
|
3895 3847 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3896 3848 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3897 3849 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3898 3850 | out
|
3899 3851 | })]
|
3900 3852 | )
|
3901 3853 | .build()
|
3902 3854 | );
|
3903 3855 | }
|
3904 3856 |
|
3905 3857 | /// invalid outpost type
|
3906 3858 | #[test]
|
3907 - | fn test_143() {
|
3859 + | fn test_142() {
|
3908 3860 | let params = crate::config::endpoint::Params::builder()
|
3909 3861 | .region("us-east-2".to_string())
|
3910 3862 | .bucket("bucket".to_string())
|
3911 3863 | .accelerate(true)
|
3912 3864 | .use_global_endpoint(true)
|
3913 3865 | .build()
|
3914 3866 | .expect("invalid params");
|
3915 3867 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3916 3868 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3917 3869 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket.s3-accelerate.amazonaws.com");
|
3918 3870 | assert_eq!(
|
3919 3871 | endpoint,
|
3920 3872 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3921 3873 | .url("https://bucket.s3-accelerate.amazonaws.com")
|
3922 3874 | .property(
|
3923 3875 | "authSchemes",
|
3924 3876 | vec![::aws_smithy_types::Document::from({
|
3925 3877 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3926 3878 | out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
|
3927 3879 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3928 3880 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3929 3881 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3930 3882 | out
|
3931 3883 | })]
|
3932 3884 | )
|
3933 3885 | .build()
|
3934 3886 | );
|
3935 3887 | }
|
3936 3888 |
|
3937 3889 | /// use global endpoint + custom endpoint
|
3938 3890 | #[test]
|
3939 - | fn test_144() {
|
3891 + | fn test_143() {
|
3940 3892 | let params = crate::config::endpoint::Params::builder()
|
3941 3893 | .region("us-east-2".to_string())
|
3942 3894 | .bucket("bucket!".to_string())
|
3943 3895 | .use_global_endpoint(true)
|
3944 3896 | .endpoint("http://foo.com".to_string())
|
3945 3897 | .build()
|
3946 3898 | .expect("invalid params");
|
3947 3899 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3948 3900 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3949 3901 | let endpoint = endpoint.expect("Expected valid endpoint: http://foo.com/bucket%21");
|
3950 3902 | assert_eq!(
|
3951 3903 | endpoint,
|
3952 3904 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3953 3905 | .url("http://foo.com/bucket%21")
|
3954 3906 | .property(
|
3955 3907 | "authSchemes",
|
3956 3908 | vec![::aws_smithy_types::Document::from({
|
3957 3909 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3958 3910 | out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
|
3959 3911 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3960 3912 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3961 3913 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3962 3914 | out
|
3963 3915 | })]
|
3964 3916 | )
|
3965 3917 | .build()
|
3966 3918 | );
|
3967 3919 | }
|
3968 3920 |
|
3969 3921 | /// use global endpoint, not us-east-1, force path style
|
3970 3922 | #[test]
|
3971 - | fn test_145() {
|
3923 + | fn test_144() {
|
3972 3924 | let params = crate::config::endpoint::Params::builder()
|
3973 3925 | .region("us-east-2".to_string())
|
3974 3926 | .bucket("bucket!".to_string())
|
3975 3927 | .use_global_endpoint(true)
|
3976 3928 | .force_path_style(true)
|
3977 3929 | .endpoint("http://foo.com".to_string())
|
3978 3930 | .build()
|
3979 3931 | .expect("invalid params");
|
3980 3932 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
3981 3933 | let endpoint = resolver.resolve_endpoint(¶ms);
|
3982 3934 | let endpoint = endpoint.expect("Expected valid endpoint: http://foo.com/bucket%21");
|
3983 3935 | assert_eq!(
|
3984 3936 | endpoint,
|
3985 3937 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
3986 3938 | .url("http://foo.com/bucket%21")
|
3987 3939 | .property(
|
3988 3940 | "authSchemes",
|
3989 3941 | vec![::aws_smithy_types::Document::from({
|
3990 3942 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
3991 3943 | out.insert("signingRegion".to_string(), "us-east-2".to_string().into());
|
3992 3944 | out.insert("name".to_string(), "sigv4".to_string().into());
|
3993 3945 | out.insert("signingName".to_string(), "s3".to_string().into());
|
3994 3946 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
3995 3947 | out
|
3996 3948 | })]
|
3997 3949 | )
|
3998 3950 | .build()
|
3999 3951 | );
|
4000 3952 | }
|
4001 3953 |
|
4002 3954 | /// vanilla virtual addressing@us-west-2
|
4003 3955 | #[test]
|
4004 - | fn test_146() {
|
3956 + | fn test_145() {
|
4005 3957 | let params = crate::config::endpoint::Params::builder()
|
4006 3958 | .accelerate(false)
|
4007 3959 | .bucket("bucket-name".to_string())
|
4008 3960 | .force_path_style(false)
|
4009 3961 | .region("us-west-2".to_string())
|
4010 3962 | .use_dual_stack(false)
|
4011 3963 | .use_fips(false)
|
4012 3964 | .build()
|
4013 3965 | .expect("invalid params");
|
4014 3966 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4015 3967 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4016 3968 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3.us-west-2.amazonaws.com");
|
4017 3969 | assert_eq!(
|
4018 3970 | endpoint,
|
4019 3971 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4020 3972 | .url("https://bucket-name.s3.us-west-2.amazonaws.com")
|
4021 3973 | .property(
|
4022 3974 | "authSchemes",
|
4023 3975 | vec![::aws_smithy_types::Document::from({
|
4024 3976 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4025 3977 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4026 3978 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4027 3979 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
4028 3980 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4029 3981 | out
|
4030 3982 | })]
|
4031 3983 | )
|
4032 3984 | .build()
|
4033 3985 | );
|
4034 3986 | }
|
4035 3987 |
|
4036 3988 | /// virtual addressing + dualstack@us-west-2
|
4037 3989 | #[test]
|
4038 - | fn test_147() {
|
3990 + | fn test_146() {
|
4039 3991 | let params = crate::config::endpoint::Params::builder()
|
4040 3992 | .accelerate(false)
|
4041 3993 | .bucket("bucket-name".to_string())
|
4042 3994 | .force_path_style(false)
|
4043 3995 | .region("us-west-2".to_string())
|
4044 3996 | .use_dual_stack(true)
|
4045 3997 | .use_fips(false)
|
4046 3998 | .build()
|
4047 3999 | .expect("invalid params");
|
4048 4000 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4049 4001 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4050 4002 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3.dualstack.us-west-2.amazonaws.com");
|
4051 4003 | assert_eq!(
|
4052 4004 | endpoint,
|
4053 4005 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4054 4006 | .url("https://bucket-name.s3.dualstack.us-west-2.amazonaws.com")
|
4055 4007 | .property(
|
4056 4008 | "authSchemes",
|
4057 4009 | vec![::aws_smithy_types::Document::from({
|
4058 4010 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4059 4011 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4060 4012 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4061 4013 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
4062 4014 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4063 4015 | out
|
4064 4016 | })]
|
4065 4017 | )
|
4066 4018 | .build()
|
4067 4019 | );
|
4068 4020 | }
|
4069 4021 |
|
4070 4022 | /// accelerate + dualstack@us-west-2
|
4071 4023 | #[test]
|
4072 - | fn test_148() {
|
4024 + | fn test_147() {
|
4073 4025 | let params = crate::config::endpoint::Params::builder()
|
4074 4026 | .accelerate(true)
|
4075 4027 | .bucket("bucket-name".to_string())
|
4076 4028 | .force_path_style(false)
|
4077 4029 | .region("us-west-2".to_string())
|
4078 4030 | .use_dual_stack(true)
|
4079 4031 | .use_fips(false)
|
4080 4032 | .build()
|
4081 4033 | .expect("invalid params");
|
4082 4034 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4083 4035 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4084 4036 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-accelerate.dualstack.amazonaws.com");
|
4085 4037 | assert_eq!(
|
4086 4038 | endpoint,
|
4087 4039 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4088 4040 | .url("https://bucket-name.s3-accelerate.dualstack.amazonaws.com")
|
4089 4041 | .property(
|
4090 4042 | "authSchemes",
|
4091 4043 | vec![::aws_smithy_types::Document::from({
|
4092 4044 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4093 4045 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4094 4046 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4095 4047 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
4096 4048 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4097 4049 | out
|
4098 4050 | })]
|
4099 4051 | )
|
4100 4052 | .build()
|
4101 4053 | );
|
4102 4054 | }
|
4103 4055 |
|
4104 4056 | /// accelerate (dualstack=false)@us-west-2
|
4105 4057 | #[test]
|
4106 - | fn test_149() {
|
4058 + | fn test_148() {
|
4107 4059 | let params = crate::config::endpoint::Params::builder()
|
4108 4060 | .accelerate(true)
|
4109 4061 | .bucket("bucket-name".to_string())
|
4110 4062 | .force_path_style(false)
|
4111 4063 | .region("us-west-2".to_string())
|
4112 4064 | .use_dual_stack(false)
|
4113 4065 | .use_fips(false)
|
4114 4066 | .build()
|
4115 4067 | .expect("invalid params");
|
4116 4068 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4117 4069 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4118 4070 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-accelerate.amazonaws.com");
|
4119 4071 | assert_eq!(
|
4120 4072 | endpoint,
|
4121 4073 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4122 4074 | .url("https://bucket-name.s3-accelerate.amazonaws.com")
|
4123 4075 | .property(
|
4124 4076 | "authSchemes",
|
4125 4077 | vec![::aws_smithy_types::Document::from({
|
4126 4078 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4127 4079 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4128 4080 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4129 4081 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
4130 4082 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4131 4083 | out
|
4132 4084 | })]
|
4133 4085 | )
|
4134 4086 | .build()
|
4135 4087 | );
|
4136 4088 | }
|
4137 4089 |
|
4138 4090 | /// virtual addressing + fips@us-west-2
|
4139 4091 | #[test]
|
4140 - | fn test_150() {
|
4092 + | fn test_149() {
|
4141 4093 | let params = crate::config::endpoint::Params::builder()
|
4142 4094 | .accelerate(false)
|
4143 4095 | .bucket("bucket-name".to_string())
|
4144 4096 | .force_path_style(false)
|
4145 4097 | .region("us-west-2".to_string())
|
4146 4098 | .use_dual_stack(false)
|
4147 4099 | .use_fips(true)
|
4148 4100 | .build()
|
4149 4101 | .expect("invalid params");
|
4150 4102 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4151 4103 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4152 4104 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-fips.us-west-2.amazonaws.com");
|
4153 4105 | assert_eq!(
|
4154 4106 | endpoint,
|
4155 4107 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4156 4108 | .url("https://bucket-name.s3-fips.us-west-2.amazonaws.com")
|
4157 4109 | .property(
|
4158 4110 | "authSchemes",
|
4159 4111 | vec![::aws_smithy_types::Document::from({
|
4160 4112 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4161 4113 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4162 4114 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4163 4115 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
4164 4116 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4165 4117 | out
|
4166 4118 | })]
|
4167 4119 | )
|
4168 4120 | .build()
|
4169 4121 | );
|
4170 4122 | }
|
4171 4123 |
|
4172 4124 | /// virtual addressing + dualstack + fips@us-west-2
|
4173 4125 | #[test]
|
4174 - | fn test_151() {
|
4126 + | fn test_150() {
|
4175 4127 | let params = crate::config::endpoint::Params::builder()
|
4176 4128 | .accelerate(false)
|
4177 4129 | .bucket("bucket-name".to_string())
|
4178 4130 | .force_path_style(false)
|
4179 4131 | .region("us-west-2".to_string())
|
4180 4132 | .use_dual_stack(true)
|
4181 4133 | .use_fips(true)
|
4182 4134 | .build()
|
4183 4135 | .expect("invalid params");
|
4184 4136 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4185 4137 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4186 4138 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-fips.dualstack.us-west-2.amazonaws.com");
|
4187 4139 | assert_eq!(
|
4188 4140 | endpoint,
|
4189 4141 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4190 4142 | .url("https://bucket-name.s3-fips.dualstack.us-west-2.amazonaws.com")
|
4191 4143 | .property(
|
4192 4144 | "authSchemes",
|
4193 4145 | vec![::aws_smithy_types::Document::from({
|
4194 4146 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4195 4147 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4196 4148 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4197 4149 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
4198 4150 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4199 4151 | out
|
4200 4152 | })]
|
4201 4153 | )
|
4202 4154 | .build()
|
4203 4155 | );
|
4204 4156 | }
|
4205 4157 |
|
4206 4158 | /// accelerate + fips = error@us-west-2
|
4207 4159 | #[test]
|
4208 - | fn test_152() {
|
4160 + | fn test_151() {
|
4209 4161 | let params = crate::config::endpoint::Params::builder()
|
4210 4162 | .accelerate(true)
|
4211 4163 | .bucket("bucket-name".to_string())
|
4212 4164 | .force_path_style(false)
|
4213 4165 | .region("us-west-2".to_string())
|
4214 4166 | .use_dual_stack(false)
|
4215 4167 | .use_fips(true)
|
4216 4168 | .build()
|
4217 4169 | .expect("invalid params");
|
4218 4170 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4219 4171 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4220 4172 | let error = endpoint.expect_err("expected error: Accelerate cannot be used with FIPS [accelerate + fips = error@us-west-2]");
|
4221 4173 | assert_eq!(format!("{}", error), "Accelerate cannot be used with FIPS")
|
4222 4174 | }
|
4223 4175 |
|
4224 4176 | /// vanilla virtual addressing@cn-north-1
|
4225 4177 | #[test]
|
4226 - | fn test_153() {
|
4178 + | fn test_152() {
|
4227 4179 | let params = crate::config::endpoint::Params::builder()
|
4228 4180 | .accelerate(false)
|
4229 4181 | .bucket("bucket-name".to_string())
|
4230 4182 | .force_path_style(false)
|
4231 4183 | .region("cn-north-1".to_string())
|
4232 4184 | .use_dual_stack(false)
|
4233 4185 | .use_fips(false)
|
4234 4186 | .build()
|
4235 4187 | .expect("invalid params");
|
4236 4188 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4237 4189 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4238 4190 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3.cn-north-1.amazonaws.com.cn");
|
4239 4191 | assert_eq!(
|
4240 4192 | endpoint,
|
4241 4193 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4242 4194 | .url("https://bucket-name.s3.cn-north-1.amazonaws.com.cn")
|
4243 4195 | .property(
|
4244 4196 | "authSchemes",
|
4245 4197 | vec![::aws_smithy_types::Document::from({
|
4246 4198 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4247 4199 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4248 4200 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4249 4201 | out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
|
4250 4202 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4251 4203 | out
|
4252 4204 | })]
|
4253 4205 | )
|
4254 4206 | .build()
|
4255 4207 | );
|
4256 4208 | }
|
4257 4209 |
|
4258 4210 | /// virtual addressing + dualstack@cn-north-1
|
4259 4211 | #[test]
|
4260 - | fn test_154() {
|
4212 + | fn test_153() {
|
4261 4213 | let params = crate::config::endpoint::Params::builder()
|
4262 4214 | .accelerate(false)
|
4263 4215 | .bucket("bucket-name".to_string())
|
4264 4216 | .force_path_style(false)
|
4265 4217 | .region("cn-north-1".to_string())
|
4266 4218 | .use_dual_stack(true)
|
4267 4219 | .use_fips(false)
|
4268 4220 | .build()
|
4269 4221 | .expect("invalid params");
|
4270 4222 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4271 4223 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4272 4224 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3.dualstack.cn-north-1.amazonaws.com.cn");
|
4273 4225 | assert_eq!(
|
4274 4226 | endpoint,
|
4275 4227 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4276 4228 | .url("https://bucket-name.s3.dualstack.cn-north-1.amazonaws.com.cn")
|
4277 4229 | .property(
|
4278 4230 | "authSchemes",
|
4279 4231 | vec![::aws_smithy_types::Document::from({
|
4280 4232 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4281 4233 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4282 4234 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4283 4235 | out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
|
4284 4236 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4285 4237 | out
|
4286 4238 | })]
|
4287 4239 | )
|
4288 4240 | .build()
|
4289 4241 | );
|
4290 4242 | }
|
4291 4243 |
|
4292 4244 | /// accelerate (dualstack=false)@cn-north-1
|
4293 4245 | #[test]
|
4294 - | fn test_155() {
|
4246 + | fn test_154() {
|
4295 4247 | let params = crate::config::endpoint::Params::builder()
|
4296 4248 | .accelerate(true)
|
4297 4249 | .bucket("bucket-name".to_string())
|
4298 4250 | .force_path_style(false)
|
4299 4251 | .region("cn-north-1".to_string())
|
4300 4252 | .use_dual_stack(false)
|
4301 4253 | .use_fips(false)
|
4302 4254 | .build()
|
4303 4255 | .expect("invalid params");
|
4304 4256 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4305 4257 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4306 4258 | let error = endpoint.expect_err("expected error: S3 Accelerate cannot be used in this region [accelerate (dualstack=false)@cn-north-1]");
|
4307 4259 | assert_eq!(format!("{}", error), "S3 Accelerate cannot be used in this region")
|
4308 4260 | }
|
4309 4261 |
|
4310 4262 | /// virtual addressing + fips@cn-north-1
|
4311 4263 | #[test]
|
4312 - | fn test_156() {
|
4264 + | fn test_155() {
|
4313 4265 | let params = crate::config::endpoint::Params::builder()
|
4314 4266 | .accelerate(false)
|
4315 4267 | .bucket("bucket-name".to_string())
|
4316 4268 | .force_path_style(false)
|
4317 4269 | .region("cn-north-1".to_string())
|
4318 4270 | .use_dual_stack(false)
|
4319 4271 | .use_fips(true)
|
4320 4272 | .build()
|
4321 4273 | .expect("invalid params");
|
4322 4274 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4323 4275 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4324 4276 | let error = endpoint.expect_err("expected error: Partition does not support FIPS [virtual addressing + fips@cn-north-1]");
|
4325 4277 | assert_eq!(format!("{}", error), "Partition does not support FIPS")
|
4326 4278 | }
|
4327 4279 |
|
4328 4280 | /// vanilla virtual addressing@af-south-1
|
4329 4281 | #[test]
|
4330 - | fn test_157() {
|
4282 + | fn test_156() {
|
4331 4283 | let params = crate::config::endpoint::Params::builder()
|
4332 4284 | .accelerate(false)
|
4333 4285 | .bucket("bucket-name".to_string())
|
4334 4286 | .force_path_style(false)
|
4335 4287 | .region("af-south-1".to_string())
|
4336 4288 | .use_dual_stack(false)
|
4337 4289 | .use_fips(false)
|
4338 4290 | .build()
|
4339 4291 | .expect("invalid params");
|
4340 4292 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4341 4293 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4342 4294 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3.af-south-1.amazonaws.com");
|
4343 4295 | assert_eq!(
|
4344 4296 | endpoint,
|
4345 4297 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4346 4298 | .url("https://bucket-name.s3.af-south-1.amazonaws.com")
|
4347 4299 | .property(
|
4348 4300 | "authSchemes",
|
4349 4301 | vec![::aws_smithy_types::Document::from({
|
4350 4302 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4351 4303 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4352 4304 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4353 4305 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
4354 4306 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4355 4307 | out
|
4356 4308 | })]
|
4357 4309 | )
|
4358 4310 | .build()
|
4359 4311 | );
|
4360 4312 | }
|
4361 4313 |
|
4362 4314 | /// virtual addressing + dualstack@af-south-1
|
4363 4315 | #[test]
|
4364 - | fn test_158() {
|
4316 + | fn test_157() {
|
4365 4317 | let params = crate::config::endpoint::Params::builder()
|
4366 4318 | .accelerate(false)
|
4367 4319 | .bucket("bucket-name".to_string())
|
4368 4320 | .force_path_style(false)
|
4369 4321 | .region("af-south-1".to_string())
|
4370 4322 | .use_dual_stack(true)
|
4371 4323 | .use_fips(false)
|
4372 4324 | .build()
|
4373 4325 | .expect("invalid params");
|
4374 4326 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4375 4327 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4376 4328 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3.dualstack.af-south-1.amazonaws.com");
|
4377 4329 | assert_eq!(
|
4378 4330 | endpoint,
|
4379 4331 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4380 4332 | .url("https://bucket-name.s3.dualstack.af-south-1.amazonaws.com")
|
4381 4333 | .property(
|
4382 4334 | "authSchemes",
|
4383 4335 | vec![::aws_smithy_types::Document::from({
|
4384 4336 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4385 4337 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4386 4338 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4387 4339 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
4388 4340 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4389 4341 | out
|
4390 4342 | })]
|
4391 4343 | )
|
4392 4344 | .build()
|
4393 4345 | );
|
4394 4346 | }
|
4395 4347 |
|
4396 4348 | /// accelerate + dualstack@af-south-1
|
4397 4349 | #[test]
|
4398 - | fn test_159() {
|
4350 + | fn test_158() {
|
4399 4351 | let params = crate::config::endpoint::Params::builder()
|
4400 4352 | .accelerate(true)
|
4401 4353 | .bucket("bucket-name".to_string())
|
4402 4354 | .force_path_style(false)
|
4403 4355 | .region("af-south-1".to_string())
|
4404 4356 | .use_dual_stack(true)
|
4405 4357 | .use_fips(false)
|
4406 4358 | .build()
|
4407 4359 | .expect("invalid params");
|
4408 4360 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4409 4361 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4410 4362 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-accelerate.dualstack.amazonaws.com");
|
4411 4363 | assert_eq!(
|
4412 4364 | endpoint,
|
4413 4365 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4414 4366 | .url("https://bucket-name.s3-accelerate.dualstack.amazonaws.com")
|
4415 4367 | .property(
|
4416 4368 | "authSchemes",
|
4417 4369 | vec![::aws_smithy_types::Document::from({
|
4418 4370 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4419 4371 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4420 4372 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4421 4373 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
4422 4374 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4423 4375 | out
|
4424 4376 | })]
|
4425 4377 | )
|
4426 4378 | .build()
|
4427 4379 | );
|
4428 4380 | }
|
4429 4381 |
|
4430 4382 | /// accelerate (dualstack=false)@af-south-1
|
4431 4383 | #[test]
|
4432 - | fn test_160() {
|
4384 + | fn test_159() {
|
4433 4385 | let params = crate::config::endpoint::Params::builder()
|
4434 4386 | .accelerate(true)
|
4435 4387 | .bucket("bucket-name".to_string())
|
4436 4388 | .force_path_style(false)
|
4437 4389 | .region("af-south-1".to_string())
|
4438 4390 | .use_dual_stack(false)
|
4439 4391 | .use_fips(false)
|
4440 4392 | .build()
|
4441 4393 | .expect("invalid params");
|
4442 4394 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4443 4395 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4444 4396 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-accelerate.amazonaws.com");
|
4445 4397 | assert_eq!(
|
4446 4398 | endpoint,
|
4447 4399 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4448 4400 | .url("https://bucket-name.s3-accelerate.amazonaws.com")
|
4449 4401 | .property(
|
4450 4402 | "authSchemes",
|
4451 4403 | vec![::aws_smithy_types::Document::from({
|
4452 4404 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4453 4405 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4454 4406 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4455 4407 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
4456 4408 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4457 4409 | out
|
4458 4410 | })]
|
4459 4411 | )
|
4460 4412 | .build()
|
4461 4413 | );
|
4462 4414 | }
|
4463 4415 |
|
4464 4416 | /// virtual addressing + fips@af-south-1
|
4465 4417 | #[test]
|
4466 - | fn test_161() {
|
4418 + | fn test_160() {
|
4467 4419 | let params = crate::config::endpoint::Params::builder()
|
4468 4420 | .accelerate(false)
|
4469 4421 | .bucket("bucket-name".to_string())
|
4470 4422 | .force_path_style(false)
|
4471 4423 | .region("af-south-1".to_string())
|
4472 4424 | .use_dual_stack(false)
|
4473 4425 | .use_fips(true)
|
4474 4426 | .build()
|
4475 4427 | .expect("invalid params");
|
4476 4428 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4477 4429 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4478 4430 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-fips.af-south-1.amazonaws.com");
|
4479 4431 | assert_eq!(
|
4480 4432 | endpoint,
|
4481 4433 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4482 4434 | .url("https://bucket-name.s3-fips.af-south-1.amazonaws.com")
|
4483 4435 | .property(
|
4484 4436 | "authSchemes",
|
4485 4437 | vec![::aws_smithy_types::Document::from({
|
4486 4438 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4487 4439 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4488 4440 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4489 4441 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
4490 4442 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4491 4443 | out
|
4492 4444 | })]
|
4493 4445 | )
|
4494 4446 | .build()
|
4495 4447 | );
|
4496 4448 | }
|
4497 4449 |
|
4498 4450 | /// virtual addressing + dualstack + fips@af-south-1
|
4499 4451 | #[test]
|
4500 - | fn test_162() {
|
4452 + | fn test_161() {
|
4501 4453 | let params = crate::config::endpoint::Params::builder()
|
4502 4454 | .accelerate(false)
|
4503 4455 | .bucket("bucket-name".to_string())
|
4504 4456 | .force_path_style(false)
|
4505 4457 | .region("af-south-1".to_string())
|
4506 4458 | .use_dual_stack(true)
|
4507 4459 | .use_fips(true)
|
4508 4460 | .build()
|
4509 4461 | .expect("invalid params");
|
4510 4462 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4511 4463 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4512 4464 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.s3-fips.dualstack.af-south-1.amazonaws.com");
|
4513 4465 | assert_eq!(
|
4514 4466 | endpoint,
|
4515 4467 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4516 4468 | .url("https://bucket-name.s3-fips.dualstack.af-south-1.amazonaws.com")
|
4517 4469 | .property(
|
4518 4470 | "authSchemes",
|
4519 4471 | vec![::aws_smithy_types::Document::from({
|
4520 4472 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4521 4473 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4522 4474 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4523 4475 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
4524 4476 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4525 4477 | out
|
4526 4478 | })]
|
4527 4479 | )
|
4528 4480 | .build()
|
4529 4481 | );
|
4530 4482 | }
|
4531 4483 |
|
4532 4484 | /// accelerate + fips = error@af-south-1
|
4533 4485 | #[test]
|
4534 - | fn test_163() {
|
4486 + | fn test_162() {
|
4535 4487 | let params = crate::config::endpoint::Params::builder()
|
4536 4488 | .accelerate(true)
|
4537 4489 | .bucket("bucket-name".to_string())
|
4538 4490 | .force_path_style(false)
|
4539 4491 | .region("af-south-1".to_string())
|
4540 4492 | .use_dual_stack(false)
|
4541 4493 | .use_fips(true)
|
4542 4494 | .build()
|
4543 4495 | .expect("invalid params");
|
4544 4496 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4545 4497 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4546 4498 | let error = endpoint.expect_err("expected error: Accelerate cannot be used with FIPS [accelerate + fips = error@af-south-1]");
|
4547 4499 | assert_eq!(format!("{}", error), "Accelerate cannot be used with FIPS")
|
4548 4500 | }
|
4549 4501 |
|
4550 4502 | /// vanilla path style@us-west-2
|
4551 4503 | #[test]
|
4552 - | fn test_164() {
|
4504 + | fn test_163() {
|
4553 4505 | let params = crate::config::endpoint::Params::builder()
|
4554 4506 | .accelerate(false)
|
4555 4507 | .bucket("bucket-name".to_string())
|
4556 4508 | .force_path_style(true)
|
4557 4509 | .region("us-west-2".to_string())
|
4558 4510 | .use_dual_stack(false)
|
4559 4511 | .use_fips(false)
|
4560 4512 | .build()
|
4561 4513 | .expect("invalid params");
|
4562 4514 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4563 4515 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4564 4516 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.us-west-2.amazonaws.com/bucket-name");
|
4565 4517 | assert_eq!(
|
4566 4518 | endpoint,
|
4567 4519 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4568 4520 | .url("https://s3.us-west-2.amazonaws.com/bucket-name")
|
4569 4521 | .property(
|
4570 4522 | "authSchemes",
|
4571 4523 | vec![::aws_smithy_types::Document::from({
|
4572 4524 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4573 4525 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4574 4526 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4575 4527 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
4576 4528 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4577 4529 | out
|
4578 4530 | })]
|
4579 4531 | )
|
4580 4532 | .build()
|
4581 4533 | );
|
4582 4534 | }
|
4583 4535 |
|
4584 4536 | /// fips@us-gov-west-2, bucket is not S3-dns-compatible (subdomains)
|
4585 4537 | #[test]
|
4586 - | fn test_165() {
|
4538 + | fn test_164() {
|
4587 4539 | let params = crate::config::endpoint::Params::builder()
|
4588 4540 | .accelerate(false)
|
4589 4541 | .bucket("bucket.with.dots".to_string())
|
4590 4542 | .region("us-gov-west-1".to_string())
|
4591 4543 | .use_dual_stack(false)
|
4592 4544 | .use_fips(true)
|
4593 4545 | .build()
|
4594 4546 | .expect("invalid params");
|
4595 4547 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4596 4548 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4597 4549 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.us-gov-west-1.amazonaws.com/bucket.with.dots");
|
4598 4550 | assert_eq!(
|
4599 4551 | endpoint,
|
4600 4552 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4601 4553 | .url("https://s3-fips.us-gov-west-1.amazonaws.com/bucket.with.dots")
|
4602 4554 | .property(
|
4603 4555 | "authSchemes",
|
4604 4556 | vec![::aws_smithy_types::Document::from({
|
4605 4557 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4606 4558 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4607 4559 | out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into());
|
4608 4560 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4609 4561 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4610 4562 | out
|
4611 4563 | })]
|
4612 4564 | )
|
4613 4565 | .build()
|
4614 4566 | );
|
4615 4567 | }
|
4616 4568 |
|
4617 4569 | /// path style + accelerate = error@us-west-2
|
4618 4570 | #[test]
|
4619 - | fn test_166() {
|
4571 + | fn test_165() {
|
4620 4572 | let params = crate::config::endpoint::Params::builder()
|
4621 4573 | .accelerate(true)
|
4622 4574 | .bucket("bucket-name".to_string())
|
4623 4575 | .force_path_style(true)
|
4624 4576 | .region("us-west-2".to_string())
|
4625 4577 | .use_dual_stack(false)
|
4626 4578 | .use_fips(false)
|
4627 4579 | .build()
|
4628 4580 | .expect("invalid params");
|
4629 4581 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4630 4582 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4631 4583 | let error = endpoint
|
4632 4584 | .expect_err("expected error: Path-style addressing cannot be used with S3 Accelerate [path style + accelerate = error@us-west-2]");
|
4633 4585 | assert_eq!(format!("{}", error), "Path-style addressing cannot be used with S3 Accelerate")
|
4634 4586 | }
|
4635 4587 |
|
4636 4588 | /// path style + dualstack@us-west-2
|
4637 4589 | #[test]
|
4638 - | fn test_167() {
|
4590 + | fn test_166() {
|
4639 4591 | let params = crate::config::endpoint::Params::builder()
|
4640 4592 | .accelerate(false)
|
4641 4593 | .bucket("bucket-name".to_string())
|
4642 4594 | .force_path_style(true)
|
4643 4595 | .region("us-west-2".to_string())
|
4644 4596 | .use_dual_stack(true)
|
4645 4597 | .use_fips(false)
|
4646 4598 | .build()
|
4647 4599 | .expect("invalid params");
|
4648 4600 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4649 4601 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4650 4602 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.dualstack.us-west-2.amazonaws.com/bucket-name");
|
4651 4603 | assert_eq!(
|
4652 4604 | endpoint,
|
4653 4605 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4654 4606 | .url("https://s3.dualstack.us-west-2.amazonaws.com/bucket-name")
|
4655 4607 | .property(
|
4656 4608 | "authSchemes",
|
4657 4609 | vec![::aws_smithy_types::Document::from({
|
4658 4610 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4659 4611 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4660 4612 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4661 4613 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
4662 4614 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4663 4615 | out
|
4664 4616 | })]
|
4665 4617 | )
|
4666 4618 | .build()
|
4667 4619 | );
|
4668 4620 | }
|
4669 4621 |
|
4670 4622 | /// path style + arn is error@us-west-2
|
4671 4623 | #[test]
|
4672 - | fn test_168() {
|
4624 + | fn test_167() {
|
4673 4625 | let params = crate::config::endpoint::Params::builder()
|
4674 4626 | .accelerate(false)
|
4675 4627 | .bucket("arn:PARTITION:s3-outposts:REGION:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
|
4676 4628 | .force_path_style(true)
|
4677 4629 | .region("us-west-2".to_string())
|
4678 4630 | .use_dual_stack(false)
|
4679 4631 | .use_fips(false)
|
4680 4632 | .build()
|
4681 4633 | .expect("invalid params");
|
4682 4634 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4683 4635 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4684 4636 | let error =
|
4685 4637 | endpoint.expect_err("expected error: Path-style addressing cannot be used with ARN buckets [path style + arn is error@us-west-2]");
|
4686 4638 | assert_eq!(format!("{}", error), "Path-style addressing cannot be used with ARN buckets")
|
4687 4639 | }
|
4688 4640 |
|
4689 4641 | /// path style + invalid DNS name@us-west-2
|
4690 4642 | #[test]
|
4691 - | fn test_169() {
|
4643 + | fn test_168() {
|
4692 4644 | let params = crate::config::endpoint::Params::builder()
|
4693 4645 | .accelerate(false)
|
4694 4646 | .bucket("99a_b".to_string())
|
4695 4647 | .force_path_style(true)
|
4696 4648 | .region("us-west-2".to_string())
|
4697 4649 | .use_dual_stack(false)
|
4698 4650 | .use_fips(false)
|
4699 4651 | .build()
|
4700 4652 | .expect("invalid params");
|
4701 4653 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4702 4654 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4703 4655 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.us-west-2.amazonaws.com/99a_b");
|
4704 4656 | assert_eq!(
|
4705 4657 | endpoint,
|
4706 4658 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4707 4659 | .url("https://s3.us-west-2.amazonaws.com/99a_b")
|
4708 4660 | .property(
|
4709 4661 | "authSchemes",
|
4710 4662 | vec![::aws_smithy_types::Document::from({
|
4711 4663 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4712 4664 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4713 4665 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4714 4666 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
4715 4667 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4716 4668 | out
|
4717 4669 | })]
|
4718 4670 | )
|
4719 4671 | .build()
|
4720 4672 | );
|
4721 4673 | }
|
4722 4674 |
|
4723 4675 | /// no path style + invalid DNS name@us-west-2
|
4724 4676 | #[test]
|
4725 - | fn test_170() {
|
4677 + | fn test_169() {
|
4726 4678 | let params = crate::config::endpoint::Params::builder()
|
4727 4679 | .accelerate(false)
|
4728 4680 | .bucket("99a_b".to_string())
|
4729 4681 | .region("us-west-2".to_string())
|
4730 4682 | .use_dual_stack(false)
|
4731 4683 | .use_fips(false)
|
4732 4684 | .build()
|
4733 4685 | .expect("invalid params");
|
4734 4686 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4735 4687 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4736 4688 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.us-west-2.amazonaws.com/99a_b");
|
4737 4689 | assert_eq!(
|
4738 4690 | endpoint,
|
4739 4691 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4740 4692 | .url("https://s3.us-west-2.amazonaws.com/99a_b")
|
4741 4693 | .property(
|
4742 4694 | "authSchemes",
|
4743 4695 | vec![::aws_smithy_types::Document::from({
|
4744 4696 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4745 4697 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4746 4698 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4747 4699 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
4748 4700 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4749 4701 | out
|
4750 4702 | })]
|
4751 4703 | )
|
4752 4704 | .build()
|
4753 4705 | );
|
4754 4706 | }
|
4755 4707 |
|
4756 4708 | /// vanilla path style@cn-north-1
|
4757 4709 | #[test]
|
4758 - | fn test_171() {
|
4710 + | fn test_170() {
|
4759 4711 | let params = crate::config::endpoint::Params::builder()
|
4760 4712 | .accelerate(false)
|
4761 4713 | .bucket("bucket-name".to_string())
|
4762 4714 | .force_path_style(true)
|
4763 4715 | .region("cn-north-1".to_string())
|
4764 4716 | .use_dual_stack(false)
|
4765 4717 | .use_fips(false)
|
4766 4718 | .build()
|
4767 4719 | .expect("invalid params");
|
4768 4720 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4769 4721 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4770 4722 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.cn-north-1.amazonaws.com.cn/bucket-name");
|
4771 4723 | assert_eq!(
|
4772 4724 | endpoint,
|
4773 4725 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4774 4726 | .url("https://s3.cn-north-1.amazonaws.com.cn/bucket-name")
|
4775 4727 | .property(
|
4776 4728 | "authSchemes",
|
4777 4729 | vec![::aws_smithy_types::Document::from({
|
4778 4730 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4779 4731 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4780 4732 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4781 4733 | out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
|
4782 4734 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4783 4735 | out
|
4784 4736 | })]
|
4785 4737 | )
|
4786 4738 | .build()
|
4787 4739 | );
|
4788 4740 | }
|
4789 4741 |
|
4790 4742 | /// path style + fips@cn-north-1
|
4791 4743 | #[test]
|
4792 - | fn test_172() {
|
4744 + | fn test_171() {
|
4793 4745 | let params = crate::config::endpoint::Params::builder()
|
4794 4746 | .accelerate(false)
|
4795 4747 | .bucket("bucket-name".to_string())
|
4796 4748 | .force_path_style(true)
|
4797 4749 | .region("cn-north-1".to_string())
|
4798 4750 | .use_dual_stack(false)
|
4799 4751 | .use_fips(true)
|
4800 4752 | .build()
|
4801 4753 | .expect("invalid params");
|
4802 4754 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4803 4755 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4804 4756 | let error = endpoint.expect_err("expected error: Partition does not support FIPS [path style + fips@cn-north-1]");
|
4805 4757 | assert_eq!(format!("{}", error), "Partition does not support FIPS")
|
4806 4758 | }
|
4807 4759 |
|
4808 4760 | /// path style + accelerate = error@cn-north-1
|
4809 4761 | #[test]
|
4810 - | fn test_173() {
|
4762 + | fn test_172() {
|
4811 4763 | let params = crate::config::endpoint::Params::builder()
|
4812 4764 | .accelerate(true)
|
4813 4765 | .bucket("bucket-name".to_string())
|
4814 4766 | .force_path_style(true)
|
4815 4767 | .region("cn-north-1".to_string())
|
4816 4768 | .use_dual_stack(false)
|
4817 4769 | .use_fips(false)
|
4818 4770 | .build()
|
4819 4771 | .expect("invalid params");
|
4820 4772 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4821 4773 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4822 4774 | let error = endpoint
|
4823 4775 | .expect_err("expected error: Path-style addressing cannot be used with S3 Accelerate [path style + accelerate = error@cn-north-1]");
|
4824 4776 | assert_eq!(format!("{}", error), "Path-style addressing cannot be used with S3 Accelerate")
|
4825 4777 | }
|
4826 4778 |
|
4827 4779 | /// path style + dualstack@cn-north-1
|
4828 4780 | #[test]
|
4829 - | fn test_174() {
|
4781 + | fn test_173() {
|
4830 4782 | let params = crate::config::endpoint::Params::builder()
|
4831 4783 | .accelerate(false)
|
4832 4784 | .bucket("bucket-name".to_string())
|
4833 4785 | .force_path_style(true)
|
4834 4786 | .region("cn-north-1".to_string())
|
4835 4787 | .use_dual_stack(true)
|
4836 4788 | .use_fips(false)
|
4837 4789 | .build()
|
4838 4790 | .expect("invalid params");
|
4839 4791 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4840 4792 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4841 4793 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.dualstack.cn-north-1.amazonaws.com.cn/bucket-name");
|
4842 4794 | assert_eq!(
|
4843 4795 | endpoint,
|
4844 4796 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4845 4797 | .url("https://s3.dualstack.cn-north-1.amazonaws.com.cn/bucket-name")
|
4846 4798 | .property(
|
4847 4799 | "authSchemes",
|
4848 4800 | vec![::aws_smithy_types::Document::from({
|
4849 4801 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4850 4802 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4851 4803 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4852 4804 | out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
|
4853 4805 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4854 4806 | out
|
4855 4807 | })]
|
4856 4808 | )
|
4857 4809 | .build()
|
4858 4810 | );
|
4859 4811 | }
|
4860 4812 |
|
4861 4813 | /// path style + arn is error@cn-north-1
|
4862 4814 | #[test]
|
4863 - | fn test_175() {
|
4815 + | fn test_174() {
|
4864 4816 | let params = crate::config::endpoint::Params::builder()
|
4865 4817 | .accelerate(false)
|
4866 4818 | .bucket("arn:PARTITION:s3-outposts:REGION:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
|
4867 4819 | .force_path_style(true)
|
4868 4820 | .region("cn-north-1".to_string())
|
4869 4821 | .use_dual_stack(false)
|
4870 4822 | .use_fips(false)
|
4871 4823 | .build()
|
4872 4824 | .expect("invalid params");
|
4873 4825 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4874 4826 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4875 4827 | let error =
|
4876 4828 | endpoint.expect_err("expected error: Path-style addressing cannot be used with ARN buckets [path style + arn is error@cn-north-1]");
|
4877 4829 | assert_eq!(format!("{}", error), "Path-style addressing cannot be used with ARN buckets")
|
4878 4830 | }
|
4879 4831 |
|
4880 4832 | /// path style + invalid DNS name@cn-north-1
|
4881 4833 | #[test]
|
4882 - | fn test_176() {
|
4834 + | fn test_175() {
|
4883 4835 | let params = crate::config::endpoint::Params::builder()
|
4884 4836 | .accelerate(false)
|
4885 4837 | .bucket("99a_b".to_string())
|
4886 4838 | .force_path_style(true)
|
4887 4839 | .region("cn-north-1".to_string())
|
4888 4840 | .use_dual_stack(false)
|
4889 4841 | .use_fips(false)
|
4890 4842 | .build()
|
4891 4843 | .expect("invalid params");
|
4892 4844 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4893 4845 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4894 4846 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.cn-north-1.amazonaws.com.cn/99a_b");
|
4895 4847 | assert_eq!(
|
4896 4848 | endpoint,
|
4897 4849 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4898 4850 | .url("https://s3.cn-north-1.amazonaws.com.cn/99a_b")
|
4899 4851 | .property(
|
4900 4852 | "authSchemes",
|
4901 4853 | vec![::aws_smithy_types::Document::from({
|
4902 4854 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4903 4855 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4904 4856 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4905 4857 | out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
|
4906 4858 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4907 4859 | out
|
4908 4860 | })]
|
4909 4861 | )
|
4910 4862 | .build()
|
4911 4863 | );
|
4912 4864 | }
|
4913 4865 |
|
4914 4866 | /// no path style + invalid DNS name@cn-north-1
|
4915 4867 | #[test]
|
4916 - | fn test_177() {
|
4868 + | fn test_176() {
|
4917 4869 | let params = crate::config::endpoint::Params::builder()
|
4918 4870 | .accelerate(false)
|
4919 4871 | .bucket("99a_b".to_string())
|
4920 4872 | .region("cn-north-1".to_string())
|
4921 4873 | .use_dual_stack(false)
|
4922 4874 | .use_fips(false)
|
4923 4875 | .build()
|
4924 4876 | .expect("invalid params");
|
4925 4877 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4926 4878 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4927 4879 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.cn-north-1.amazonaws.com.cn/99a_b");
|
4928 4880 | assert_eq!(
|
4929 4881 | endpoint,
|
4930 4882 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4931 4883 | .url("https://s3.cn-north-1.amazonaws.com.cn/99a_b")
|
4932 4884 | .property(
|
4933 4885 | "authSchemes",
|
4934 4886 | vec![::aws_smithy_types::Document::from({
|
4935 4887 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4936 4888 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4937 4889 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4938 4890 | out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
|
4939 4891 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4940 4892 | out
|
4941 4893 | })]
|
4942 4894 | )
|
4943 4895 | .build()
|
4944 4896 | );
|
4945 4897 | }
|
4946 4898 |
|
4947 4899 | /// vanilla path style@af-south-1
|
4948 4900 | #[test]
|
4949 - | fn test_178() {
|
4901 + | fn test_177() {
|
4950 4902 | let params = crate::config::endpoint::Params::builder()
|
4951 4903 | .accelerate(false)
|
4952 4904 | .bucket("bucket-name".to_string())
|
4953 4905 | .force_path_style(true)
|
4954 4906 | .region("af-south-1".to_string())
|
4955 4907 | .use_dual_stack(false)
|
4956 4908 | .use_fips(false)
|
4957 4909 | .build()
|
4958 4910 | .expect("invalid params");
|
4959 4911 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4960 4912 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4961 4913 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.af-south-1.amazonaws.com/bucket-name");
|
4962 4914 | assert_eq!(
|
4963 4915 | endpoint,
|
4964 4916 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4965 4917 | .url("https://s3.af-south-1.amazonaws.com/bucket-name")
|
4966 4918 | .property(
|
4967 4919 | "authSchemes",
|
4968 4920 | vec![::aws_smithy_types::Document::from({
|
4969 4921 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
4970 4922 | out.insert("name".to_string(), "sigv4".to_string().into());
|
4971 4923 | out.insert("signingName".to_string(), "s3".to_string().into());
|
4972 4924 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
4973 4925 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
4974 4926 | out
|
4975 4927 | })]
|
4976 4928 | )
|
4977 4929 | .build()
|
4978 4930 | );
|
4979 4931 | }
|
4980 4932 |
|
4981 4933 | /// path style + fips@af-south-1
|
4982 4934 | #[test]
|
4983 - | fn test_179() {
|
4935 + | fn test_178() {
|
4984 4936 | let params = crate::config::endpoint::Params::builder()
|
4985 4937 | .accelerate(false)
|
4986 4938 | .bucket("bucket-name".to_string())
|
4987 4939 | .force_path_style(true)
|
4988 4940 | .region("af-south-1".to_string())
|
4989 4941 | .use_dual_stack(false)
|
4990 4942 | .use_fips(true)
|
4991 4943 | .build()
|
4992 4944 | .expect("invalid params");
|
4993 4945 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
4994 4946 | let endpoint = resolver.resolve_endpoint(¶ms);
|
4995 4947 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-fips.af-south-1.amazonaws.com/bucket-name");
|
4996 4948 | assert_eq!(
|
4997 4949 | endpoint,
|
4998 4950 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
4999 4951 | .url("https://s3-fips.af-south-1.amazonaws.com/bucket-name")
|
5000 4952 | .property(
|
5001 4953 | "authSchemes",
|
5002 4954 | vec![::aws_smithy_types::Document::from({
|
5003 4955 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5004 4956 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5005 4957 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
5006 4958 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5007 4959 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5008 4960 | out
|
5009 4961 | })]
|
5010 4962 | )
|
5011 4963 | .build()
|
5012 4964 | );
|
5013 4965 | }
|
5014 4966 |
|
5015 4967 | /// path style + accelerate = error@af-south-1
|
5016 4968 | #[test]
|
5017 - | fn test_180() {
|
4969 + | fn test_179() {
|
5018 4970 | let params = crate::config::endpoint::Params::builder()
|
5019 4971 | .accelerate(true)
|
5020 4972 | .bucket("bucket-name".to_string())
|
5021 4973 | .force_path_style(true)
|
5022 4974 | .region("af-south-1".to_string())
|
5023 4975 | .use_dual_stack(false)
|
5024 4976 | .use_fips(false)
|
5025 4977 | .build()
|
5026 4978 | .expect("invalid params");
|
5027 4979 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5028 4980 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5029 4981 | let error = endpoint
|
5030 4982 | .expect_err("expected error: Path-style addressing cannot be used with S3 Accelerate [path style + accelerate = error@af-south-1]");
|
5031 4983 | assert_eq!(format!("{}", error), "Path-style addressing cannot be used with S3 Accelerate")
|
5032 4984 | }
|
5033 4985 |
|
5034 4986 | /// path style + dualstack@af-south-1
|
5035 4987 | #[test]
|
5036 - | fn test_181() {
|
4988 + | fn test_180() {
|
5037 4989 | let params = crate::config::endpoint::Params::builder()
|
5038 4990 | .accelerate(false)
|
5039 4991 | .bucket("bucket-name".to_string())
|
5040 4992 | .force_path_style(true)
|
5041 4993 | .region("af-south-1".to_string())
|
5042 4994 | .use_dual_stack(true)
|
5043 4995 | .use_fips(false)
|
5044 4996 | .build()
|
5045 4997 | .expect("invalid params");
|
5046 4998 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5047 4999 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5048 5000 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.dualstack.af-south-1.amazonaws.com/bucket-name");
|
5049 5001 | assert_eq!(
|
5050 5002 | endpoint,
|
5051 5003 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5052 5004 | .url("https://s3.dualstack.af-south-1.amazonaws.com/bucket-name")
|
5053 5005 | .property(
|
5054 5006 | "authSchemes",
|
5055 5007 | vec![::aws_smithy_types::Document::from({
|
5056 5008 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5057 5009 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5058 5010 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5059 5011 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
5060 5012 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5061 5013 | out
|
5062 5014 | })]
|
5063 5015 | )
|
5064 5016 | .build()
|
5065 5017 | );
|
5066 5018 | }
|
5067 5019 |
|
5068 5020 | /// path style + arn is error@af-south-1
|
5069 5021 | #[test]
|
5070 - | fn test_182() {
|
5022 + | fn test_181() {
|
5071 5023 | let params = crate::config::endpoint::Params::builder()
|
5072 5024 | .accelerate(false)
|
5073 5025 | .bucket("arn:PARTITION:s3-outposts:REGION:123456789012:outpost:op-01234567890123456:bucket:mybucket".to_string())
|
5074 5026 | .force_path_style(true)
|
5075 5027 | .region("af-south-1".to_string())
|
5076 5028 | .use_dual_stack(false)
|
5077 5029 | .use_fips(false)
|
5078 5030 | .build()
|
5079 5031 | .expect("invalid params");
|
5080 5032 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5081 5033 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5082 5034 | let error =
|
5083 5035 | endpoint.expect_err("expected error: Path-style addressing cannot be used with ARN buckets [path style + arn is error@af-south-1]");
|
5084 5036 | assert_eq!(format!("{}", error), "Path-style addressing cannot be used with ARN buckets")
|
5085 5037 | }
|
5086 5038 |
|
5087 5039 | /// path style + invalid DNS name@af-south-1
|
5088 5040 | #[test]
|
5089 - | fn test_183() {
|
5041 + | fn test_182() {
|
5090 5042 | let params = crate::config::endpoint::Params::builder()
|
5091 5043 | .accelerate(false)
|
5092 5044 | .bucket("99a_b".to_string())
|
5093 5045 | .force_path_style(true)
|
5094 5046 | .region("af-south-1".to_string())
|
5095 5047 | .use_dual_stack(false)
|
5096 5048 | .use_fips(false)
|
5097 5049 | .build()
|
5098 5050 | .expect("invalid params");
|
5099 5051 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5100 5052 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5101 5053 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.af-south-1.amazonaws.com/99a_b");
|
5102 5054 | assert_eq!(
|
5103 5055 | endpoint,
|
5104 5056 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5105 5057 | .url("https://s3.af-south-1.amazonaws.com/99a_b")
|
5106 5058 | .property(
|
5107 5059 | "authSchemes",
|
5108 5060 | vec![::aws_smithy_types::Document::from({
|
5109 5061 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5110 5062 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5111 5063 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5112 5064 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
5113 5065 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5114 5066 | out
|
5115 5067 | })]
|
5116 5068 | )
|
5117 5069 | .build()
|
5118 5070 | );
|
5119 5071 | }
|
5120 5072 |
|
5121 5073 | /// no path style + invalid DNS name@af-south-1
|
5122 5074 | #[test]
|
5123 - | fn test_184() {
|
5075 + | fn test_183() {
|
5124 5076 | let params = crate::config::endpoint::Params::builder()
|
5125 5077 | .accelerate(false)
|
5126 5078 | .bucket("99a_b".to_string())
|
5127 5079 | .region("af-south-1".to_string())
|
5128 5080 | .use_dual_stack(false)
|
5129 5081 | .use_fips(false)
|
5130 5082 | .build()
|
5131 5083 | .expect("invalid params");
|
5132 5084 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5133 5085 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5134 5086 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3.af-south-1.amazonaws.com/99a_b");
|
5135 5087 | assert_eq!(
|
5136 5088 | endpoint,
|
5137 5089 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5138 5090 | .url("https://s3.af-south-1.amazonaws.com/99a_b")
|
5139 5091 | .property(
|
5140 5092 | "authSchemes",
|
5141 5093 | vec![::aws_smithy_types::Document::from({
|
5142 5094 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5143 5095 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5144 5096 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5145 5097 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
5146 5098 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5147 5099 | out
|
5148 5100 | })]
|
5149 5101 | )
|
5150 5102 | .build()
|
5151 5103 | );
|
5152 5104 | }
|
5153 5105 |
|
5154 5106 | /// virtual addressing + private link@us-west-2
|
5155 5107 | #[test]
|
5156 - | fn test_185() {
|
5108 + | fn test_184() {
|
5157 5109 | let params = crate::config::endpoint::Params::builder()
|
5158 5110 | .accelerate(false)
|
5159 5111 | .bucket("bucket-name".to_string())
|
5160 5112 | .force_path_style(false)
|
5161 5113 | .endpoint("http://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5162 5114 | .region("us-west-2".to_string())
|
5163 5115 | .use_dual_stack(false)
|
5164 5116 | .use_fips(false)
|
5165 5117 | .build()
|
5166 5118 | .expect("invalid params");
|
5167 5119 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5168 5120 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5169 5121 | let endpoint = endpoint.expect("Expected valid endpoint: http://bucket-name.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com");
|
5170 5122 | assert_eq!(
|
5171 5123 | endpoint,
|
5172 5124 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5173 5125 | .url("http://bucket-name.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com")
|
5174 5126 | .property(
|
5175 5127 | "authSchemes",
|
5176 5128 | vec![::aws_smithy_types::Document::from({
|
5177 5129 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5178 5130 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5179 5131 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5180 5132 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
5181 5133 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5182 5134 | out
|
5183 5135 | })]
|
5184 5136 | )
|
5185 5137 | .build()
|
5186 5138 | );
|
5187 5139 | }
|
5188 5140 |
|
5189 5141 | /// path style + private link@us-west-2
|
5190 5142 | #[test]
|
5191 - | fn test_186() {
|
5143 + | fn test_185() {
|
5192 5144 | let params = crate::config::endpoint::Params::builder()
|
5193 5145 | .accelerate(false)
|
5194 5146 | .bucket("bucket-name".to_string())
|
5195 5147 | .force_path_style(true)
|
5196 5148 | .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5197 5149 | .region("us-west-2".to_string())
|
5198 5150 | .use_dual_stack(false)
|
5199 5151 | .use_fips(false)
|
5200 5152 | .build()
|
5201 5153 | .expect("invalid params");
|
5202 5154 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5203 5155 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5204 5156 | let endpoint = endpoint.expect("Expected valid endpoint: https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name");
|
5205 5157 | assert_eq!(
|
5206 5158 | endpoint,
|
5207 5159 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5208 5160 | .url("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name")
|
5209 5161 | .property(
|
5210 5162 | "authSchemes",
|
5211 5163 | vec![::aws_smithy_types::Document::from({
|
5212 5164 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5213 5165 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5214 5166 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5215 5167 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
5216 5168 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5217 5169 | out
|
5218 5170 | })]
|
5219 5171 | )
|
5220 5172 | .build()
|
5221 5173 | );
|
5222 5174 | }
|
5223 5175 |
|
5224 5176 | /// SDK::Host + FIPS@us-west-2
|
5225 5177 | #[test]
|
5226 - | fn test_187() {
|
5178 + | fn test_186() {
|
5227 5179 | let params = crate::config::endpoint::Params::builder()
|
5228 5180 | .accelerate(false)
|
5229 5181 | .bucket("bucket-name".to_string())
|
5230 5182 | .force_path_style(false)
|
5231 5183 | .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5232 5184 | .region("us-west-2".to_string())
|
5233 5185 | .use_dual_stack(false)
|
5234 5186 | .use_fips(true)
|
5235 5187 | .build()
|
5236 5188 | .expect("invalid params");
|
5237 5189 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5238 5190 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5239 5191 | let error = endpoint.expect_err("expected error: A custom endpoint cannot be combined with FIPS [SDK::Host + FIPS@us-west-2]");
|
5240 5192 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with FIPS")
|
5241 5193 | }
|
5242 5194 |
|
5243 5195 | /// SDK::Host + DualStack@us-west-2
|
5244 5196 | #[test]
|
5245 - | fn test_188() {
|
5197 + | fn test_187() {
|
5246 5198 | let params = crate::config::endpoint::Params::builder()
|
5247 5199 | .accelerate(false)
|
5248 5200 | .bucket("bucket-name".to_string())
|
5249 5201 | .force_path_style(false)
|
5250 5202 | .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5251 5203 | .region("us-west-2".to_string())
|
5252 5204 | .use_dual_stack(true)
|
5253 5205 | .use_fips(false)
|
5254 5206 | .build()
|
5255 5207 | .expect("invalid params");
|
5256 5208 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5257 5209 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5258 5210 | let error =
|
5259 5211 | endpoint.expect_err("expected error: Cannot set dual-stack in combination with a custom endpoint. [SDK::Host + DualStack@us-west-2]");
|
5260 5212 | assert_eq!(format!("{}", error), "Cannot set dual-stack in combination with a custom endpoint.")
|
5261 5213 | }
|
5262 5214 |
|
5263 5215 | /// SDK::HOST + accelerate@us-west-2
|
5264 5216 | #[test]
|
5265 - | fn test_189() {
|
5217 + | fn test_188() {
|
5266 5218 | let params = crate::config::endpoint::Params::builder()
|
5267 5219 | .accelerate(true)
|
5268 5220 | .bucket("bucket-name".to_string())
|
5269 5221 | .force_path_style(false)
|
5270 5222 | .endpoint("http://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5271 5223 | .region("us-west-2".to_string())
|
5272 5224 | .use_dual_stack(false)
|
5273 5225 | .use_fips(false)
|
5274 5226 | .build()
|
5275 5227 | .expect("invalid params");
|
5276 5228 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5277 5229 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5278 5230 | let error = endpoint.expect_err("expected error: A custom endpoint cannot be combined with S3 Accelerate [SDK::HOST + accelerate@us-west-2]");
|
5279 5231 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with S3 Accelerate")
|
5280 5232 | }
|
5281 5233 |
|
5282 5234 | /// SDK::Host + access point ARN@us-west-2
|
5283 5235 | #[test]
|
5284 - | fn test_190() {
|
5236 + | fn test_189() {
|
5285 5237 | let params = crate::config::endpoint::Params::builder()
|
5286 5238 | .accelerate(false)
|
5287 5239 | .bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
|
5288 5240 | .force_path_style(false)
|
5289 5241 | .endpoint("https://beta.example.com".to_string())
|
5290 5242 | .region("us-west-2".to_string())
|
5291 5243 | .use_dual_stack(false)
|
5292 5244 | .use_fips(false)
|
5293 5245 | .build()
|
5294 5246 | .expect("invalid params");
|
5295 5247 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5296 5248 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5297 5249 | let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.beta.example.com");
|
5298 5250 | assert_eq!(
|
5299 5251 | endpoint,
|
5300 5252 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5301 5253 | .url("https://myendpoint-123456789012.beta.example.com")
|
5302 5254 | .property(
|
5303 5255 | "authSchemes",
|
5304 5256 | vec![::aws_smithy_types::Document::from({
|
5305 5257 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5306 5258 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5307 5259 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5308 5260 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
5309 5261 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5310 5262 | out
|
5311 5263 | })]
|
5312 5264 | )
|
5313 5265 | .build()
|
5314 5266 | );
|
5315 5267 | }
|
5316 5268 |
|
5317 5269 | /// virtual addressing + private link@cn-north-1
|
5318 5270 | #[test]
|
5319 - | fn test_191() {
|
5271 + | fn test_190() {
|
5320 5272 | let params = crate::config::endpoint::Params::builder()
|
5321 5273 | .accelerate(false)
|
5322 5274 | .bucket("bucket-name".to_string())
|
5323 5275 | .force_path_style(false)
|
5324 5276 | .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5325 5277 | .region("cn-north-1".to_string())
|
5326 5278 | .use_dual_stack(false)
|
5327 5279 | .use_fips(false)
|
5328 5280 | .build()
|
5329 5281 | .expect("invalid params");
|
5330 5282 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5331 5283 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5332 5284 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com");
|
5333 5285 | assert_eq!(
|
5334 5286 | endpoint,
|
5335 5287 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5336 5288 | .url("https://bucket-name.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com")
|
5337 5289 | .property(
|
5338 5290 | "authSchemes",
|
5339 5291 | vec![::aws_smithy_types::Document::from({
|
5340 5292 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5341 5293 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5342 5294 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5343 5295 | out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
|
5344 5296 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5345 5297 | out
|
5346 5298 | })]
|
5347 5299 | )
|
5348 5300 | .build()
|
5349 5301 | );
|
5350 5302 | }
|
5351 5303 |
|
5352 5304 | /// path style + private link@cn-north-1
|
5353 5305 | #[test]
|
5354 - | fn test_192() {
|
5306 + | fn test_191() {
|
5355 5307 | let params = crate::config::endpoint::Params::builder()
|
5356 5308 | .accelerate(false)
|
5357 5309 | .bucket("bucket-name".to_string())
|
5358 5310 | .force_path_style(true)
|
5359 5311 | .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5360 5312 | .region("cn-north-1".to_string())
|
5361 5313 | .use_dual_stack(false)
|
5362 5314 | .use_fips(false)
|
5363 5315 | .build()
|
5364 5316 | .expect("invalid params");
|
5365 5317 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5366 5318 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5367 5319 | let endpoint = endpoint.expect("Expected valid endpoint: https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name");
|
5368 5320 | assert_eq!(
|
5369 5321 | endpoint,
|
5370 5322 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5371 5323 | .url("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name")
|
5372 5324 | .property(
|
5373 5325 | "authSchemes",
|
5374 5326 | vec![::aws_smithy_types::Document::from({
|
5375 5327 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5376 5328 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5377 5329 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5378 5330 | out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
|
5379 5331 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5380 5332 | out
|
5381 5333 | })]
|
5382 5334 | )
|
5383 5335 | .build()
|
5384 5336 | );
|
5385 5337 | }
|
5386 5338 |
|
5387 5339 | /// FIPS@cn-north-1
|
5388 5340 | #[test]
|
5389 - | fn test_193() {
|
5341 + | fn test_192() {
|
5390 5342 | let params = crate::config::endpoint::Params::builder()
|
5391 5343 | .accelerate(false)
|
5392 5344 | .bucket("bucket-name".to_string())
|
5393 5345 | .force_path_style(false)
|
5394 5346 | .region("cn-north-1".to_string())
|
5395 5347 | .use_dual_stack(false)
|
5396 5348 | .use_fips(true)
|
5397 5349 | .build()
|
5398 5350 | .expect("invalid params");
|
5399 5351 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5400 5352 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5401 5353 | let error = endpoint.expect_err("expected error: Partition does not support FIPS [FIPS@cn-north-1]");
|
5402 5354 | assert_eq!(format!("{}", error), "Partition does not support FIPS")
|
5403 5355 | }
|
5404 5356 |
|
5405 5357 | /// SDK::Host + DualStack@cn-north-1
|
5406 5358 | #[test]
|
5407 - | fn test_194() {
|
5359 + | fn test_193() {
|
5408 5360 | let params = crate::config::endpoint::Params::builder()
|
5409 5361 | .accelerate(false)
|
5410 5362 | .bucket("bucket-name".to_string())
|
5411 5363 | .force_path_style(false)
|
5412 5364 | .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5413 5365 | .region("cn-north-1".to_string())
|
5414 5366 | .use_dual_stack(true)
|
5415 5367 | .use_fips(false)
|
5416 5368 | .build()
|
5417 5369 | .expect("invalid params");
|
5418 5370 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5419 5371 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5420 5372 | let error =
|
5421 5373 | endpoint.expect_err("expected error: Cannot set dual-stack in combination with a custom endpoint. [SDK::Host + DualStack@cn-north-1]");
|
5422 5374 | assert_eq!(format!("{}", error), "Cannot set dual-stack in combination with a custom endpoint.")
|
5423 5375 | }
|
5424 5376 |
|
5425 5377 | /// SDK::HOST + accelerate@cn-north-1
|
5426 5378 | #[test]
|
5427 - | fn test_195() {
|
5379 + | fn test_194() {
|
5428 5380 | let params = crate::config::endpoint::Params::builder()
|
5429 5381 | .accelerate(true)
|
5430 5382 | .bucket("bucket-name".to_string())
|
5431 5383 | .force_path_style(false)
|
5432 5384 | .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5433 5385 | .region("cn-north-1".to_string())
|
5434 5386 | .use_dual_stack(false)
|
5435 5387 | .use_fips(false)
|
5436 5388 | .build()
|
5437 5389 | .expect("invalid params");
|
5438 5390 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5439 5391 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5440 5392 | let error =
|
5441 5393 | endpoint.expect_err("expected error: A custom endpoint cannot be combined with S3 Accelerate [SDK::HOST + accelerate@cn-north-1]");
|
5442 5394 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with S3 Accelerate")
|
5443 5395 | }
|
5444 5396 |
|
5445 5397 | /// SDK::Host + access point ARN@cn-north-1
|
5446 5398 | #[test]
|
5447 - | fn test_196() {
|
5399 + | fn test_195() {
|
5448 5400 | let params = crate::config::endpoint::Params::builder()
|
5449 5401 | .accelerate(false)
|
5450 5402 | .bucket("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint".to_string())
|
5451 5403 | .force_path_style(false)
|
5452 5404 | .endpoint("https://beta.example.com".to_string())
|
5453 5405 | .region("cn-north-1".to_string())
|
5454 5406 | .use_dual_stack(false)
|
5455 5407 | .use_fips(false)
|
5456 5408 | .build()
|
5457 5409 | .expect("invalid params");
|
5458 5410 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5459 5411 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5460 5412 | let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.beta.example.com");
|
5461 5413 | assert_eq!(
|
5462 5414 | endpoint,
|
5463 5415 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5464 5416 | .url("https://myendpoint-123456789012.beta.example.com")
|
5465 5417 | .property(
|
5466 5418 | "authSchemes",
|
5467 5419 | vec![::aws_smithy_types::Document::from({
|
5468 5420 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5469 5421 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5470 5422 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5471 5423 | out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
|
5472 5424 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5473 5425 | out
|
5474 5426 | })]
|
5475 5427 | )
|
5476 5428 | .build()
|
5477 5429 | );
|
5478 5430 | }
|
5479 5431 |
|
5480 5432 | /// virtual addressing + private link@af-south-1
|
5481 5433 | #[test]
|
5482 - | fn test_197() {
|
5434 + | fn test_196() {
|
5483 5435 | let params = crate::config::endpoint::Params::builder()
|
5484 5436 | .accelerate(false)
|
5485 5437 | .bucket("bucket-name".to_string())
|
5486 5438 | .force_path_style(false)
|
5487 5439 | .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5488 5440 | .region("af-south-1".to_string())
|
5489 5441 | .use_dual_stack(false)
|
5490 5442 | .use_fips(false)
|
5491 5443 | .build()
|
5492 5444 | .expect("invalid params");
|
5493 5445 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5494 5446 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5495 5447 | let endpoint = endpoint.expect("Expected valid endpoint: https://bucket-name.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com");
|
5496 5448 | assert_eq!(
|
5497 5449 | endpoint,
|
5498 5450 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5499 5451 | .url("https://bucket-name.control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com")
|
5500 5452 | .property(
|
5501 5453 | "authSchemes",
|
5502 5454 | vec![::aws_smithy_types::Document::from({
|
5503 5455 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5504 5456 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5505 5457 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5506 5458 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
5507 5459 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5508 5460 | out
|
5509 5461 | })]
|
5510 5462 | )
|
5511 5463 | .build()
|
5512 5464 | );
|
5513 5465 | }
|
5514 5466 |
|
5515 5467 | /// path style + private link@af-south-1
|
5516 5468 | #[test]
|
5517 - | fn test_198() {
|
5469 + | fn test_197() {
|
5518 5470 | let params = crate::config::endpoint::Params::builder()
|
5519 5471 | .accelerate(false)
|
5520 5472 | .bucket("bucket-name".to_string())
|
5521 5473 | .force_path_style(true)
|
5522 5474 | .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5523 5475 | .region("af-south-1".to_string())
|
5524 5476 | .use_dual_stack(false)
|
5525 5477 | .use_fips(false)
|
5526 5478 | .build()
|
5527 5479 | .expect("invalid params");
|
5528 5480 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5529 5481 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5530 5482 | let endpoint = endpoint.expect("Expected valid endpoint: https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name");
|
5531 5483 | assert_eq!(
|
5532 5484 | endpoint,
|
5533 5485 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5534 5486 | .url("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name")
|
5535 5487 | .property(
|
5536 5488 | "authSchemes",
|
5537 5489 | vec![::aws_smithy_types::Document::from({
|
5538 5490 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5539 5491 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5540 5492 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5541 5493 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
5542 5494 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5543 5495 | out
|
5544 5496 | })]
|
5545 5497 | )
|
5546 5498 | .build()
|
5547 5499 | );
|
5548 5500 | }
|
5549 5501 |
|
5550 5502 | /// SDK::Host + FIPS@af-south-1
|
5551 5503 | #[test]
|
5552 - | fn test_199() {
|
5504 + | fn test_198() {
|
5553 5505 | let params = crate::config::endpoint::Params::builder()
|
5554 5506 | .accelerate(false)
|
5555 5507 | .bucket("bucket-name".to_string())
|
5556 5508 | .force_path_style(false)
|
5557 5509 | .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5558 5510 | .region("af-south-1".to_string())
|
5559 5511 | .use_dual_stack(false)
|
5560 5512 | .use_fips(true)
|
5561 5513 | .build()
|
5562 5514 | .expect("invalid params");
|
5563 5515 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5564 5516 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5565 5517 | let error = endpoint.expect_err("expected error: A custom endpoint cannot be combined with FIPS [SDK::Host + FIPS@af-south-1]");
|
5566 5518 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with FIPS")
|
5567 5519 | }
|
5568 5520 |
|
5569 5521 | /// SDK::Host + DualStack@af-south-1
|
5570 5522 | #[test]
|
5571 - | fn test_200() {
|
5523 + | fn test_199() {
|
5572 5524 | let params = crate::config::endpoint::Params::builder()
|
5573 5525 | .accelerate(false)
|
5574 5526 | .bucket("bucket-name".to_string())
|
5575 5527 | .force_path_style(false)
|
5576 5528 | .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5577 5529 | .region("af-south-1".to_string())
|
5578 5530 | .use_dual_stack(true)
|
5579 5531 | .use_fips(false)
|
5580 5532 | .build()
|
5581 5533 | .expect("invalid params");
|
5582 5534 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5583 5535 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5584 5536 | let error =
|
5585 5537 | endpoint.expect_err("expected error: Cannot set dual-stack in combination with a custom endpoint. [SDK::Host + DualStack@af-south-1]");
|
5586 5538 | assert_eq!(format!("{}", error), "Cannot set dual-stack in combination with a custom endpoint.")
|
5587 5539 | }
|
5588 5540 |
|
5589 5541 | /// SDK::HOST + accelerate@af-south-1
|
5590 5542 | #[test]
|
5591 - | fn test_201() {
|
5543 + | fn test_200() {
|
5592 5544 | let params = crate::config::endpoint::Params::builder()
|
5593 5545 | .accelerate(true)
|
5594 5546 | .bucket("bucket-name".to_string())
|
5595 5547 | .force_path_style(false)
|
5596 5548 | .endpoint("https://control.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com".to_string())
|
5597 5549 | .region("af-south-1".to_string())
|
5598 5550 | .use_dual_stack(false)
|
5599 5551 | .use_fips(false)
|
5600 5552 | .build()
|
5601 5553 | .expect("invalid params");
|
5602 5554 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5603 5555 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5604 5556 | let error =
|
5605 5557 | endpoint.expect_err("expected error: A custom endpoint cannot be combined with S3 Accelerate [SDK::HOST + accelerate@af-south-1]");
|
5606 5558 | assert_eq!(format!("{}", error), "A custom endpoint cannot be combined with S3 Accelerate")
|
5607 5559 | }
|
5608 5560 |
|
5609 5561 | /// SDK::Host + access point ARN@af-south-1
|
5610 5562 | #[test]
|
5611 - | fn test_202() {
|
5563 + | fn test_201() {
|
5612 5564 | let params = crate::config::endpoint::Params::builder()
|
5613 5565 | .accelerate(false)
|
5614 5566 | .bucket("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint".to_string())
|
5615 5567 | .force_path_style(false)
|
5616 5568 | .endpoint("https://beta.example.com".to_string())
|
5617 5569 | .region("af-south-1".to_string())
|
5618 5570 | .use_dual_stack(false)
|
5619 5571 | .use_fips(false)
|
5620 5572 | .build()
|
5621 5573 | .expect("invalid params");
|
5622 5574 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5623 5575 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5624 5576 | let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.beta.example.com");
|
5625 5577 | assert_eq!(
|
5626 5578 | endpoint,
|
5627 5579 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5628 5580 | .url("https://myendpoint-123456789012.beta.example.com")
|
5629 5581 | .property(
|
5630 5582 | "authSchemes",
|
5631 5583 | vec![::aws_smithy_types::Document::from({
|
5632 5584 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5633 5585 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5634 5586 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5635 5587 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
5636 5588 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5637 5589 | out
|
5638 5590 | })]
|
5639 5591 | )
|
5640 5592 | .build()
|
5641 5593 | );
|
5642 5594 | }
|
5643 5595 |
|
5644 5596 | /// vanilla access point arn@us-west-2
|
5645 5597 | #[test]
|
5646 - | fn test_203() {
|
5598 + | fn test_202() {
|
5647 5599 | let params = crate::config::endpoint::Params::builder()
|
5648 5600 | .accelerate(false)
|
5649 5601 | .bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
|
5650 5602 | .force_path_style(false)
|
5651 5603 | .region("us-west-2".to_string())
|
5652 5604 | .use_dual_stack(false)
|
5653 5605 | .use_fips(false)
|
5654 5606 | .build()
|
5655 5607 | .expect("invalid params");
|
5656 5608 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5657 5609 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5658 5610 | let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com");
|
5659 5611 | assert_eq!(
|
5660 5612 | endpoint,
|
5661 5613 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5662 5614 | .url("https://myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com")
|
5663 5615 | .property(
|
5664 5616 | "authSchemes",
|
5665 5617 | vec![::aws_smithy_types::Document::from({
|
5666 5618 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5667 5619 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5668 5620 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5669 5621 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
5670 5622 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5671 5623 | out
|
5672 5624 | })]
|
5673 5625 | )
|
5674 5626 | .build()
|
5675 5627 | );
|
5676 5628 | }
|
5677 5629 |
|
5678 5630 | /// access point arn + FIPS@us-west-2
|
5679 5631 | #[test]
|
5680 - | fn test_204() {
|
5632 + | fn test_203() {
|
5681 5633 | let params = crate::config::endpoint::Params::builder()
|
5682 5634 | .accelerate(false)
|
5683 5635 | .bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
|
5684 5636 | .force_path_style(false)
|
5685 5637 | .region("us-west-2".to_string())
|
5686 5638 | .use_dual_stack(false)
|
5687 5639 | .use_fips(true)
|
5688 5640 | .build()
|
5689 5641 | .expect("invalid params");
|
5690 5642 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5691 5643 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5692 5644 | let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint-fips.us-west-2.amazonaws.com");
|
5693 5645 | assert_eq!(
|
5694 5646 | endpoint,
|
5695 5647 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5696 5648 | .url("https://myendpoint-123456789012.s3-accesspoint-fips.us-west-2.amazonaws.com")
|
5697 5649 | .property(
|
5698 5650 | "authSchemes",
|
5699 5651 | vec![::aws_smithy_types::Document::from({
|
5700 5652 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5701 5653 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5702 5654 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5703 5655 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
5704 5656 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5705 5657 | out
|
5706 5658 | })]
|
5707 5659 | )
|
5708 5660 | .build()
|
5709 5661 | );
|
5710 5662 | }
|
5711 5663 |
|
5712 5664 | /// access point arn + accelerate = error@us-west-2
|
5713 5665 | #[test]
|
5714 - | fn test_205() {
|
5666 + | fn test_204() {
|
5715 5667 | let params = crate::config::endpoint::Params::builder()
|
5716 5668 | .accelerate(true)
|
5717 5669 | .bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
|
5718 5670 | .force_path_style(false)
|
5719 5671 | .region("us-west-2".to_string())
|
5720 5672 | .use_dual_stack(false)
|
5721 5673 | .use_fips(false)
|
5722 5674 | .build()
|
5723 5675 | .expect("invalid params");
|
5724 5676 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5725 5677 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5726 5678 | let error =
|
5727 5679 | endpoint.expect_err("expected error: Access Points do not support S3 Accelerate [access point arn + accelerate = error@us-west-2]");
|
5728 5680 | assert_eq!(format!("{}", error), "Access Points do not support S3 Accelerate")
|
5729 5681 | }
|
5730 5682 |
|
5731 5683 | /// access point arn + FIPS + DualStack@us-west-2
|
5732 5684 | #[test]
|
5733 - | fn test_206() {
|
5685 + | fn test_205() {
|
5734 5686 | let params = crate::config::endpoint::Params::builder()
|
5735 5687 | .accelerate(false)
|
5736 5688 | .bucket("arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint".to_string())
|
5737 5689 | .force_path_style(false)
|
5738 5690 | .region("us-west-2".to_string())
|
5739 5691 | .use_dual_stack(true)
|
5740 5692 | .use_fips(true)
|
5741 5693 | .build()
|
5742 5694 | .expect("invalid params");
|
5743 5695 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5744 5696 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5745 5697 | let endpoint =
|
5746 5698 | endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint-fips.dualstack.us-west-2.amazonaws.com");
|
5747 5699 | assert_eq!(
|
5748 5700 | endpoint,
|
5749 5701 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5750 5702 | .url("https://myendpoint-123456789012.s3-accesspoint-fips.dualstack.us-west-2.amazonaws.com")
|
5751 5703 | .property(
|
5752 5704 | "authSchemes",
|
5753 5705 | vec![::aws_smithy_types::Document::from({
|
5754 5706 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5755 5707 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5756 5708 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5757 5709 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
5758 5710 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5759 5711 | out
|
5760 5712 | })]
|
5761 5713 | )
|
5762 5714 | .build()
|
5763 5715 | );
|
5764 5716 | }
|
5765 5717 |
|
5766 5718 | /// vanilla access point arn@cn-north-1
|
5767 5719 | #[test]
|
5768 - | fn test_207() {
|
5720 + | fn test_206() {
|
5769 5721 | let params = crate::config::endpoint::Params::builder()
|
5770 5722 | .accelerate(false)
|
5771 5723 | .bucket("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint".to_string())
|
5772 5724 | .force_path_style(false)
|
5773 5725 | .region("cn-north-1".to_string())
|
5774 5726 | .use_dual_stack(false)
|
5775 5727 | .use_fips(false)
|
5776 5728 | .build()
|
5777 5729 | .expect("invalid params");
|
5778 5730 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5779 5731 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5780 5732 | let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint.cn-north-1.amazonaws.com.cn");
|
5781 5733 | assert_eq!(
|
5782 5734 | endpoint,
|
5783 5735 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5784 5736 | .url("https://myendpoint-123456789012.s3-accesspoint.cn-north-1.amazonaws.com.cn")
|
5785 5737 | .property(
|
5786 5738 | "authSchemes",
|
5787 5739 | vec![::aws_smithy_types::Document::from({
|
5788 5740 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5789 5741 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5790 5742 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5791 5743 | out.insert("signingRegion".to_string(), "cn-north-1".to_string().into());
|
5792 5744 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5793 5745 | out
|
5794 5746 | })]
|
5795 5747 | )
|
5796 5748 | .build()
|
5797 5749 | );
|
5798 5750 | }
|
5799 5751 |
|
5800 5752 | /// access point arn + FIPS@cn-north-1
|
5801 5753 | #[test]
|
5802 - | fn test_208() {
|
5754 + | fn test_207() {
|
5803 5755 | let params = crate::config::endpoint::Params::builder()
|
5804 5756 | .accelerate(false)
|
5805 5757 | .bucket("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint".to_string())
|
5806 5758 | .force_path_style(false)
|
5807 5759 | .region("cn-north-1".to_string())
|
5808 5760 | .use_dual_stack(false)
|
5809 5761 | .use_fips(true)
|
5810 5762 | .build()
|
5811 5763 | .expect("invalid params");
|
5812 5764 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5813 5765 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5814 5766 | let error = endpoint.expect_err("expected error: Partition does not support FIPS [access point arn + FIPS@cn-north-1]");
|
5815 5767 | assert_eq!(format!("{}", error), "Partition does not support FIPS")
|
5816 5768 | }
|
5817 5769 |
|
5818 5770 | /// access point arn + accelerate = error@cn-north-1
|
5819 5771 | #[test]
|
5820 - | fn test_209() {
|
5772 + | fn test_208() {
|
5821 5773 | let params = crate::config::endpoint::Params::builder()
|
5822 5774 | .accelerate(true)
|
5823 5775 | .bucket("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint".to_string())
|
5824 5776 | .force_path_style(false)
|
5825 5777 | .region("cn-north-1".to_string())
|
5826 5778 | .use_dual_stack(false)
|
5827 5779 | .use_fips(false)
|
5828 5780 | .build()
|
5829 5781 | .expect("invalid params");
|
5830 5782 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5831 5783 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5832 5784 | let error =
|
5833 5785 | endpoint.expect_err("expected error: Access Points do not support S3 Accelerate [access point arn + accelerate = error@cn-north-1]");
|
5834 5786 | assert_eq!(format!("{}", error), "Access Points do not support S3 Accelerate")
|
5835 5787 | }
|
5836 5788 |
|
5837 5789 | /// access point arn + FIPS + DualStack@cn-north-1
|
5838 5790 | #[test]
|
5839 - | fn test_210() {
|
5791 + | fn test_209() {
|
5840 5792 | let params = crate::config::endpoint::Params::builder()
|
5841 5793 | .accelerate(false)
|
5842 5794 | .bucket("arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint".to_string())
|
5843 5795 | .force_path_style(false)
|
5844 5796 | .region("cn-north-1".to_string())
|
5845 5797 | .use_dual_stack(true)
|
5846 5798 | .use_fips(true)
|
5847 5799 | .build()
|
5848 5800 | .expect("invalid params");
|
5849 5801 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5850 5802 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5851 5803 | let error = endpoint.expect_err("expected error: Partition does not support FIPS [access point arn + FIPS + DualStack@cn-north-1]");
|
5852 5804 | assert_eq!(format!("{}", error), "Partition does not support FIPS")
|
5853 5805 | }
|
5854 5806 |
|
5855 5807 | /// vanilla access point arn@af-south-1
|
5856 5808 | #[test]
|
5857 - | fn test_211() {
|
5809 + | fn test_210() {
|
5858 5810 | let params = crate::config::endpoint::Params::builder()
|
5859 5811 | .accelerate(false)
|
5860 5812 | .bucket("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint".to_string())
|
5861 5813 | .force_path_style(false)
|
5862 5814 | .region("af-south-1".to_string())
|
5863 5815 | .use_dual_stack(false)
|
5864 5816 | .use_fips(false)
|
5865 5817 | .build()
|
5866 5818 | .expect("invalid params");
|
5867 5819 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5868 5820 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5869 5821 | let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint.af-south-1.amazonaws.com");
|
5870 5822 | assert_eq!(
|
5871 5823 | endpoint,
|
5872 5824 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5873 5825 | .url("https://myendpoint-123456789012.s3-accesspoint.af-south-1.amazonaws.com")
|
5874 5826 | .property(
|
5875 5827 | "authSchemes",
|
5876 5828 | vec![::aws_smithy_types::Document::from({
|
5877 5829 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5878 5830 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5879 5831 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5880 5832 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
5881 5833 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5882 5834 | out
|
5883 5835 | })]
|
5884 5836 | )
|
5885 5837 | .build()
|
5886 5838 | );
|
5887 5839 | }
|
5888 5840 |
|
5889 5841 | /// access point arn + FIPS@af-south-1
|
5890 5842 | #[test]
|
5891 - | fn test_212() {
|
5843 + | fn test_211() {
|
5892 5844 | let params = crate::config::endpoint::Params::builder()
|
5893 5845 | .accelerate(false)
|
5894 5846 | .bucket("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint".to_string())
|
5895 5847 | .force_path_style(false)
|
5896 5848 | .region("af-south-1".to_string())
|
5897 5849 | .use_dual_stack(false)
|
5898 5850 | .use_fips(true)
|
5899 5851 | .build()
|
5900 5852 | .expect("invalid params");
|
5901 5853 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5902 5854 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5903 5855 | let endpoint = endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint-fips.af-south-1.amazonaws.com");
|
5904 5856 | assert_eq!(
|
5905 5857 | endpoint,
|
5906 5858 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5907 5859 | .url("https://myendpoint-123456789012.s3-accesspoint-fips.af-south-1.amazonaws.com")
|
5908 5860 | .property(
|
5909 5861 | "authSchemes",
|
5910 5862 | vec![::aws_smithy_types::Document::from({
|
5911 5863 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5912 5864 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5913 5865 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5914 5866 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
5915 5867 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5916 5868 | out
|
5917 5869 | })]
|
5918 5870 | )
|
5919 5871 | .build()
|
5920 5872 | );
|
5921 5873 | }
|
5922 5874 |
|
5923 5875 | /// access point arn + accelerate = error@af-south-1
|
5924 5876 | #[test]
|
5925 - | fn test_213() {
|
5877 + | fn test_212() {
|
5926 5878 | let params = crate::config::endpoint::Params::builder()
|
5927 5879 | .accelerate(true)
|
5928 5880 | .bucket("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint".to_string())
|
5929 5881 | .force_path_style(false)
|
5930 5882 | .region("af-south-1".to_string())
|
5931 5883 | .use_dual_stack(false)
|
5932 5884 | .use_fips(false)
|
5933 5885 | .build()
|
5934 5886 | .expect("invalid params");
|
5935 5887 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5936 5888 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5937 5889 | let error =
|
5938 5890 | endpoint.expect_err("expected error: Access Points do not support S3 Accelerate [access point arn + accelerate = error@af-south-1]");
|
5939 5891 | assert_eq!(format!("{}", error), "Access Points do not support S3 Accelerate")
|
5940 5892 | }
|
5941 5893 |
|
5942 5894 | /// access point arn + FIPS + DualStack@af-south-1
|
5943 5895 | #[test]
|
5944 - | fn test_214() {
|
5896 + | fn test_213() {
|
5945 5897 | let params = crate::config::endpoint::Params::builder()
|
5946 5898 | .accelerate(false)
|
5947 5899 | .bucket("arn:aws:s3:af-south-1:123456789012:accesspoint:myendpoint".to_string())
|
5948 5900 | .force_path_style(false)
|
5949 5901 | .region("af-south-1".to_string())
|
5950 5902 | .use_dual_stack(true)
|
5951 5903 | .use_fips(true)
|
5952 5904 | .build()
|
5953 5905 | .expect("invalid params");
|
5954 5906 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5955 5907 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5956 5908 | let endpoint =
|
5957 5909 | endpoint.expect("Expected valid endpoint: https://myendpoint-123456789012.s3-accesspoint-fips.dualstack.af-south-1.amazonaws.com");
|
5958 5910 | assert_eq!(
|
5959 5911 | endpoint,
|
5960 5912 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5961 5913 | .url("https://myendpoint-123456789012.s3-accesspoint-fips.dualstack.af-south-1.amazonaws.com")
|
5962 5914 | .property(
|
5963 5915 | "authSchemes",
|
5964 5916 | vec![::aws_smithy_types::Document::from({
|
5965 5917 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
5966 5918 | out.insert("name".to_string(), "sigv4".to_string().into());
|
5967 5919 | out.insert("signingName".to_string(), "s3".to_string().into());
|
5968 5920 | out.insert("signingRegion".to_string(), "af-south-1".to_string().into());
|
5969 5921 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
5970 5922 | out
|
5971 5923 | })]
|
5972 5924 | )
|
5973 5925 | .build()
|
5974 5926 | );
|
5975 5927 | }
|
5976 5928 |
|
5977 5929 | /// S3 outposts vanilla test
|
5978 5930 | #[test]
|
5979 - | fn test_215() {
|
5931 + | fn test_214() {
|
5980 5932 | let params = crate::config::endpoint::Params::builder()
|
5981 5933 | .region("us-west-2".to_string())
|
5982 5934 | .use_fips(false)
|
5983 5935 | .use_dual_stack(false)
|
5984 5936 | .accelerate(false)
|
5985 5937 | .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
|
5986 5938 | .build()
|
5987 5939 | .expect("invalid params");
|
5988 5940 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
5989 5941 | let endpoint = resolver.resolve_endpoint(¶ms);
|
5990 5942 | let endpoint =
|
5991 5943 | endpoint.expect("Expected valid endpoint: https://reports-123456789012.op-01234567890123456.s3-outposts.us-west-2.amazonaws.com");
|
5992 5944 | assert_eq!(
|
5993 5945 | endpoint,
|
5994 5946 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
5995 5947 | .url("https://reports-123456789012.op-01234567890123456.s3-outposts.us-west-2.amazonaws.com")
|
5996 5948 | .property(
|
5997 5949 | "authSchemes",
|
5998 - | vec![
|
5999 - | ::aws_smithy_types::Document::from({
|
6000 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6001 - | out.insert("name".to_string(), "sigv4a".to_string().into());
|
6002 - | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
6003 - | out.insert(
|
6004 - | "signingRegionSet".to_string(),
|
6005 - | vec![::aws_smithy_types::Document::from("*".to_string())].into(),
|
6006 - | );
|
6007 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6008 - | out
|
6009 - | }),
|
6010 - | ::aws_smithy_types::Document::from({
|
5950 + | vec![::aws_smithy_types::Document::from({
|
6011 5951 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6012 5952 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6013 5953 | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
6014 5954 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
6015 5955 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6016 5956 | out
|
6017 - | })
|
6018 - | ]
|
5957 + | })]
|
6019 5958 | )
|
6020 5959 | .build()
|
6021 5960 | );
|
6022 5961 | }
|
6023 5962 |
|
6024 5963 | /// S3 outposts custom endpoint
|
6025 5964 | #[test]
|
6026 - | fn test_216() {
|
5965 + | fn test_215() {
|
6027 5966 | let params = crate::config::endpoint::Params::builder()
|
6028 5967 | .region("us-west-2".to_string())
|
6029 5968 | .use_fips(false)
|
6030 5969 | .use_dual_stack(false)
|
6031 5970 | .accelerate(false)
|
6032 5971 | .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
|
6033 5972 | .endpoint("https://example.amazonaws.com".to_string())
|
6034 5973 | .build()
|
6035 5974 | .expect("invalid params");
|
6036 5975 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6037 5976 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6038 5977 | let endpoint = endpoint.expect("Expected valid endpoint: https://reports-123456789012.op-01234567890123456.example.amazonaws.com");
|
6039 5978 | assert_eq!(
|
6040 5979 | endpoint,
|
6041 5980 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6042 5981 | .url("https://reports-123456789012.op-01234567890123456.example.amazonaws.com")
|
6043 5982 | .property(
|
6044 5983 | "authSchemes",
|
6045 - | vec![
|
6046 - | ::aws_smithy_types::Document::from({
|
6047 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6048 - | out.insert("name".to_string(), "sigv4a".to_string().into());
|
6049 - | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
6050 - | out.insert(
|
6051 - | "signingRegionSet".to_string(),
|
6052 - | vec![::aws_smithy_types::Document::from("*".to_string())].into(),
|
6053 - | );
|
6054 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6055 - | out
|
6056 - | }),
|
6057 - | ::aws_smithy_types::Document::from({
|
5984 + | vec![::aws_smithy_types::Document::from({
|
6058 5985 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6059 5986 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6060 5987 | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
6061 5988 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
6062 5989 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6063 5990 | out
|
6064 - | })
|
6065 - | ]
|
5991 + | })]
|
6066 5992 | )
|
6067 5993 | .build()
|
6068 5994 | );
|
6069 5995 | }
|
6070 5996 |
|
6071 5997 | /// outposts arn with region mismatch and UseArnRegion=false
|
6072 5998 | #[test]
|
6073 - | fn test_217() {
|
5999 + | fn test_216() {
|
6074 6000 | let params = crate::config::endpoint::Params::builder()
|
6075 6001 | .accelerate(false)
|
6076 6002 | .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
|
6077 6003 | .force_path_style(false)
|
6078 6004 | .use_arn_region(false)
|
6079 6005 | .region("us-west-2".to_string())
|
6080 6006 | .use_dual_stack(false)
|
6081 6007 | .use_fips(false)
|
6082 6008 | .build()
|
6083 6009 | .expect("invalid params");
|
6084 6010 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6085 6011 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6086 6012 | let error = endpoint.expect_err("expected error: Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false` [outposts arn with region mismatch and UseArnRegion=false]");
|
6087 6013 | assert_eq!(
|
6088 6014 | format!("{}", error),
|
6089 6015 | "Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false`"
|
6090 6016 | )
|
6091 6017 | }
|
6092 6018 |
|
6093 6019 | /// outposts arn with region mismatch, custom region and UseArnRegion=false
|
6094 6020 | #[test]
|
6095 - | fn test_218() {
|
6021 + | fn test_217() {
|
6096 6022 | let params = crate::config::endpoint::Params::builder()
|
6097 6023 | .accelerate(false)
|
6098 6024 | .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
|
6099 6025 | .endpoint("https://example.com".to_string())
|
6100 6026 | .force_path_style(false)
|
6101 6027 | .use_arn_region(false)
|
6102 6028 | .region("us-west-2".to_string())
|
6103 6029 | .use_dual_stack(false)
|
6104 6030 | .use_fips(false)
|
6105 6031 | .build()
|
6106 6032 | .expect("invalid params");
|
6107 6033 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6108 6034 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6109 6035 | let error = endpoint.expect_err("expected error: Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false` [outposts arn with region mismatch, custom region and UseArnRegion=false]");
|
6110 6036 | assert_eq!(
|
6111 6037 | format!("{}", error),
|
6112 6038 | "Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false`"
|
6113 6039 | )
|
6114 6040 | }
|
6115 6041 |
|
6116 6042 | /// outposts arn with region mismatch and UseArnRegion=true
|
6117 6043 | #[test]
|
6118 - | fn test_219() {
|
6044 + | fn test_218() {
|
6119 6045 | let params = crate::config::endpoint::Params::builder()
|
6120 6046 | .accelerate(false)
|
6121 6047 | .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
|
6122 6048 | .force_path_style(false)
|
6123 6049 | .use_arn_region(true)
|
6124 6050 | .region("us-west-2".to_string())
|
6125 6051 | .use_dual_stack(false)
|
6126 6052 | .use_fips(false)
|
6127 6053 | .build()
|
6128 6054 | .expect("invalid params");
|
6129 6055 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6130 6056 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6131 6057 | let endpoint =
|
6132 6058 | endpoint.expect("Expected valid endpoint: https://myaccesspoint-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com");
|
6133 6059 | assert_eq!(
|
6134 6060 | endpoint,
|
6135 6061 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6136 6062 | .url("https://myaccesspoint-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com")
|
6137 6063 | .property(
|
6138 6064 | "authSchemes",
|
6139 - | vec![
|
6140 - | ::aws_smithy_types::Document::from({
|
6141 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6142 - | out.insert("name".to_string(), "sigv4a".to_string().into());
|
6143 - | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
6144 - | out.insert(
|
6145 - | "signingRegionSet".to_string(),
|
6146 - | vec![::aws_smithy_types::Document::from("*".to_string())].into(),
|
6147 - | );
|
6148 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6149 - | out
|
6150 - | }),
|
6151 - | ::aws_smithy_types::Document::from({
|
6065 + | vec![::aws_smithy_types::Document::from({
|
6152 6066 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6153 6067 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6154 6068 | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
6155 6069 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
6156 6070 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6157 6071 | out
|
6158 - | })
|
6159 - | ]
|
6072 + | })]
|
6160 6073 | )
|
6161 6074 | .build()
|
6162 6075 | );
|
6163 6076 | }
|
6164 6077 |
|
6165 6078 | /// outposts arn with region mismatch and UseArnRegion unset
|
6166 6079 | #[test]
|
6167 - | fn test_220() {
|
6080 + | fn test_219() {
|
6168 6081 | let params = crate::config::endpoint::Params::builder()
|
6169 6082 | .accelerate(false)
|
6170 6083 | .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
|
6171 6084 | .force_path_style(false)
|
6172 6085 | .region("us-west-2".to_string())
|
6173 6086 | .use_dual_stack(false)
|
6174 6087 | .use_fips(false)
|
6175 6088 | .build()
|
6176 6089 | .expect("invalid params");
|
6177 6090 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6178 6091 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6179 6092 | let endpoint =
|
6180 6093 | endpoint.expect("Expected valid endpoint: https://myaccesspoint-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com");
|
6181 6094 | assert_eq!(
|
6182 6095 | endpoint,
|
6183 6096 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6184 6097 | .url("https://myaccesspoint-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com")
|
6185 6098 | .property(
|
6186 6099 | "authSchemes",
|
6187 - | vec![
|
6188 - | ::aws_smithy_types::Document::from({
|
6189 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6190 - | out.insert("name".to_string(), "sigv4a".to_string().into());
|
6191 - | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
6192 - | out.insert(
|
6193 - | "signingRegionSet".to_string(),
|
6194 - | vec![::aws_smithy_types::Document::from("*".to_string())].into(),
|
6195 - | );
|
6196 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6197 - | out
|
6198 - | }),
|
6199 - | ::aws_smithy_types::Document::from({
|
6100 + | vec![::aws_smithy_types::Document::from({
|
6200 6101 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6201 6102 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6202 6103 | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
6203 6104 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
6204 6105 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6205 6106 | out
|
6206 - | })
|
6207 - | ]
|
6107 + | })]
|
6208 6108 | )
|
6209 6109 | .build()
|
6210 6110 | );
|
6211 6111 | }
|
6212 6112 |
|
6213 6113 | /// outposts arn with partition mismatch and UseArnRegion=true
|
6214 6114 | #[test]
|
6215 - | fn test_221() {
|
6115 + | fn test_220() {
|
6216 6116 | let params = crate::config::endpoint::Params::builder()
|
6217 6117 | .accelerate(false)
|
6218 6118 | .bucket("arn:aws:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint".to_string())
|
6219 6119 | .force_path_style(false)
|
6220 6120 | .use_arn_region(true)
|
6221 6121 | .region("us-west-2".to_string())
|
6222 6122 | .use_dual_stack(false)
|
6223 6123 | .use_fips(false)
|
6224 6124 | .build()
|
6225 6125 | .expect("invalid params");
|
6226 6126 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6227 6127 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6228 6128 | let error = endpoint.expect_err("expected error: Client was configured for partition `aws` but ARN (`arn:aws:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint`) has `aws-cn` [outposts arn with partition mismatch and UseArnRegion=true]");
|
6229 6129 | assert_eq!(format!("{}", error), "Client was configured for partition `aws` but ARN (`arn:aws:s3-outposts:cn-north-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint`) has `aws-cn`")
|
6230 6130 | }
|
6231 6131 |
|
6232 6132 | /// ARN with UseGlobalEndpoint and use-east-1 region uses the regional endpoint
|
6233 6133 | #[test]
|
6234 - | fn test_222() {
|
6134 + | fn test_221() {
|
6235 6135 | let params = crate::config::endpoint::Params::builder()
|
6236 6136 | .region("us-east-1".to_string())
|
6237 6137 | .use_global_endpoint(true)
|
6238 6138 | .use_fips(false)
|
6239 6139 | .use_dual_stack(false)
|
6240 6140 | .accelerate(false)
|
6241 6141 | .bucket("arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
|
6242 6142 | .build()
|
6243 6143 | .expect("invalid params");
|
6244 6144 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6245 6145 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6246 6146 | let endpoint =
|
6247 6147 | endpoint.expect("Expected valid endpoint: https://reports-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com");
|
6248 6148 | assert_eq!(
|
6249 6149 | endpoint,
|
6250 6150 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6251 6151 | .url("https://reports-123456789012.op-01234567890123456.s3-outposts.us-east-1.amazonaws.com")
|
6252 6152 | .property(
|
6253 6153 | "authSchemes",
|
6254 - | vec![
|
6255 - | ::aws_smithy_types::Document::from({
|
6256 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6257 - | out.insert("name".to_string(), "sigv4a".to_string().into());
|
6258 - | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
6259 - | out.insert(
|
6260 - | "signingRegionSet".to_string(),
|
6261 - | vec![::aws_smithy_types::Document::from("*".to_string())].into(),
|
6262 - | );
|
6263 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6264 - | out
|
6265 - | }),
|
6266 - | ::aws_smithy_types::Document::from({
|
6154 + | vec![::aws_smithy_types::Document::from({
|
6267 6155 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6268 6156 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6269 6157 | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
6270 6158 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
6271 6159 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6272 6160 | out
|
6273 - | })
|
6274 - | ]
|
6161 + | })]
|
6275 6162 | )
|
6276 6163 | .build()
|
6277 6164 | );
|
6278 6165 | }
|
6279 6166 |
|
6280 6167 | /// S3 outposts does not support dualstack
|
6281 6168 | #[test]
|
6282 - | fn test_223() {
|
6169 + | fn test_222() {
|
6283 6170 | let params = crate::config::endpoint::Params::builder()
|
6284 6171 | .region("us-east-1".to_string())
|
6285 6172 | .use_fips(false)
|
6286 6173 | .use_dual_stack(true)
|
6287 6174 | .accelerate(false)
|
6288 6175 | .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
|
6289 6176 | .build()
|
6290 6177 | .expect("invalid params");
|
6291 6178 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6292 6179 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6293 6180 | let error = endpoint.expect_err("expected error: S3 Outposts does not support Dual-stack [S3 outposts does not support dualstack]");
|
6294 6181 | assert_eq!(format!("{}", error), "S3 Outposts does not support Dual-stack")
|
6295 6182 | }
|
6296 6183 |
|
6297 6184 | /// S3 outposts does not support fips
|
6298 6185 | #[test]
|
6299 - | fn test_224() {
|
6186 + | fn test_223() {
|
6300 6187 | let params = crate::config::endpoint::Params::builder()
|
6301 6188 | .region("us-east-1".to_string())
|
6302 6189 | .use_fips(true)
|
6303 6190 | .use_dual_stack(false)
|
6304 6191 | .accelerate(false)
|
6305 6192 | .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
|
6306 6193 | .build()
|
6307 6194 | .expect("invalid params");
|
6308 6195 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6309 6196 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6310 6197 | let error = endpoint.expect_err("expected error: S3 Outposts does not support FIPS [S3 outposts does not support fips]");
|
6311 6198 | assert_eq!(format!("{}", error), "S3 Outposts does not support FIPS")
|
6312 6199 | }
|
6313 6200 |
|
6314 6201 | /// S3 outposts does not support accelerate
|
6315 6202 | #[test]
|
6316 - | fn test_225() {
|
6203 + | fn test_224() {
|
6317 6204 | let params = crate::config::endpoint::Params::builder()
|
6318 6205 | .region("us-east-1".to_string())
|
6319 6206 | .use_fips(false)
|
6320 6207 | .use_dual_stack(false)
|
6321 6208 | .accelerate(true)
|
6322 6209 | .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost/op-01234567890123456/accesspoint/reports".to_string())
|
6323 6210 | .build()
|
6324 6211 | .expect("invalid params");
|
6325 6212 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6326 6213 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6327 6214 | let error = endpoint.expect_err("expected error: S3 Outposts does not support S3 Accelerate [S3 outposts does not support accelerate]");
|
6328 6215 | assert_eq!(format!("{}", error), "S3 Outposts does not support S3 Accelerate")
|
6329 6216 | }
|
6330 6217 |
|
6331 6218 | /// validates against subresource
|
6332 6219 | #[test]
|
6333 - | fn test_226() {
|
6220 + | fn test_225() {
|
6334 6221 | let params = crate::config::endpoint::Params::builder()
|
6335 6222 | .region("us-west-2".to_string())
|
6336 6223 | .use_fips(false)
|
6337 6224 | .use_dual_stack(false)
|
6338 6225 | .accelerate(false)
|
6339 6226 | .bucket("arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:mybucket:object:foo".to_string())
|
6340 6227 | .build()
|
6341 6228 | .expect("invalid params");
|
6342 6229 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6343 6230 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6344 6231 | let error =
|
6345 6232 | endpoint.expect_err("expected error: Invalid Arn: Outpost Access Point ARN contains sub resources [validates against subresource]");
|
6346 6233 | assert_eq!(format!("{}", error), "Invalid Arn: Outpost Access Point ARN contains sub resources")
|
6347 6234 | }
|
6348 6235 |
|
6349 6236 | /// object lambda @us-east-1
|
6350 6237 | #[test]
|
6351 - | fn test_227() {
|
6238 + | fn test_226() {
|
6352 6239 | let params = crate::config::endpoint::Params::builder()
|
6353 6240 | .region("us-east-1".to_string())
|
6354 6241 | .use_fips(false)
|
6355 6242 | .use_dual_stack(false)
|
6356 6243 | .accelerate(false)
|
6357 6244 | .use_arn_region(false)
|
6358 6245 | .bucket("arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string())
|
6359 6246 | .build()
|
6360 6247 | .expect("invalid params");
|
6361 6248 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6362 6249 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6363 6250 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com");
|
6364 6251 | assert_eq!(
|
6365 6252 | endpoint,
|
6366 6253 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6367 6254 | .url("https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com")
|
6368 6255 | .property(
|
6369 6256 | "authSchemes",
|
6370 6257 | vec![::aws_smithy_types::Document::from({
|
6371 6258 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6372 6259 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6373 6260 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
6374 6261 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
6375 6262 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6376 6263 | out
|
6377 6264 | })]
|
6378 6265 | )
|
6379 6266 | .build()
|
6380 6267 | );
|
6381 6268 | }
|
6382 6269 |
|
6383 6270 | /// object lambda @us-west-2
|
6384 6271 | #[test]
|
6385 - | fn test_228() {
|
6272 + | fn test_227() {
|
6386 6273 | let params = crate::config::endpoint::Params::builder()
|
6387 6274 | .region("us-west-2".to_string())
|
6388 6275 | .use_fips(false)
|
6389 6276 | .use_dual_stack(false)
|
6390 6277 | .accelerate(false)
|
6391 6278 | .use_arn_region(false)
|
6392 6279 | .bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint/mybanner".to_string())
|
6393 6280 | .build()
|
6394 6281 | .expect("invalid params");
|
6395 6282 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6396 6283 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6397 6284 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-west-2.amazonaws.com");
|
6398 6285 | assert_eq!(
|
6399 6286 | endpoint,
|
6400 6287 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6401 6288 | .url("https://mybanner-123456789012.s3-object-lambda.us-west-2.amazonaws.com")
|
6402 6289 | .property(
|
6403 6290 | "authSchemes",
|
6404 6291 | vec![::aws_smithy_types::Document::from({
|
6405 6292 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6406 6293 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6407 6294 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
6408 6295 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
6409 6296 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6410 6297 | out
|
6411 6298 | })]
|
6412 6299 | )
|
6413 6300 | .build()
|
6414 6301 | );
|
6415 6302 | }
|
6416 6303 |
|
6417 6304 | /// object lambda, colon resource deliminator @us-west-2
|
6418 6305 | #[test]
|
6419 - | fn test_229() {
|
6306 + | fn test_228() {
|
6420 6307 | let params = crate::config::endpoint::Params::builder()
|
6421 6308 | .region("us-west-2".to_string())
|
6422 6309 | .use_fips(false)
|
6423 6310 | .use_dual_stack(false)
|
6424 6311 | .accelerate(false)
|
6425 6312 | .use_arn_region(false)
|
6426 6313 | .bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint:mybanner".to_string())
|
6427 6314 | .build()
|
6428 6315 | .expect("invalid params");
|
6429 6316 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6430 6317 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6431 6318 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-west-2.amazonaws.com");
|
6432 6319 | assert_eq!(
|
6433 6320 | endpoint,
|
6434 6321 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6435 6322 | .url("https://mybanner-123456789012.s3-object-lambda.us-west-2.amazonaws.com")
|
6436 6323 | .property(
|
6437 6324 | "authSchemes",
|
6438 6325 | vec![::aws_smithy_types::Document::from({
|
6439 6326 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6440 6327 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6441 6328 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
6442 6329 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
6443 6330 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6444 6331 | out
|
6445 6332 | })]
|
6446 6333 | )
|
6447 6334 | .build()
|
6448 6335 | );
|
6449 6336 | }
|
6450 6337 |
|
6451 6338 | /// object lambda @us-east-1, client region us-west-2, useArnRegion=true
|
6452 6339 | #[test]
|
6453 - | fn test_230() {
|
6340 + | fn test_229() {
|
6454 6341 | let params = crate::config::endpoint::Params::builder()
|
6455 6342 | .region("us-west-2".to_string())
|
6456 6343 | .use_fips(false)
|
6457 6344 | .use_dual_stack(false)
|
6458 6345 | .accelerate(false)
|
6459 6346 | .use_arn_region(true)
|
6460 6347 | .bucket("arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string())
|
6461 6348 | .build()
|
6462 6349 | .expect("invalid params");
|
6463 6350 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6464 6351 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6465 6352 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com");
|
6466 6353 | assert_eq!(
|
6467 6354 | endpoint,
|
6468 6355 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6469 6356 | .url("https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com")
|
6470 6357 | .property(
|
6471 6358 | "authSchemes",
|
6472 6359 | vec![::aws_smithy_types::Document::from({
|
6473 6360 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6474 6361 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6475 6362 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
6476 6363 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
6477 6364 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6478 6365 | out
|
6479 6366 | })]
|
6480 6367 | )
|
6481 6368 | .build()
|
6482 6369 | );
|
6483 6370 | }
|
6484 6371 |
|
6485 6372 | /// object lambda @us-east-1, client region s3-external-1, useArnRegion=true
|
6486 6373 | #[test]
|
6487 - | fn test_231() {
|
6374 + | fn test_230() {
|
6488 6375 | let params = crate::config::endpoint::Params::builder()
|
6489 6376 | .region("s3-external-1".to_string())
|
6490 6377 | .use_fips(false)
|
6491 6378 | .use_dual_stack(false)
|
6492 6379 | .accelerate(false)
|
6493 6380 | .use_arn_region(true)
|
6494 6381 | .bucket("arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string())
|
6495 6382 | .build()
|
6496 6383 | .expect("invalid params");
|
6497 6384 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6498 6385 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6499 6386 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com");
|
6500 6387 | assert_eq!(
|
6501 6388 | endpoint,
|
6502 6389 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6503 6390 | .url("https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com")
|
6504 6391 | .property(
|
6505 6392 | "authSchemes",
|
6506 6393 | vec![::aws_smithy_types::Document::from({
|
6507 6394 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6508 6395 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6509 6396 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
6510 6397 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
6511 6398 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6512 6399 | out
|
6513 6400 | })]
|
6514 6401 | )
|
6515 6402 | .build()
|
6516 6403 | );
|
6517 6404 | }
|
6518 6405 |
|
6519 6406 | /// object lambda @us-east-1, client region s3-external-1, useArnRegion=false
|
6520 6407 | #[test]
|
6521 - | fn test_232() {
|
6408 + | fn test_231() {
|
6522 6409 | let params = crate::config::endpoint::Params::builder()
|
6523 6410 | .region("s3-external-1".to_string())
|
6524 6411 | .use_fips(false)
|
6525 6412 | .use_dual_stack(false)
|
6526 6413 | .accelerate(false)
|
6527 6414 | .use_arn_region(false)
|
6528 6415 | .bucket("arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string())
|
6529 6416 | .build()
|
6530 6417 | .expect("invalid params");
|
6531 6418 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6532 6419 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6533 6420 | let error = endpoint.expect_err("expected error: Invalid configuration: region from ARN `us-east-1` does not match client region `s3-external-1` and UseArnRegion is `false` [object lambda @us-east-1, client region s3-external-1, useArnRegion=false]");
|
6534 6421 | assert_eq!(
|
6535 6422 | format!("{}", error),
|
6536 6423 | "Invalid configuration: region from ARN `us-east-1` does not match client region `s3-external-1` and UseArnRegion is `false`"
|
6537 6424 | )
|
6538 6425 | }
|
6539 6426 |
|
6540 6427 | /// object lambda @us-east-1, client region aws-global, useArnRegion=true
|
6541 6428 | #[test]
|
6542 - | fn test_233() {
|
6429 + | fn test_232() {
|
6543 6430 | let params = crate::config::endpoint::Params::builder()
|
6544 6431 | .region("aws-global".to_string())
|
6545 6432 | .use_fips(false)
|
6546 6433 | .use_dual_stack(false)
|
6547 6434 | .accelerate(false)
|
6548 6435 | .use_arn_region(true)
|
6549 6436 | .bucket("arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string())
|
6550 6437 | .build()
|
6551 6438 | .expect("invalid params");
|
6552 6439 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6553 6440 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6554 6441 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com");
|
6555 6442 | assert_eq!(
|
6556 6443 | endpoint,
|
6557 6444 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6558 6445 | .url("https://mybanner-123456789012.s3-object-lambda.us-east-1.amazonaws.com")
|
6559 6446 | .property(
|
6560 6447 | "authSchemes",
|
6561 6448 | vec![::aws_smithy_types::Document::from({
|
6562 6449 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6563 6450 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6564 6451 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
6565 6452 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
6566 6453 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6567 6454 | out
|
6568 6455 | })]
|
6569 6456 | )
|
6570 6457 | .build()
|
6571 6458 | );
|
6572 6459 | }
|
6573 6460 |
|
6574 6461 | /// object lambda @us-east-1, client region aws-global, useArnRegion=false
|
6575 6462 | #[test]
|
6576 - | fn test_234() {
|
6463 + | fn test_233() {
|
6577 6464 | let params = crate::config::endpoint::Params::builder()
|
6578 6465 | .region("aws-global".to_string())
|
6579 6466 | .use_fips(false)
|
6580 6467 | .use_dual_stack(false)
|
6581 6468 | .accelerate(false)
|
6582 6469 | .use_arn_region(false)
|
6583 6470 | .bucket("arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string())
|
6584 6471 | .build()
|
6585 6472 | .expect("invalid params");
|
6586 6473 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6587 6474 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6588 6475 | let error = endpoint.expect_err("expected error: Invalid configuration: region from ARN `us-east-1` does not match client region `aws-global` and UseArnRegion is `false` [object lambda @us-east-1, client region aws-global, useArnRegion=false]");
|
6589 6476 | assert_eq!(
|
6590 6477 | format!("{}", error),
|
6591 6478 | "Invalid configuration: region from ARN `us-east-1` does not match client region `aws-global` and UseArnRegion is `false`"
|
6592 6479 | )
|
6593 6480 | }
|
6594 6481 |
|
6595 6482 | /// object lambda @cn-north-1, client region us-west-2 (cross partition), useArnRegion=true
|
6596 6483 | #[test]
|
6597 - | fn test_235() {
|
6484 + | fn test_234() {
|
6598 6485 | let params = crate::config::endpoint::Params::builder()
|
6599 6486 | .region("aws-global".to_string())
|
6600 6487 | .use_fips(false)
|
6601 6488 | .use_dual_stack(false)
|
6602 6489 | .accelerate(false)
|
6603 6490 | .use_arn_region(true)
|
6604 6491 | .bucket("arn:aws-cn:s3-object-lambda:cn-north-1:123456789012:accesspoint/mybanner".to_string())
|
6605 6492 | .build()
|
6606 6493 | .expect("invalid params");
|
6607 6494 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6608 6495 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6609 6496 | let error = endpoint.expect_err("expected error: Client was configured for partition `aws` but ARN (`arn:aws-cn:s3-object-lambda:cn-north-1:123456789012:accesspoint/mybanner`) has `aws-cn` [object lambda @cn-north-1, client region us-west-2 (cross partition), useArnRegion=true]");
|
6610 6497 | assert_eq!(format!("{}", error), "Client was configured for partition `aws` but ARN (`arn:aws-cn:s3-object-lambda:cn-north-1:123456789012:accesspoint/mybanner`) has `aws-cn`")
|
6611 6498 | }
|
6612 6499 |
|
6613 6500 | /// object lambda with dualstack
|
6614 6501 | #[test]
|
6615 - | fn test_236() {
|
6502 + | fn test_235() {
|
6616 6503 | let params = crate::config::endpoint::Params::builder()
|
6617 6504 | .region("us-west-2".to_string())
|
6618 6505 | .use_fips(false)
|
6619 6506 | .use_dual_stack(true)
|
6620 6507 | .accelerate(false)
|
6621 6508 | .use_arn_region(false)
|
6622 6509 | .bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint/mybanner".to_string())
|
6623 6510 | .build()
|
6624 6511 | .expect("invalid params");
|
6625 6512 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6626 6513 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6627 6514 | let error = endpoint.expect_err("expected error: S3 Object Lambda does not support Dual-stack [object lambda with dualstack]");
|
6628 6515 | assert_eq!(format!("{}", error), "S3 Object Lambda does not support Dual-stack")
|
6629 6516 | }
|
6630 6517 |
|
6631 6518 | /// object lambda @us-gov-east-1
|
6632 6519 | #[test]
|
6633 - | fn test_237() {
|
6520 + | fn test_236() {
|
6634 6521 | let params = crate::config::endpoint::Params::builder()
|
6635 6522 | .region("us-gov-east-1".to_string())
|
6636 6523 | .use_fips(false)
|
6637 6524 | .use_dual_stack(false)
|
6638 6525 | .accelerate(false)
|
6639 6526 | .use_arn_region(false)
|
6640 6527 | .bucket("arn:aws-us-gov:s3-object-lambda:us-gov-east-1:123456789012:accesspoint/mybanner".to_string())
|
6641 6528 | .build()
|
6642 6529 | .expect("invalid params");
|
6643 6530 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6644 6531 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6645 6532 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda.us-gov-east-1.amazonaws.com");
|
6646 6533 | assert_eq!(
|
6647 6534 | endpoint,
|
6648 6535 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6649 6536 | .url("https://mybanner-123456789012.s3-object-lambda.us-gov-east-1.amazonaws.com")
|
6650 6537 | .property(
|
6651 6538 | "authSchemes",
|
6652 6539 | vec![::aws_smithy_types::Document::from({
|
6653 6540 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6654 6541 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6655 6542 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
6656 6543 | out.insert("signingRegion".to_string(), "us-gov-east-1".to_string().into());
|
6657 6544 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6658 6545 | out
|
6659 6546 | })]
|
6660 6547 | )
|
6661 6548 | .build()
|
6662 6549 | );
|
6663 6550 | }
|
6664 6551 |
|
6665 6552 | /// object lambda @us-gov-east-1, with fips
|
6666 6553 | #[test]
|
6667 - | fn test_238() {
|
6554 + | fn test_237() {
|
6668 6555 | let params = crate::config::endpoint::Params::builder()
|
6669 6556 | .region("us-gov-east-1".to_string())
|
6670 6557 | .use_fips(true)
|
6671 6558 | .use_dual_stack(false)
|
6672 6559 | .accelerate(false)
|
6673 6560 | .use_arn_region(false)
|
6674 6561 | .bucket("arn:aws-us-gov:s3-object-lambda:us-gov-east-1:123456789012:accesspoint/mybanner".to_string())
|
6675 6562 | .build()
|
6676 6563 | .expect("invalid params");
|
6677 6564 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6678 6565 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6679 6566 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.s3-object-lambda-fips.us-gov-east-1.amazonaws.com");
|
6680 6567 | assert_eq!(
|
6681 6568 | endpoint,
|
6682 6569 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6683 6570 | .url("https://mybanner-123456789012.s3-object-lambda-fips.us-gov-east-1.amazonaws.com")
|
6684 6571 | .property(
|
6685 6572 | "authSchemes",
|
6686 6573 | vec![::aws_smithy_types::Document::from({
|
6687 6574 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6688 6575 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6689 6576 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
6690 6577 | out.insert("signingRegion".to_string(), "us-gov-east-1".to_string().into());
|
6691 6578 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6692 6579 | out
|
6693 6580 | })]
|
6694 6581 | )
|
6695 6582 | .build()
|
6696 6583 | );
|
6697 6584 | }
|
6698 6585 |
|
6699 6586 | /// object lambda @cn-north-1, with fips
|
6700 6587 | #[test]
|
6701 - | fn test_239() {
|
6588 + | fn test_238() {
|
6702 6589 | let params = crate::config::endpoint::Params::builder()
|
6703 6590 | .region("cn-north-1".to_string())
|
6704 6591 | .use_fips(true)
|
6705 6592 | .use_dual_stack(false)
|
6706 6593 | .accelerate(false)
|
6707 6594 | .use_arn_region(false)
|
6708 6595 | .bucket("arn:aws-cn:s3-object-lambda:cn-north-1:123456789012:accesspoint/mybanner".to_string())
|
6709 6596 | .build()
|
6710 6597 | .expect("invalid params");
|
6711 6598 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6712 6599 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6713 6600 | let error = endpoint.expect_err("expected error: Partition does not support FIPS [object lambda @cn-north-1, with fips]");
|
6714 6601 | assert_eq!(format!("{}", error), "Partition does not support FIPS")
|
6715 6602 | }
|
6716 6603 |
|
6717 6604 | /// object lambda with accelerate
|
6718 6605 | #[test]
|
6719 - | fn test_240() {
|
6606 + | fn test_239() {
|
6720 6607 | let params = crate::config::endpoint::Params::builder()
|
6721 6608 | .region("us-west-2".to_string())
|
6722 6609 | .use_fips(false)
|
6723 6610 | .use_dual_stack(false)
|
6724 6611 | .accelerate(true)
|
6725 6612 | .use_arn_region(false)
|
6726 6613 | .bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint/mybanner".to_string())
|
6727 6614 | .build()
|
6728 6615 | .expect("invalid params");
|
6729 6616 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6730 6617 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6731 6618 | let error = endpoint.expect_err("expected error: S3 Object Lambda does not support S3 Accelerate [object lambda with accelerate]");
|
6732 6619 | assert_eq!(format!("{}", error), "S3 Object Lambda does not support S3 Accelerate")
|
6733 6620 | }
|
6734 6621 |
|
6735 6622 | /// object lambda with invalid arn - bad service and someresource
|
6736 6623 | #[test]
|
6737 - | fn test_241() {
|
6624 + | fn test_240() {
|
6738 6625 | let params = crate::config::endpoint::Params::builder()
|
6739 6626 | .region("us-west-2".to_string())
|
6740 6627 | .use_fips(false)
|
6741 6628 | .use_dual_stack(false)
|
6742 6629 | .accelerate(false)
|
6743 6630 | .use_arn_region(false)
|
6744 6631 | .bucket("arn:aws:sqs:us-west-2:123456789012:someresource".to_string())
|
6745 6632 | .build()
|
6746 6633 | .expect("invalid params");
|
6747 6634 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6748 6635 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6749 6636 | let error = endpoint.expect_err("expected error: Invalid ARN: Unrecognized format: arn:aws:sqs:us-west-2:123456789012:someresource (type: someresource) [object lambda with invalid arn - bad service and someresource]");
|
6750 6637 | assert_eq!(
|
6751 6638 | format!("{}", error),
|
6752 6639 | "Invalid ARN: Unrecognized format: arn:aws:sqs:us-west-2:123456789012:someresource (type: someresource)"
|
6753 6640 | )
|
6754 6641 | }
|
6755 6642 |
|
6756 6643 | /// object lambda with invalid arn - invalid resource
|
6757 6644 | #[test]
|
6758 - | fn test_242() {
|
6645 + | fn test_241() {
|
6759 6646 | let params = crate::config::endpoint::Params::builder()
|
6760 6647 | .region("us-west-2".to_string())
|
6761 6648 | .use_fips(false)
|
6762 6649 | .use_dual_stack(false)
|
6763 6650 | .accelerate(false)
|
6764 6651 | .use_arn_region(false)
|
6765 6652 | .bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:bucket_name:mybucket".to_string())
|
6766 6653 | .build()
|
6767 6654 | .expect("invalid params");
|
6768 6655 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6769 6656 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6770 6657 | let error = endpoint.expect_err("expected error: Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `bucket_name` [object lambda with invalid arn - invalid resource]");
|
6771 6658 | assert_eq!(
|
6772 6659 | format!("{}", error),
|
6773 6660 | "Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `bucket_name`"
|
6774 6661 | )
|
6775 6662 | }
|
6776 6663 |
|
6777 6664 | /// object lambda with invalid arn - missing region
|
6778 6665 | #[test]
|
6779 - | fn test_243() {
|
6666 + | fn test_242() {
|
6780 6667 | let params = crate::config::endpoint::Params::builder()
|
6781 6668 | .region("us-west-2".to_string())
|
6782 6669 | .use_fips(false)
|
6783 6670 | .use_dual_stack(false)
|
6784 6671 | .accelerate(false)
|
6785 6672 | .use_arn_region(false)
|
6786 6673 | .bucket("arn:aws:s3-object-lambda::123456789012:accesspoint/mybanner".to_string())
|
6787 6674 | .build()
|
6788 6675 | .expect("invalid params");
|
6789 6676 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6790 6677 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6791 6678 | let error =
|
6792 6679 | endpoint.expect_err("expected error: Invalid ARN: bucket ARN is missing a region [object lambda with invalid arn - missing region]");
|
6793 6680 | assert_eq!(format!("{}", error), "Invalid ARN: bucket ARN is missing a region")
|
6794 6681 | }
|
6795 6682 |
|
6796 6683 | /// object lambda with invalid arn - missing account-id
|
6797 6684 | #[test]
|
6798 - | fn test_244() {
|
6685 + | fn test_243() {
|
6799 6686 | let params = crate::config::endpoint::Params::builder()
|
6800 6687 | .region("us-west-2".to_string())
|
6801 6688 | .use_fips(false)
|
6802 6689 | .use_dual_stack(false)
|
6803 6690 | .accelerate(false)
|
6804 6691 | .use_arn_region(true)
|
6805 6692 | .bucket("arn:aws:s3-object-lambda:us-west-2::accesspoint/mybanner".to_string())
|
6806 6693 | .build()
|
6807 6694 | .expect("invalid params");
|
6808 6695 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6809 6696 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6810 6697 | let error = endpoint.expect_err("expected error: Invalid ARN: Missing account id [object lambda with invalid arn - missing account-id]");
|
6811 6698 | assert_eq!(format!("{}", error), "Invalid ARN: Missing account id")
|
6812 6699 | }
|
6813 6700 |
|
6814 6701 | /// object lambda with invalid arn - account id contains invalid characters
|
6815 6702 | #[test]
|
6816 - | fn test_245() {
|
6703 + | fn test_244() {
|
6817 6704 | let params = crate::config::endpoint::Params::builder()
|
6818 6705 | .region("us-west-2".to_string())
|
6819 6706 | .use_fips(false)
|
6820 6707 | .use_dual_stack(false)
|
6821 6708 | .accelerate(false)
|
6822 6709 | .use_arn_region(true)
|
6823 6710 | .bucket("arn:aws:s3-object-lambda:us-west-2:123.45678.9012:accesspoint:mybucket".to_string())
|
6824 6711 | .build()
|
6825 6712 | .expect("invalid params");
|
6826 6713 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6827 6714 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6828 6715 | let error = endpoint.expect_err("expected error: Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `123.45678.9012` [object lambda with invalid arn - account id contains invalid characters]");
|
6829 6716 | assert_eq!(
|
6830 6717 | format!("{}", error),
|
6831 6718 | "Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `123.45678.9012`"
|
6832 6719 | )
|
6833 6720 | }
|
6834 6721 |
|
6835 6722 | /// object lambda with invalid arn - missing access point name
|
6836 6723 | #[test]
|
6837 - | fn test_246() {
|
6724 + | fn test_245() {
|
6838 6725 | let params = crate::config::endpoint::Params::builder()
|
6839 6726 | .region("us-west-2".to_string())
|
6840 6727 | .use_fips(false)
|
6841 6728 | .use_dual_stack(false)
|
6842 6729 | .accelerate(false)
|
6843 6730 | .use_arn_region(true)
|
6844 6731 | .bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint".to_string())
|
6845 6732 | .build()
|
6846 6733 | .expect("invalid params");
|
6847 6734 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6848 6735 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6849 6736 | let error = endpoint.expect_err("expected error: Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided [object lambda with invalid arn - missing access point name]");
|
6850 6737 | assert_eq!(
|
6851 6738 | format!("{}", error),
|
6852 6739 | "Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided"
|
6853 6740 | )
|
6854 6741 | }
|
6855 6742 |
|
6856 6743 | /// object lambda with invalid arn - access point name contains invalid character: *
|
6857 6744 | #[test]
|
6858 - | fn test_247() {
|
6745 + | fn test_246() {
|
6859 6746 | let params = crate::config::endpoint::Params::builder()
|
6860 6747 | .region("us-west-2".to_string())
|
6861 6748 | .use_fips(false)
|
6862 6749 | .use_dual_stack(false)
|
6863 6750 | .accelerate(false)
|
6864 6751 | .use_arn_region(true)
|
6865 6752 | .bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint:*".to_string())
|
6866 6753 | .build()
|
6867 6754 | .expect("invalid params");
|
6868 6755 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6869 6756 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6870 6757 | let error = endpoint.expect_err("expected error: Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `*` [object lambda with invalid arn - access point name contains invalid character: *]");
|
6871 6758 | assert_eq!(
|
6872 6759 | format!("{}", error),
|
6873 6760 | "Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `*`"
|
6874 6761 | )
|
6875 6762 | }
|
6876 6763 |
|
6877 6764 | /// object lambda with invalid arn - access point name contains invalid character: .
|
6878 6765 | #[test]
|
6879 - | fn test_248() {
|
6766 + | fn test_247() {
|
6880 6767 | let params = crate::config::endpoint::Params::builder()
|
6881 6768 | .region("us-west-2".to_string())
|
6882 6769 | .use_fips(false)
|
6883 6770 | .use_dual_stack(false)
|
6884 6771 | .accelerate(false)
|
6885 6772 | .use_arn_region(true)
|
6886 6773 | .bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint:my.bucket".to_string())
|
6887 6774 | .build()
|
6888 6775 | .expect("invalid params");
|
6889 6776 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6890 6777 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6891 6778 | let error = endpoint.expect_err("expected error: Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `my.bucket` [object lambda with invalid arn - access point name contains invalid character: .]");
|
6892 6779 | assert_eq!(
|
6893 6780 | format!("{}", error),
|
6894 6781 | "Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `my.bucket`"
|
6895 6782 | )
|
6896 6783 | }
|
6897 6784 |
|
6898 6785 | /// object lambda with invalid arn - access point name contains sub resources
|
6899 6786 | #[test]
|
6900 - | fn test_249() {
|
6787 + | fn test_248() {
|
6901 6788 | let params = crate::config::endpoint::Params::builder()
|
6902 6789 | .region("us-west-2".to_string())
|
6903 6790 | .use_fips(false)
|
6904 6791 | .use_dual_stack(false)
|
6905 6792 | .accelerate(false)
|
6906 6793 | .use_arn_region(true)
|
6907 6794 | .bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint:mybucket:object:foo".to_string())
|
6908 6795 | .build()
|
6909 6796 | .expect("invalid params");
|
6910 6797 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6911 6798 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6912 6799 | let error = endpoint.expect_err("expected error: Invalid ARN: The ARN may only contain a single resource component after `accesspoint`. [object lambda with invalid arn - access point name contains sub resources]");
|
6913 6800 | assert_eq!(
|
6914 6801 | format!("{}", error),
|
6915 6802 | "Invalid ARN: The ARN may only contain a single resource component after `accesspoint`."
|
6916 6803 | )
|
6917 6804 | }
|
6918 6805 |
|
6919 6806 | /// object lambda with custom endpoint
|
6920 6807 | #[test]
|
6921 - | fn test_250() {
|
6808 + | fn test_249() {
|
6922 6809 | let params = crate::config::endpoint::Params::builder()
|
6923 6810 | .region("us-west-2".to_string())
|
6924 6811 | .use_fips(false)
|
6925 6812 | .use_dual_stack(false)
|
6926 6813 | .accelerate(false)
|
6927 6814 | .use_arn_region(false)
|
6928 6815 | .bucket("arn:aws:s3-object-lambda:us-west-2:123456789012:accesspoint/mybanner".to_string())
|
6929 6816 | .endpoint("https://my-endpoint.com".to_string())
|
6930 6817 | .build()
|
6931 6818 | .expect("invalid params");
|
6932 6819 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6933 6820 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6934 6821 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybanner-123456789012.my-endpoint.com");
|
6935 6822 | assert_eq!(
|
6936 6823 | endpoint,
|
6937 6824 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6938 6825 | .url("https://mybanner-123456789012.my-endpoint.com")
|
6939 6826 | .property(
|
6940 6827 | "authSchemes",
|
6941 6828 | vec![::aws_smithy_types::Document::from({
|
6942 6829 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6943 6830 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6944 6831 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
6945 6832 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
6946 6833 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
6947 6834 | out
|
6948 6835 | })]
|
6949 6836 | )
|
6950 6837 | .build()
|
6951 6838 | );
|
6952 6839 | }
|
6953 6840 |
|
6954 6841 | /// object lambda arn with region mismatch and UseArnRegion=false
|
6955 6842 | #[test]
|
6956 - | fn test_251() {
|
6843 + | fn test_250() {
|
6957 6844 | let params = crate::config::endpoint::Params::builder()
|
6958 6845 | .accelerate(false)
|
6959 6846 | .bucket("arn:aws:s3-object-lambda:us-east-1:123456789012:accesspoint/mybanner".to_string())
|
6960 6847 | .force_path_style(false)
|
6961 6848 | .use_arn_region(false)
|
6962 6849 | .region("us-west-2".to_string())
|
6963 6850 | .use_dual_stack(false)
|
6964 6851 | .use_fips(false)
|
6965 6852 | .build()
|
6966 6853 | .expect("invalid params");
|
6967 6854 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6968 6855 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6969 6856 | let error = endpoint.expect_err("expected error: Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false` [object lambda arn with region mismatch and UseArnRegion=false]");
|
6970 6857 | assert_eq!(
|
6971 6858 | format!("{}", error),
|
6972 6859 | "Invalid configuration: region from ARN `us-east-1` does not match client region `us-west-2` and UseArnRegion is `false`"
|
6973 6860 | )
|
6974 6861 | }
|
6975 6862 |
|
6976 6863 | /// WriteGetObjectResponse @ us-west-2
|
6977 6864 | #[test]
|
6978 - | fn test_252() {
|
6865 + | fn test_251() {
|
6979 6866 | let params = crate::config::endpoint::Params::builder()
|
6980 6867 | .accelerate(false)
|
6981 6868 | .use_object_lambda_endpoint(true)
|
6982 6869 | .region("us-west-2".to_string())
|
6983 6870 | .use_dual_stack(false)
|
6984 6871 | .use_fips(false)
|
6985 6872 | .build()
|
6986 6873 | .expect("invalid params");
|
6987 6874 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
6988 6875 | let endpoint = resolver.resolve_endpoint(¶ms);
|
6989 6876 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-object-lambda.us-west-2.amazonaws.com");
|
6990 6877 | assert_eq!(
|
6991 6878 | endpoint,
|
6992 6879 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
6993 6880 | .url("https://s3-object-lambda.us-west-2.amazonaws.com")
|
6994 6881 | .property(
|
6995 6882 | "authSchemes",
|
6996 6883 | vec![::aws_smithy_types::Document::from({
|
6997 6884 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
6998 6885 | out.insert("name".to_string(), "sigv4".to_string().into());
|
6999 6886 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
7000 6887 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
7001 6888 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7002 6889 | out
|
7003 6890 | })]
|
7004 6891 | )
|
7005 6892 | .build()
|
7006 6893 | );
|
7007 6894 | }
|
7008 6895 |
|
7009 6896 | /// WriteGetObjectResponse with custom endpoint
|
7010 6897 | #[test]
|
7011 - | fn test_253() {
|
6898 + | fn test_252() {
|
7012 6899 | let params = crate::config::endpoint::Params::builder()
|
7013 6900 | .accelerate(false)
|
7014 6901 | .use_object_lambda_endpoint(true)
|
7015 6902 | .endpoint("https://my-endpoint.com".to_string())
|
7016 6903 | .region("us-west-2".to_string())
|
7017 6904 | .use_dual_stack(false)
|
7018 6905 | .use_fips(false)
|
7019 6906 | .build()
|
7020 6907 | .expect("invalid params");
|
7021 6908 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7022 6909 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7023 6910 | let endpoint = endpoint.expect("Expected valid endpoint: https://my-endpoint.com");
|
7024 6911 | assert_eq!(
|
7025 6912 | endpoint,
|
7026 6913 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7027 6914 | .url("https://my-endpoint.com")
|
7028 6915 | .property(
|
7029 6916 | "authSchemes",
|
7030 6917 | vec![::aws_smithy_types::Document::from({
|
7031 6918 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7032 6919 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7033 6920 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
7034 6921 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
7035 6922 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7036 6923 | out
|
7037 6924 | })]
|
7038 6925 | )
|
7039 6926 | .build()
|
7040 6927 | );
|
7041 6928 | }
|
7042 6929 |
|
7043 6930 | /// WriteGetObjectResponse @ us-east-1
|
7044 6931 | #[test]
|
7045 - | fn test_254() {
|
6932 + | fn test_253() {
|
7046 6933 | let params = crate::config::endpoint::Params::builder()
|
7047 6934 | .accelerate(false)
|
7048 6935 | .use_object_lambda_endpoint(true)
|
7049 6936 | .region("us-east-1".to_string())
|
7050 6937 | .use_dual_stack(false)
|
7051 6938 | .use_fips(false)
|
7052 6939 | .build()
|
7053 6940 | .expect("invalid params");
|
7054 6941 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7055 6942 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7056 6943 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-object-lambda.us-east-1.amazonaws.com");
|
7057 6944 | assert_eq!(
|
7058 6945 | endpoint,
|
7059 6946 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7060 6947 | .url("https://s3-object-lambda.us-east-1.amazonaws.com")
|
7061 6948 | .property(
|
7062 6949 | "authSchemes",
|
7063 6950 | vec![::aws_smithy_types::Document::from({
|
7064 6951 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7065 6952 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7066 6953 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
7067 6954 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
7068 6955 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7069 6956 | out
|
7070 6957 | })]
|
7071 6958 | )
|
7072 6959 | .build()
|
7073 6960 | );
|
7074 6961 | }
|
7075 6962 |
|
7076 6963 | /// WriteGetObjectResponse with fips
|
7077 6964 | #[test]
|
7078 - | fn test_255() {
|
6965 + | fn test_254() {
|
7079 6966 | let params = crate::config::endpoint::Params::builder()
|
7080 6967 | .accelerate(false)
|
7081 6968 | .use_object_lambda_endpoint(true)
|
7082 6969 | .region("us-east-1".to_string())
|
7083 6970 | .use_dual_stack(false)
|
7084 6971 | .use_fips(true)
|
7085 6972 | .build()
|
7086 6973 | .expect("invalid params");
|
7087 6974 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7088 6975 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7089 6976 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-object-lambda-fips.us-east-1.amazonaws.com");
|
7090 6977 | assert_eq!(
|
7091 6978 | endpoint,
|
7092 6979 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7093 6980 | .url("https://s3-object-lambda-fips.us-east-1.amazonaws.com")
|
7094 6981 | .property(
|
7095 6982 | "authSchemes",
|
7096 6983 | vec![::aws_smithy_types::Document::from({
|
7097 6984 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7098 6985 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7099 6986 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
7100 6987 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
7101 6988 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7102 6989 | out
|
7103 6990 | })]
|
7104 6991 | )
|
7105 6992 | .build()
|
7106 6993 | );
|
7107 6994 | }
|
7108 6995 |
|
7109 6996 | /// WriteGetObjectResponse with dualstack
|
7110 6997 | #[test]
|
7111 - | fn test_256() {
|
6998 + | fn test_255() {
|
7112 6999 | let params = crate::config::endpoint::Params::builder()
|
7113 7000 | .accelerate(false)
|
7114 7001 | .use_object_lambda_endpoint(true)
|
7115 7002 | .region("us-east-1".to_string())
|
7116 7003 | .use_dual_stack(true)
|
7117 7004 | .use_fips(false)
|
7118 7005 | .build()
|
7119 7006 | .expect("invalid params");
|
7120 7007 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7121 7008 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7122 7009 | let error = endpoint.expect_err("expected error: S3 Object Lambda does not support Dual-stack [WriteGetObjectResponse with dualstack]");
|
7123 7010 | assert_eq!(format!("{}", error), "S3 Object Lambda does not support Dual-stack")
|
7124 7011 | }
|
7125 7012 |
|
7126 7013 | /// WriteGetObjectResponse with accelerate
|
7127 7014 | #[test]
|
7128 - | fn test_257() {
|
7015 + | fn test_256() {
|
7129 7016 | let params = crate::config::endpoint::Params::builder()
|
7130 7017 | .accelerate(true)
|
7131 7018 | .use_object_lambda_endpoint(true)
|
7132 7019 | .region("us-east-1".to_string())
|
7133 7020 | .use_dual_stack(false)
|
7134 7021 | .use_fips(false)
|
7135 7022 | .build()
|
7136 7023 | .expect("invalid params");
|
7137 7024 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7138 7025 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7139 7026 | let error = endpoint.expect_err("expected error: S3 Object Lambda does not support S3 Accelerate [WriteGetObjectResponse with accelerate]");
|
7140 7027 | assert_eq!(format!("{}", error), "S3 Object Lambda does not support S3 Accelerate")
|
7141 7028 | }
|
7142 7029 |
|
7143 7030 | /// WriteGetObjectResponse with fips in CN
|
7144 7031 | #[test]
|
7145 - | fn test_258() {
|
7032 + | fn test_257() {
|
7146 7033 | let params = crate::config::endpoint::Params::builder()
|
7147 7034 | .accelerate(false)
|
7148 7035 | .region("cn-north-1".to_string())
|
7149 7036 | .use_object_lambda_endpoint(true)
|
7150 7037 | .use_dual_stack(false)
|
7151 7038 | .use_fips(true)
|
7152 7039 | .build()
|
7153 7040 | .expect("invalid params");
|
7154 7041 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7155 7042 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7156 7043 | let error = endpoint.expect_err("expected error: Partition does not support FIPS [WriteGetObjectResponse with fips in CN]");
|
7157 7044 | assert_eq!(format!("{}", error), "Partition does not support FIPS")
|
7158 7045 | }
|
7159 7046 |
|
7160 7047 | /// WriteGetObjectResponse with invalid partition
|
7161 7048 | #[test]
|
7162 - | fn test_259() {
|
7049 + | fn test_258() {
|
7163 7050 | let params = crate::config::endpoint::Params::builder()
|
7164 7051 | .accelerate(false)
|
7165 7052 | .use_object_lambda_endpoint(true)
|
7166 7053 | .region("not a valid DNS name".to_string())
|
7167 7054 | .use_dual_stack(false)
|
7168 7055 | .use_fips(false)
|
7169 7056 | .build()
|
7170 7057 | .expect("invalid params");
|
7171 7058 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7172 7059 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7173 7060 | let error =
|
7174 7061 | endpoint.expect_err("expected error: Invalid region: region was not a valid DNS name. [WriteGetObjectResponse with invalid partition]");
|
7175 7062 | assert_eq!(format!("{}", error), "Invalid region: region was not a valid DNS name.")
|
7176 7063 | }
|
7177 7064 |
|
7178 7065 | /// WriteGetObjectResponse with an unknown partition
|
7179 7066 | #[test]
|
7180 - | fn test_260() {
|
7067 + | fn test_259() {
|
7181 7068 | let params = crate::config::endpoint::Params::builder()
|
7182 7069 | .accelerate(false)
|
7183 7070 | .use_object_lambda_endpoint(true)
|
7184 7071 | .region("us-east.special".to_string())
|
7185 7072 | .use_dual_stack(false)
|
7186 7073 | .use_fips(false)
|
7187 7074 | .build()
|
7188 7075 | .expect("invalid params");
|
7189 7076 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7190 7077 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7191 7078 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3-object-lambda.us-east.special.amazonaws.com");
|
7192 7079 | assert_eq!(
|
7193 7080 | endpoint,
|
7194 7081 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7195 7082 | .url("https://s3-object-lambda.us-east.special.amazonaws.com")
|
7196 7083 | .property(
|
7197 7084 | "authSchemes",
|
7198 7085 | vec![::aws_smithy_types::Document::from({
|
7199 7086 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7200 7087 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7201 7088 | out.insert("signingName".to_string(), "s3-object-lambda".to_string().into());
|
7202 7089 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7203 7090 | out.insert("signingRegion".to_string(), "us-east.special".to_string().into());
|
7204 7091 | out
|
7205 7092 | })]
|
7206 7093 | )
|
7207 7094 | .build()
|
7208 7095 | );
|
7209 7096 | }
|
7210 7097 |
|
7211 7098 | /// S3 Outposts bucketAlias Real Outpost Prod us-west-1
|
7212 7099 | #[test]
|
7213 - | fn test_261() {
|
7100 + | fn test_260() {
|
7214 7101 | let params = crate::config::endpoint::Params::builder()
|
7215 7102 | .region("us-west-1".to_string())
|
7216 7103 | .bucket("test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3".to_string())
|
7217 7104 | .use_fips(false)
|
7218 7105 | .use_dual_stack(false)
|
7219 7106 | .accelerate(false)
|
7220 7107 | .build()
|
7221 7108 | .expect("invalid params");
|
7222 7109 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7223 7110 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7224 7111 | let endpoint = endpoint.expect("Expected valid endpoint: https://test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.op-0b1d075431d83bebd.s3-outposts.us-west-1.amazonaws.com");
|
7225 7112 | assert_eq!(endpoint, ::aws_smithy_types::endpoint::Endpoint::builder().url("https://test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.op-0b1d075431d83bebd.s3-outposts.us-west-1.amazonaws.com")
|
7226 7113 | .property("authSchemes", vec![::aws_smithy_types::Document::from( {
|
7227 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7228 - | out.insert("name".to_string(), "sigv4a".to_string().into());
|
7229 - | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
7230 - | out.insert("signingRegionSet".to_string(), vec![::aws_smithy_types::Document::from("*".to_string())].into());
|
7231 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7232 - | out
|
7233 - | })
|
7234 - | ,::aws_smithy_types::Document::from( {
|
7235 7114 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7236 7115 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7237 7116 | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
7238 7117 | out.insert("signingRegion".to_string(), "us-west-1".to_string().into());
|
7239 7118 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7240 7119 | out
|
7241 7120 | })])
|
7242 7121 | .build());
|
7243 7122 | }
|
7244 7123 |
|
7245 7124 | /// S3 Outposts bucketAlias Real Outpost Prod ap-east-1
|
7246 7125 | #[test]
|
7247 - | fn test_262() {
|
7126 + | fn test_261() {
|
7248 7127 | let params = crate::config::endpoint::Params::builder()
|
7249 7128 | .region("ap-east-1".to_string())
|
7250 7129 | .bucket("test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3".to_string())
|
7251 7130 | .use_fips(false)
|
7252 7131 | .use_dual_stack(false)
|
7253 7132 | .accelerate(false)
|
7254 7133 | .build()
|
7255 7134 | .expect("invalid params");
|
7256 7135 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7257 7136 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7258 7137 | let endpoint = endpoint.expect("Expected valid endpoint: https://test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.op-0b1d075431d83bebd.s3-outposts.ap-east-1.amazonaws.com");
|
7259 7138 | assert_eq!(endpoint, ::aws_smithy_types::endpoint::Endpoint::builder().url("https://test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.op-0b1d075431d83bebd.s3-outposts.ap-east-1.amazonaws.com")
|
7260 7139 | .property("authSchemes", vec![::aws_smithy_types::Document::from( {
|
7261 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7262 - | out.insert("name".to_string(), "sigv4a".to_string().into());
|
7263 - | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
7264 - | out.insert("signingRegionSet".to_string(), vec![::aws_smithy_types::Document::from("*".to_string())].into());
|
7265 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7266 - | out
|
7267 - | })
|
7268 - | ,::aws_smithy_types::Document::from( {
|
7269 7140 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7270 7141 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7271 7142 | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
7272 7143 | out.insert("signingRegion".to_string(), "ap-east-1".to_string().into());
|
7273 7144 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7274 7145 | out
|
7275 7146 | })])
|
7276 7147 | .build());
|
7277 7148 | }
|
7278 7149 |
|
7279 7150 | /// S3 Outposts bucketAlias Ec2 Outpost Prod us-east-1
|
7280 7151 | #[test]
|
7281 - | fn test_263() {
|
7152 + | fn test_262() {
|
7282 7153 | let params = crate::config::endpoint::Params::builder()
|
7283 7154 | .region("us-east-1".to_string())
|
7284 7155 | .bucket("test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3".to_string())
|
7285 7156 | .use_fips(false)
|
7286 7157 | .use_dual_stack(false)
|
7287 7158 | .accelerate(false)
|
7288 7159 | .build()
|
7289 7160 | .expect("invalid params");
|
7290 7161 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7291 7162 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7292 7163 | let endpoint = endpoint.expect("Expected valid endpoint: https://test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.ec2.s3-outposts.us-east-1.amazonaws.com");
|
7293 7164 | assert_eq!(
|
7294 7165 | endpoint,
|
7295 7166 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7296 7167 | .url("https://test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.ec2.s3-outposts.us-east-1.amazonaws.com")
|
7297 7168 | .property(
|
7298 7169 | "authSchemes",
|
7299 - | vec![
|
7300 - | ::aws_smithy_types::Document::from({
|
7301 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7302 - | out.insert("name".to_string(), "sigv4a".to_string().into());
|
7303 - | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
7304 - | out.insert(
|
7305 - | "signingRegionSet".to_string(),
|
7306 - | vec![::aws_smithy_types::Document::from("*".to_string())].into(),
|
7307 - | );
|
7308 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7309 - | out
|
7310 - | }),
|
7311 - | ::aws_smithy_types::Document::from({
|
7170 + | vec![::aws_smithy_types::Document::from({
|
7312 7171 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7313 7172 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7314 7173 | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
7315 7174 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
7316 7175 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7317 7176 | out
|
7318 - | })
|
7319 - | ]
|
7177 + | })]
|
7320 7178 | )
|
7321 7179 | .build()
|
7322 7180 | );
|
7323 7181 | }
|
7324 7182 |
|
7325 7183 | /// S3 Outposts bucketAlias Ec2 Outpost Prod me-south-1
|
7326 7184 | #[test]
|
7327 - | fn test_264() {
|
7185 + | fn test_263() {
|
7328 7186 | let params = crate::config::endpoint::Params::builder()
|
7329 7187 | .region("me-south-1".to_string())
|
7330 7188 | .bucket("test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3".to_string())
|
7331 7189 | .use_fips(false)
|
7332 7190 | .use_dual_stack(false)
|
7333 7191 | .accelerate(false)
|
7334 7192 | .build()
|
7335 7193 | .expect("invalid params");
|
7336 7194 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7337 7195 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7338 7196 | let endpoint = endpoint.expect("Expected valid endpoint: https://test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.ec2.s3-outposts.me-south-1.amazonaws.com");
|
7339 7197 | assert_eq!(
|
7340 7198 | endpoint,
|
7341 7199 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7342 7200 | .url("https://test-accessp-e0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3.ec2.s3-outposts.me-south-1.amazonaws.com")
|
7343 7201 | .property(
|
7344 7202 | "authSchemes",
|
7345 - | vec![
|
7346 - | ::aws_smithy_types::Document::from({
|
7347 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7348 - | out.insert("name".to_string(), "sigv4a".to_string().into());
|
7349 - | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
7350 - | out.insert(
|
7351 - | "signingRegionSet".to_string(),
|
7352 - | vec![::aws_smithy_types::Document::from("*".to_string())].into(),
|
7353 - | );
|
7354 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7355 - | out
|
7356 - | }),
|
7357 - | ::aws_smithy_types::Document::from({
|
7203 + | vec![::aws_smithy_types::Document::from({
|
7358 7204 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7359 7205 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7360 7206 | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
7361 7207 | out.insert("signingRegion".to_string(), "me-south-1".to_string().into());
|
7362 7208 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7363 7209 | out
|
7364 - | })
|
7365 - | ]
|
7210 + | })]
|
7366 7211 | )
|
7367 7212 | .build()
|
7368 7213 | );
|
7369 7214 | }
|
7370 7215 |
|
7371 7216 | /// S3 Outposts bucketAlias Real Outpost Beta
|
7372 7217 | #[test]
|
7373 - | fn test_265() {
|
7218 + | fn test_264() {
|
7374 7219 | let params = crate::config::endpoint::Params::builder()
|
7375 7220 | .region("us-east-1".to_string())
|
7376 7221 | .bucket("test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kbeta0--op-s3".to_string())
|
7377 7222 | .endpoint("https://example.amazonaws.com".to_string())
|
7378 7223 | .use_fips(false)
|
7379 7224 | .use_dual_stack(false)
|
7380 7225 | .accelerate(false)
|
7381 7226 | .build()
|
7382 7227 | .expect("invalid params");
|
7383 7228 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7384 7229 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7385 7230 | let endpoint = endpoint.expect("Expected valid endpoint: https://test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kbeta0--op-s3.op-0b1d075431d83bebd.example.amazonaws.com");
|
7386 7231 | assert_eq!(
|
7387 7232 | endpoint,
|
7388 7233 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7389 7234 | .url("https://test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kbeta0--op-s3.op-0b1d075431d83bebd.example.amazonaws.com")
|
7390 7235 | .property(
|
7391 7236 | "authSchemes",
|
7392 - | vec![
|
7393 - | ::aws_smithy_types::Document::from({
|
7394 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7395 - | out.insert("name".to_string(), "sigv4a".to_string().into());
|
7396 - | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
7397 - | out.insert(
|
7398 - | "signingRegionSet".to_string(),
|
7399 - | vec![::aws_smithy_types::Document::from("*".to_string())].into(),
|
7400 - | );
|
7401 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7402 - | out
|
7403 - | }),
|
7404 - | ::aws_smithy_types::Document::from({
|
7237 + | vec![::aws_smithy_types::Document::from({
|
7405 7238 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7406 7239 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7407 7240 | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
7408 7241 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
7409 7242 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7410 7243 | out
|
7411 - | })
|
7412 - | ]
|
7244 + | })]
|
7413 7245 | )
|
7414 7246 | .build()
|
7415 7247 | );
|
7416 7248 | }
|
7417 7249 |
|
7418 7250 | /// S3 Outposts bucketAlias Ec2 Outpost Beta
|
7419 7251 | #[test]
|
7420 - | fn test_266() {
|
7252 + | fn test_265() {
|
7421 7253 | let params = crate::config::endpoint::Params::builder()
|
7422 7254 | .region("us-east-1".to_string())
|
7423 7255 | .bucket("161743052723-e00000136899934034jeahy1t8gpzpbwjj8kb7beta0--op-s3".to_string())
|
7424 7256 | .endpoint("https://example.amazonaws.com".to_string())
|
7425 7257 | .use_fips(false)
|
7426 7258 | .use_dual_stack(false)
|
7427 7259 | .accelerate(false)
|
7428 7260 | .build()
|
7429 7261 | .expect("invalid params");
|
7430 7262 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7431 7263 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7432 7264 | let endpoint = endpoint
|
7433 7265 | .expect("Expected valid endpoint: https://161743052723-e00000136899934034jeahy1t8gpzpbwjj8kb7beta0--op-s3.ec2.example.amazonaws.com");
|
7434 7266 | assert_eq!(
|
7435 7267 | endpoint,
|
7436 7268 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7437 7269 | .url("https://161743052723-e00000136899934034jeahy1t8gpzpbwjj8kb7beta0--op-s3.ec2.example.amazonaws.com")
|
7438 7270 | .property(
|
7439 7271 | "authSchemes",
|
7440 - | vec![
|
7441 - | ::aws_smithy_types::Document::from({
|
7442 - | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7443 - | out.insert("name".to_string(), "sigv4a".to_string().into());
|
7444 - | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
7445 - | out.insert(
|
7446 - | "signingRegionSet".to_string(),
|
7447 - | vec![::aws_smithy_types::Document::from("*".to_string())].into(),
|
7448 - | );
|
7449 - | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7450 - | out
|
7451 - | }),
|
7452 - | ::aws_smithy_types::Document::from({
|
7272 + | vec![::aws_smithy_types::Document::from({
|
7453 7273 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7454 7274 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7455 7275 | out.insert("signingName".to_string(), "s3-outposts".to_string().into());
|
7456 7276 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
7457 7277 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7458 7278 | out
|
7459 - | })
|
7460 - | ]
|
7279 + | })]
|
7461 7280 | )
|
7462 7281 | .build()
|
7463 7282 | );
|
7464 7283 | }
|
7465 7284 |
|
7466 7285 | /// S3 Outposts bucketAlias - No endpoint set for beta
|
7467 7286 | #[test]
|
7468 - | fn test_267() {
|
7287 + | fn test_266() {
|
7469 7288 | let params = crate::config::endpoint::Params::builder()
|
7470 7289 | .region("us-east-1".to_string())
|
7471 7290 | .bucket("test-accessp-o0b1d075431d83bebde8xz5w8ijx1qzlbp3i3kbeta0--op-s3".to_string())
|
7472 7291 | .use_fips(false)
|
7473 7292 | .use_dual_stack(false)
|
7474 7293 | .accelerate(false)
|
7475 7294 | .build()
|
7476 7295 | .expect("invalid params");
|
7477 7296 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7478 7297 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7479 7298 | let error = endpoint.expect_err(
|
7480 7299 | "expected error: Expected a endpoint to be specified but no endpoint was found [S3 Outposts bucketAlias - No endpoint set for beta]",
|
7481 7300 | );
|
7482 7301 | assert_eq!(format!("{}", error), "Expected a endpoint to be specified but no endpoint was found")
|
7483 7302 | }
|
7484 7303 |
|
7485 7304 | /// S3 Outposts bucketAlias Invalid hardware type
|
7486 7305 | #[test]
|
7487 - | fn test_268() {
|
7306 + | fn test_267() {
|
7488 7307 | let params = crate::config::endpoint::Params::builder()
|
7489 7308 | .region("us-east-1".to_string())
|
7490 7309 | .bucket("test-accessp-h0000075431d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3".to_string())
|
7491 7310 | .use_fips(false)
|
7492 7311 | .use_dual_stack(false)
|
7493 7312 | .accelerate(false)
|
7494 7313 | .build()
|
7495 7314 | .expect("invalid params");
|
7496 7315 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7497 7316 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7498 7317 | let error = endpoint.expect_err(
|
7499 7318 | "expected error: Unrecognized hardware type: \"Expected hardware type o or e but got h\" [S3 Outposts bucketAlias Invalid hardware type]",
|
7500 7319 | );
|
7501 7320 | assert_eq!(
|
7502 7321 | format!("{}", error),
|
7503 7322 | "Unrecognized hardware type: \"Expected hardware type o or e but got h\""
|
7504 7323 | )
|
7505 7324 | }
|
7506 7325 |
|
7507 7326 | /// S3 Outposts bucketAlias Special character in Outpost Arn
|
7508 7327 | #[test]
|
7509 - | fn test_269() {
|
7328 + | fn test_268() {
|
7510 7329 | let params = crate::config::endpoint::Params::builder()
|
7511 7330 | .region("us-east-1".to_string())
|
7512 7331 | .bucket("test-accessp-o00000754%1d83bebde8xz5w8ijx1qzlbp3i3kuse10--op-s3".to_string())
|
7513 7332 | .use_fips(false)
|
7514 7333 | .use_dual_stack(false)
|
7515 7334 | .accelerate(false)
|
7516 7335 | .build()
|
7517 7336 | .expect("invalid params");
|
7518 7337 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7519 7338 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7520 7339 | let error = endpoint.expect_err("expected error: Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`. [S3 Outposts bucketAlias Special character in Outpost Arn]");
|
7521 7340 | assert_eq!(
|
7522 7341 | format!("{}", error),
|
7523 7342 | "Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`."
|
7524 7343 | )
|
7525 7344 | }
|
7526 7345 |
|
7527 7346 | /// S3 Outposts bucketAlias - No endpoint set for beta
|
7528 7347 | #[test]
|
7529 - | fn test_270() {
|
7348 + | fn test_269() {
|
7530 7349 | let params = crate::config::endpoint::Params::builder()
|
7531 7350 | .region("us-east-1".to_string())
|
7532 7351 | .bucket("test-accessp-e0b1d075431d83bebde8xz5w8ijx1qzlbp3i3ebeta0--op-s3".to_string())
|
7533 7352 | .use_fips(false)
|
7534 7353 | .use_dual_stack(false)
|
7535 7354 | .accelerate(false)
|
7536 7355 | .build()
|
7537 7356 | .expect("invalid params");
|
7538 7357 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7539 7358 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7540 7359 | let error = endpoint.expect_err(
|
7541 7360 | "expected error: Expected a endpoint to be specified but no endpoint was found [S3 Outposts bucketAlias - No endpoint set for beta]",
|
7542 7361 | );
|
7543 7362 | assert_eq!(format!("{}", error), "Expected a endpoint to be specified but no endpoint was found")
|
7544 7363 | }
|
7545 7364 |
|
7546 7365 | /// S3 Snow with bucket
|
7547 7366 | #[test]
|
7548 - | fn test_271() {
|
7367 + | fn test_270() {
|
7549 7368 | let params = crate::config::endpoint::Params::builder()
|
7550 7369 | .region("snow".to_string())
|
7551 7370 | .bucket("bucketName".to_string())
|
7552 7371 | .endpoint("http://10.0.1.12:433".to_string())
|
7553 7372 | .use_fips(false)
|
7554 7373 | .use_dual_stack(false)
|
7555 7374 | .accelerate(false)
|
7556 7375 | .build()
|
7557 7376 | .expect("invalid params");
|
7558 7377 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7559 7378 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7560 7379 | let endpoint = endpoint.expect("Expected valid endpoint: http://10.0.1.12:433/bucketName");
|
7561 7380 | assert_eq!(
|
7562 7381 | endpoint,
|
7563 7382 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7564 7383 | .url("http://10.0.1.12:433/bucketName")
|
7565 7384 | .property(
|
7566 7385 | "authSchemes",
|
7567 7386 | vec![::aws_smithy_types::Document::from({
|
7568 7387 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7569 7388 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7570 7389 | out.insert("signingName".to_string(), "s3".to_string().into());
|
7571 7390 | out.insert("signingRegion".to_string(), "snow".to_string().into());
|
7572 7391 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7573 7392 | out
|
7574 7393 | })]
|
7575 7394 | )
|
7576 7395 | .build()
|
7577 7396 | );
|
7578 7397 | }
|
7579 7398 |
|
7580 7399 | /// S3 Snow without bucket
|
7581 7400 | #[test]
|
7582 - | fn test_272() {
|
7401 + | fn test_271() {
|
7583 7402 | let params = crate::config::endpoint::Params::builder()
|
7584 7403 | .region("snow".to_string())
|
7585 7404 | .endpoint("https://10.0.1.12:433".to_string())
|
7586 7405 | .use_fips(false)
|
7587 7406 | .use_dual_stack(false)
|
7588 7407 | .accelerate(false)
|
7589 7408 | .build()
|
7590 7409 | .expect("invalid params");
|
7591 7410 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7592 7411 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7593 7412 | let endpoint = endpoint.expect("Expected valid endpoint: https://10.0.1.12:433");
|
7594 7413 | assert_eq!(
|
7595 7414 | endpoint,
|
7596 7415 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7597 7416 | .url("https://10.0.1.12:433")
|
7598 7417 | .property(
|
7599 7418 | "authSchemes",
|
7600 7419 | vec![::aws_smithy_types::Document::from({
|
7601 7420 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7602 7421 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7603 7422 | out.insert("signingName".to_string(), "s3".to_string().into());
|
7604 7423 | out.insert("signingRegion".to_string(), "snow".to_string().into());
|
7605 7424 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7606 7425 | out
|
7607 7426 | })]
|
7608 7427 | )
|
7609 7428 | .build()
|
7610 7429 | );
|
7611 7430 | }
|
7612 7431 |
|
7613 7432 | /// S3 Snow no port
|
7614 7433 | #[test]
|
7615 - | fn test_273() {
|
7434 + | fn test_272() {
|
7616 7435 | let params = crate::config::endpoint::Params::builder()
|
7617 7436 | .region("snow".to_string())
|
7618 7437 | .bucket("bucketName".to_string())
|
7619 7438 | .endpoint("http://10.0.1.12".to_string())
|
7620 7439 | .use_fips(false)
|
7621 7440 | .use_dual_stack(false)
|
7622 7441 | .accelerate(false)
|
7623 7442 | .build()
|
7624 7443 | .expect("invalid params");
|
7625 7444 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7626 7445 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7627 7446 | let endpoint = endpoint.expect("Expected valid endpoint: http://10.0.1.12/bucketName");
|
7628 7447 | assert_eq!(
|
7629 7448 | endpoint,
|
7630 7449 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7631 7450 | .url("http://10.0.1.12/bucketName")
|
7632 7451 | .property(
|
7633 7452 | "authSchemes",
|
7634 7453 | vec![::aws_smithy_types::Document::from({
|
7635 7454 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7636 7455 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7637 7456 | out.insert("signingName".to_string(), "s3".to_string().into());
|
7638 7457 | out.insert("signingRegion".to_string(), "snow".to_string().into());
|
7639 7458 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7640 7459 | out
|
7641 7460 | })]
|
7642 7461 | )
|
7643 7462 | .build()
|
7644 7463 | );
|
7645 7464 | }
|
7646 7465 |
|
7647 7466 | /// S3 Snow dns endpoint
|
7648 7467 | #[test]
|
7649 - | fn test_274() {
|
7468 + | fn test_273() {
|
7650 7469 | let params = crate::config::endpoint::Params::builder()
|
7651 7470 | .region("snow".to_string())
|
7652 7471 | .bucket("bucketName".to_string())
|
7653 7472 | .endpoint("https://amazonaws.com".to_string())
|
7654 7473 | .use_fips(false)
|
7655 7474 | .use_dual_stack(false)
|
7656 7475 | .accelerate(false)
|
7657 7476 | .build()
|
7658 7477 | .expect("invalid params");
|
7659 7478 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7660 7479 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7661 7480 | let endpoint = endpoint.expect("Expected valid endpoint: https://amazonaws.com/bucketName");
|
7662 7481 | assert_eq!(
|
7663 7482 | endpoint,
|
7664 7483 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7665 7484 | .url("https://amazonaws.com/bucketName")
|
7666 7485 | .property(
|
7667 7486 | "authSchemes",
|
7668 7487 | vec![::aws_smithy_types::Document::from({
|
7669 7488 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7670 7489 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7671 7490 | out.insert("signingName".to_string(), "s3".to_string().into());
|
7672 7491 | out.insert("signingRegion".to_string(), "snow".to_string().into());
|
7673 7492 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7674 7493 | out
|
7675 7494 | })]
|
7676 7495 | )
|
7677 7496 | .build()
|
7678 7497 | );
|
7679 7498 | }
|
7680 7499 |
|
7681 7500 | /// Data Plane with short AZ
|
7682 7501 | #[test]
|
7683 - | fn test_275() {
|
7502 + | fn test_274() {
|
7684 7503 | let params = crate::config::endpoint::Params::builder()
|
7685 7504 | .region("us-east-1".to_string())
|
7686 7505 | .bucket("mybucket--use1-az1--x-s3".to_string())
|
7687 7506 | .use_fips(false)
|
7688 7507 | .use_dual_stack(false)
|
7689 7508 | .accelerate(false)
|
7690 7509 | .use_s3_express_control_endpoint(false)
|
7691 7510 | .build()
|
7692 7511 | .expect("invalid params");
|
7693 7512 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7694 7513 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7695 7514 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybucket--use1-az1--x-s3.s3express-use1-az1.us-east-1.amazonaws.com");
|
7696 7515 | assert_eq!(
|
7697 7516 | endpoint,
|
7698 7517 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7699 7518 | .url("https://mybucket--use1-az1--x-s3.s3express-use1-az1.us-east-1.amazonaws.com")
|
7700 7519 | .property(
|
7701 7520 | "authSchemes",
|
7702 7521 | vec![::aws_smithy_types::Document::from({
|
7703 7522 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7704 7523 | out.insert("name".to_string(), "sigv4-s3express".to_string().into());
|
7705 7524 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
7706 7525 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
7707 7526 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7708 7527 | out
|
7709 7528 | })]
|
7710 7529 | )
|
7711 7530 | .property("backend", "S3Express".to_string())
|
7712 7531 | .build()
|
7713 7532 | );
|
7714 7533 | }
|
7715 7534 |
|
7716 7535 | /// Data Plane with short AZ fips
|
7717 7536 | #[test]
|
7718 - | fn test_276() {
|
7537 + | fn test_275() {
|
7719 7538 | let params = crate::config::endpoint::Params::builder()
|
7720 7539 | .region("us-east-1".to_string())
|
7721 7540 | .bucket("mybucket--use1-az1--x-s3".to_string())
|
7722 7541 | .use_fips(true)
|
7723 7542 | .use_dual_stack(false)
|
7724 7543 | .accelerate(false)
|
7725 7544 | .use_s3_express_control_endpoint(false)
|
7726 7545 | .build()
|
7727 7546 | .expect("invalid params");
|
7728 7547 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7729 7548 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7730 7549 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybucket--use1-az1--x-s3.s3express-fips-use1-az1.us-east-1.amazonaws.com");
|
7731 7550 | assert_eq!(
|
7732 7551 | endpoint,
|
7733 7552 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7734 7553 | .url("https://mybucket--use1-az1--x-s3.s3express-fips-use1-az1.us-east-1.amazonaws.com")
|
7735 7554 | .property(
|
7736 7555 | "authSchemes",
|
7737 7556 | vec![::aws_smithy_types::Document::from({
|
7738 7557 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7739 7558 | out.insert("name".to_string(), "sigv4-s3express".to_string().into());
|
7740 7559 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
7741 7560 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
7742 7561 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7743 7562 | out
|
7744 7563 | })]
|
7745 7564 | )
|
7746 7565 | .property("backend", "S3Express".to_string())
|
7747 7566 | .build()
|
7748 7567 | );
|
7749 7568 | }
|
7750 7569 |
|
7751 7570 | /// Data Plane with long AZ
|
7752 7571 | #[test]
|
7753 - | fn test_277() {
|
7572 + | fn test_276() {
|
7754 7573 | let params = crate::config::endpoint::Params::builder()
|
7755 7574 | .region("ap-northeast-1".to_string())
|
7756 7575 | .bucket("mybucket--apne1-az1--x-s3".to_string())
|
7757 7576 | .use_fips(false)
|
7758 7577 | .use_dual_stack(false)
|
7759 7578 | .accelerate(false)
|
7760 7579 | .use_s3_express_control_endpoint(false)
|
7761 7580 | .build()
|
7762 7581 | .expect("invalid params");
|
7763 7582 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7764 7583 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7765 7584 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybucket--apne1-az1--x-s3.s3express-apne1-az1.ap-northeast-1.amazonaws.com");
|
7766 7585 | assert_eq!(
|
7767 7586 | endpoint,
|
7768 7587 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7769 7588 | .url("https://mybucket--apne1-az1--x-s3.s3express-apne1-az1.ap-northeast-1.amazonaws.com")
|
7770 7589 | .property(
|
7771 7590 | "authSchemes",
|
7772 7591 | vec![::aws_smithy_types::Document::from({
|
7773 7592 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7774 7593 | out.insert("name".to_string(), "sigv4-s3express".to_string().into());
|
7775 7594 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
7776 7595 | out.insert("signingRegion".to_string(), "ap-northeast-1".to_string().into());
|
7777 7596 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7778 7597 | out
|
7779 7598 | })]
|
7780 7599 | )
|
7781 7600 | .property("backend", "S3Express".to_string())
|
7782 7601 | .build()
|
7783 7602 | );
|
7784 7603 | }
|
7785 7604 |
|
7786 7605 | /// Data Plane with long AZ fips
|
7787 7606 | #[test]
|
7788 - | fn test_278() {
|
7607 + | fn test_277() {
|
7789 7608 | let params = crate::config::endpoint::Params::builder()
|
7790 7609 | .region("ap-northeast-1".to_string())
|
7791 7610 | .bucket("mybucket--apne1-az1--x-s3".to_string())
|
7792 7611 | .use_fips(true)
|
7793 7612 | .use_dual_stack(false)
|
7794 7613 | .accelerate(false)
|
7795 7614 | .use_s3_express_control_endpoint(false)
|
7796 7615 | .build()
|
7797 7616 | .expect("invalid params");
|
7798 7617 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7799 7618 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7800 7619 | let endpoint =
|
7801 7620 | endpoint.expect("Expected valid endpoint: https://mybucket--apne1-az1--x-s3.s3express-fips-apne1-az1.ap-northeast-1.amazonaws.com");
|
7802 7621 | assert_eq!(
|
7803 7622 | endpoint,
|
7804 7623 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7805 7624 | .url("https://mybucket--apne1-az1--x-s3.s3express-fips-apne1-az1.ap-northeast-1.amazonaws.com")
|
7806 7625 | .property(
|
7807 7626 | "authSchemes",
|
7808 7627 | vec![::aws_smithy_types::Document::from({
|
7809 7628 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7810 7629 | out.insert("name".to_string(), "sigv4-s3express".to_string().into());
|
7811 7630 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
7812 7631 | out.insert("signingRegion".to_string(), "ap-northeast-1".to_string().into());
|
7813 7632 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7814 7633 | out
|
7815 7634 | })]
|
7816 7635 | )
|
7817 7636 | .property("backend", "S3Express".to_string())
|
7818 7637 | .build()
|
7819 7638 | );
|
7820 7639 | }
|
7821 7640 |
|
7822 7641 | /// Control plane with short AZ bucket
|
7823 7642 | #[test]
|
7824 - | fn test_279() {
|
7643 + | fn test_278() {
|
7825 7644 | let params = crate::config::endpoint::Params::builder()
|
7826 7645 | .region("us-east-1".to_string())
|
7827 7646 | .bucket("mybucket--use1-az1--x-s3".to_string())
|
7828 7647 | .use_fips(false)
|
7829 7648 | .use_dual_stack(false)
|
7830 7649 | .accelerate(false)
|
7831 7650 | .use_s3_express_control_endpoint(true)
|
7832 7651 | .disable_s3_express_session_auth(false)
|
7833 7652 | .build()
|
7834 7653 | .expect("invalid params");
|
7835 7654 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7836 7655 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7837 7656 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control.us-east-1.amazonaws.com/mybucket--use1-az1--x-s3");
|
7838 7657 | assert_eq!(
|
7839 7658 | endpoint,
|
7840 7659 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7841 7660 | .url("https://s3express-control.us-east-1.amazonaws.com/mybucket--use1-az1--x-s3")
|
7842 7661 | .property(
|
7843 7662 | "authSchemes",
|
7844 7663 | vec![::aws_smithy_types::Document::from({
|
7845 7664 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7846 7665 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7847 7666 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
7848 7667 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
7849 7668 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7850 7669 | out
|
7851 7670 | })]
|
7852 7671 | )
|
7853 7672 | .property("backend", "S3Express".to_string())
|
7854 7673 | .build()
|
7855 7674 | );
|
7856 7675 | }
|
7857 7676 |
|
7858 7677 | /// Control plane with short AZ bucket and fips
|
7859 7678 | #[test]
|
7860 - | fn test_280() {
|
7679 + | fn test_279() {
|
7861 7680 | let params = crate::config::endpoint::Params::builder()
|
7862 7681 | .region("us-east-1".to_string())
|
7863 7682 | .bucket("mybucket--use1-az1--x-s3".to_string())
|
7864 7683 | .use_fips(true)
|
7865 7684 | .use_dual_stack(false)
|
7866 7685 | .accelerate(false)
|
7867 7686 | .use_s3_express_control_endpoint(true)
|
7868 7687 | .disable_s3_express_session_auth(false)
|
7869 7688 | .build()
|
7870 7689 | .expect("invalid params");
|
7871 7690 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7872 7691 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7873 7692 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control-fips.us-east-1.amazonaws.com/mybucket--use1-az1--x-s3");
|
7874 7693 | assert_eq!(
|
7875 7694 | endpoint,
|
7876 7695 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7877 7696 | .url("https://s3express-control-fips.us-east-1.amazonaws.com/mybucket--use1-az1--x-s3")
|
7878 7697 | .property(
|
7879 7698 | "authSchemes",
|
7880 7699 | vec![::aws_smithy_types::Document::from({
|
7881 7700 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7882 7701 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7883 7702 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
7884 7703 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
7885 7704 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7886 7705 | out
|
7887 7706 | })]
|
7888 7707 | )
|
7889 7708 | .property("backend", "S3Express".to_string())
|
7890 7709 | .build()
|
7891 7710 | );
|
7892 7711 | }
|
7893 7712 |
|
7894 7713 | /// Control plane without bucket
|
7895 7714 | #[test]
|
7896 - | fn test_281() {
|
7715 + | fn test_280() {
|
7897 7716 | let params = crate::config::endpoint::Params::builder()
|
7898 7717 | .region("us-east-1".to_string())
|
7899 7718 | .use_fips(false)
|
7900 7719 | .use_dual_stack(false)
|
7901 7720 | .accelerate(false)
|
7902 7721 | .use_s3_express_control_endpoint(true)
|
7903 7722 | .disable_s3_express_session_auth(false)
|
7904 7723 | .build()
|
7905 7724 | .expect("invalid params");
|
7906 7725 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7907 7726 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7908 7727 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control.us-east-1.amazonaws.com");
|
7909 7728 | assert_eq!(
|
7910 7729 | endpoint,
|
7911 7730 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7912 7731 | .url("https://s3express-control.us-east-1.amazonaws.com")
|
7913 7732 | .property(
|
7914 7733 | "authSchemes",
|
7915 7734 | vec![::aws_smithy_types::Document::from({
|
7916 7735 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7917 7736 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7918 7737 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
7919 7738 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
7920 7739 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7921 7740 | out
|
7922 7741 | })]
|
7923 7742 | )
|
7924 7743 | .property("backend", "S3Express".to_string())
|
7925 7744 | .build()
|
7926 7745 | );
|
7927 7746 | }
|
7928 7747 |
|
7929 7748 | /// Control plane without bucket and fips
|
7930 7749 | #[test]
|
7931 - | fn test_282() {
|
7750 + | fn test_281() {
|
7932 7751 | let params = crate::config::endpoint::Params::builder()
|
7933 7752 | .region("us-east-1".to_string())
|
7934 7753 | .use_fips(true)
|
7935 7754 | .use_dual_stack(false)
|
7936 7755 | .accelerate(false)
|
7937 7756 | .use_s3_express_control_endpoint(true)
|
7938 7757 | .disable_s3_express_session_auth(false)
|
7939 7758 | .build()
|
7940 7759 | .expect("invalid params");
|
7941 7760 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7942 7761 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7943 7762 | let endpoint = endpoint.expect("Expected valid endpoint: https://s3express-control-fips.us-east-1.amazonaws.com");
|
7944 7763 | assert_eq!(
|
7945 7764 | endpoint,
|
7946 7765 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7947 7766 | .url("https://s3express-control-fips.us-east-1.amazonaws.com")
|
7948 7767 | .property(
|
7949 7768 | "authSchemes",
|
7950 7769 | vec![::aws_smithy_types::Document::from({
|
7951 7770 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7952 7771 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7953 7772 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
7954 7773 | out.insert("signingRegion".to_string(), "us-east-1".to_string().into());
|
7955 7774 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7956 7775 | out
|
7957 7776 | })]
|
7958 7777 | )
|
7959 7778 | .property("backend", "S3Express".to_string())
|
7960 7779 | .build()
|
7961 7780 | );
|
7962 7781 | }
|
7963 7782 |
|
7964 7783 | /// Data Plane sigv4 auth with short AZ
|
7965 7784 | #[test]
|
7966 - | fn test_283() {
|
7785 + | fn test_282() {
|
7967 7786 | let params = crate::config::endpoint::Params::builder()
|
7968 7787 | .region("us-west-2".to_string())
|
7969 7788 | .bucket("mybucket--usw2-az1--x-s3".to_string())
|
7970 7789 | .use_fips(false)
|
7971 7790 | .use_dual_stack(false)
|
7972 7791 | .accelerate(false)
|
7973 7792 | .disable_s3_express_session_auth(true)
|
7974 7793 | .build()
|
7975 7794 | .expect("invalid params");
|
7976 7795 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
7977 7796 | let endpoint = resolver.resolve_endpoint(¶ms);
|
7978 7797 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybucket--usw2-az1--x-s3.s3express-usw2-az1.us-west-2.amazonaws.com");
|
7979 7798 | assert_eq!(
|
7980 7799 | endpoint,
|
7981 7800 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
7982 7801 | .url("https://mybucket--usw2-az1--x-s3.s3express-usw2-az1.us-west-2.amazonaws.com")
|
7983 7802 | .property(
|
7984 7803 | "authSchemes",
|
7985 7804 | vec![::aws_smithy_types::Document::from({
|
7986 7805 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
7987 7806 | out.insert("name".to_string(), "sigv4".to_string().into());
|
7988 7807 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
7989 7808 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
7990 7809 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
7991 7810 | out
|
7992 7811 | })]
|
7993 7812 | )
|
7994 7813 | .property("backend", "S3Express".to_string())
|
7995 7814 | .build()
|
7996 7815 | );
|
7997 7816 | }
|
7998 7817 |
|
7999 7818 | /// Data Plane sigv4 auth with short AZ fips
|
8000 7819 | #[test]
|
8001 - | fn test_284() {
|
7820 + | fn test_283() {
|
8002 7821 | let params = crate::config::endpoint::Params::builder()
|
8003 7822 | .region("us-west-2".to_string())
|
8004 7823 | .bucket("mybucket--usw2-az1--x-s3".to_string())
|
8005 7824 | .use_fips(true)
|
8006 7825 | .use_dual_stack(false)
|
8007 7826 | .accelerate(false)
|
8008 7827 | .disable_s3_express_session_auth(true)
|
8009 7828 | .build()
|
8010 7829 | .expect("invalid params");
|
8011 7830 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8012 7831 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8013 7832 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybucket--usw2-az1--x-s3.s3express-fips-usw2-az1.us-west-2.amazonaws.com");
|
8014 7833 | assert_eq!(
|
8015 7834 | endpoint,
|
8016 7835 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
8017 7836 | .url("https://mybucket--usw2-az1--x-s3.s3express-fips-usw2-az1.us-west-2.amazonaws.com")
|
8018 7837 | .property(
|
8019 7838 | "authSchemes",
|
8020 7839 | vec![::aws_smithy_types::Document::from({
|
8021 7840 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
8022 7841 | out.insert("name".to_string(), "sigv4".to_string().into());
|
8023 7842 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
8024 7843 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
8025 7844 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
8026 7845 | out
|
8027 7846 | })]
|
8028 7847 | )
|
8029 7848 | .property("backend", "S3Express".to_string())
|
8030 7849 | .build()
|
8031 7850 | );
|
8032 7851 | }
|
8033 7852 |
|
8034 7853 | /// Data Plane sigv4 auth with long AZ
|
8035 7854 | #[test]
|
8036 - | fn test_285() {
|
7855 + | fn test_284() {
|
8037 7856 | let params = crate::config::endpoint::Params::builder()
|
8038 7857 | .region("ap-northeast-1".to_string())
|
8039 7858 | .bucket("mybucket--apne1-az1--x-s3".to_string())
|
8040 7859 | .use_fips(false)
|
8041 7860 | .use_dual_stack(false)
|
8042 7861 | .accelerate(false)
|
8043 7862 | .use_s3_express_control_endpoint(false)
|
8044 7863 | .disable_s3_express_session_auth(true)
|
8045 7864 | .build()
|
8046 7865 | .expect("invalid params");
|
8047 7866 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8048 7867 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8049 7868 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybucket--apne1-az1--x-s3.s3express-apne1-az1.ap-northeast-1.amazonaws.com");
|
8050 7869 | assert_eq!(
|
8051 7870 | endpoint,
|
8052 7871 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
8053 7872 | .url("https://mybucket--apne1-az1--x-s3.s3express-apne1-az1.ap-northeast-1.amazonaws.com")
|
8054 7873 | .property(
|
8055 7874 | "authSchemes",
|
8056 7875 | vec![::aws_smithy_types::Document::from({
|
8057 7876 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
8058 7877 | out.insert("name".to_string(), "sigv4".to_string().into());
|
8059 7878 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
8060 7879 | out.insert("signingRegion".to_string(), "ap-northeast-1".to_string().into());
|
8061 7880 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
8062 7881 | out
|
8063 7882 | })]
|
8064 7883 | )
|
8065 7884 | .property("backend", "S3Express".to_string())
|
8066 7885 | .build()
|
8067 7886 | );
|
8068 7887 | }
|
8069 7888 |
|
8070 7889 | /// Data Plane sigv4 auth with long AZ fips
|
8071 7890 | #[test]
|
8072 - | fn test_286() {
|
7891 + | fn test_285() {
|
8073 7892 | let params = crate::config::endpoint::Params::builder()
|
8074 7893 | .region("ap-northeast-1".to_string())
|
8075 7894 | .bucket("mybucket--apne1-az1--x-s3".to_string())
|
8076 7895 | .use_fips(true)
|
8077 7896 | .use_dual_stack(false)
|
8078 7897 | .accelerate(false)
|
8079 7898 | .use_s3_express_control_endpoint(false)
|
8080 7899 | .disable_s3_express_session_auth(true)
|
8081 7900 | .build()
|
8082 7901 | .expect("invalid params");
|
8083 7902 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8084 7903 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8085 7904 | let endpoint =
|
8086 7905 | endpoint.expect("Expected valid endpoint: https://mybucket--apne1-az1--x-s3.s3express-fips-apne1-az1.ap-northeast-1.amazonaws.com");
|
8087 7906 | assert_eq!(
|
8088 7907 | endpoint,
|
8089 7908 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
8090 7909 | .url("https://mybucket--apne1-az1--x-s3.s3express-fips-apne1-az1.ap-northeast-1.amazonaws.com")
|
8091 7910 | .property(
|
8092 7911 | "authSchemes",
|
8093 7912 | vec![::aws_smithy_types::Document::from({
|
8094 7913 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
8095 7914 | out.insert("name".to_string(), "sigv4".to_string().into());
|
8096 7915 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
8097 7916 | out.insert("signingRegion".to_string(), "ap-northeast-1".to_string().into());
|
8098 7917 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
8099 7918 | out
|
8100 7919 | })]
|
8101 7920 | )
|
8102 7921 | .property("backend", "S3Express".to_string())
|
8103 7922 | .build()
|
8104 7923 | );
|
8105 7924 | }
|
8106 7925 |
|
8107 7926 | /// Control Plane host override
|
8108 7927 | #[test]
|
8109 - | fn test_287() {
|
7928 + | fn test_286() {
|
8110 7929 | let params = crate::config::endpoint::Params::builder()
|
8111 7930 | .region("us-west-2".to_string())
|
8112 7931 | .bucket("mybucket--usw2-az1--x-s3".to_string())
|
8113 7932 | .use_fips(false)
|
8114 7933 | .use_dual_stack(false)
|
8115 7934 | .accelerate(false)
|
8116 7935 | .use_s3_express_control_endpoint(true)
|
8117 7936 | .disable_s3_express_session_auth(true)
|
8118 7937 | .endpoint("https://custom.com".to_string())
|
8119 7938 | .build()
|
8120 7939 | .expect("invalid params");
|
8121 7940 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8122 7941 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8123 7942 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybucket--usw2-az1--x-s3.custom.com");
|
8124 7943 | assert_eq!(
|
8125 7944 | endpoint,
|
8126 7945 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
8127 7946 | .url("https://mybucket--usw2-az1--x-s3.custom.com")
|
8128 7947 | .property(
|
8129 7948 | "authSchemes",
|
8130 7949 | vec![::aws_smithy_types::Document::from({
|
8131 7950 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
8132 7951 | out.insert("name".to_string(), "sigv4".to_string().into());
|
8133 7952 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
8134 7953 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
8135 7954 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
8136 7955 | out
|
8137 7956 | })]
|
8138 7957 | )
|
8139 7958 | .property("backend", "S3Express".to_string())
|
8140 7959 | .build()
|
8141 7960 | );
|
8142 7961 | }
|
8143 7962 |
|
8144 7963 | /// Control Plane host override no bucket
|
8145 7964 | #[test]
|
8146 - | fn test_288() {
|
7965 + | fn test_287() {
|
8147 7966 | let params = crate::config::endpoint::Params::builder()
|
8148 7967 | .region("us-west-2".to_string())
|
8149 7968 | .use_fips(false)
|
8150 7969 | .use_dual_stack(false)
|
8151 7970 | .accelerate(false)
|
8152 7971 | .use_s3_express_control_endpoint(true)
|
8153 7972 | .disable_s3_express_session_auth(true)
|
8154 7973 | .endpoint("https://custom.com".to_string())
|
8155 7974 | .build()
|
8156 7975 | .expect("invalid params");
|
8157 7976 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8158 7977 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8159 7978 | let endpoint = endpoint.expect("Expected valid endpoint: https://custom.com");
|
8160 7979 | assert_eq!(
|
8161 7980 | endpoint,
|
8162 7981 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
8163 7982 | .url("https://custom.com")
|
8164 7983 | .property(
|
8165 7984 | "authSchemes",
|
8166 7985 | vec![::aws_smithy_types::Document::from({
|
8167 7986 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
8168 7987 | out.insert("name".to_string(), "sigv4".to_string().into());
|
8169 7988 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
8170 7989 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
8171 7990 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
8172 7991 | out
|
8173 7992 | })]
|
8174 7993 | )
|
8175 7994 | .property("backend", "S3Express".to_string())
|
8176 7995 | .build()
|
8177 7996 | );
|
8178 7997 | }
|
8179 7998 |
|
8180 7999 | /// Data plane host override non virtual session auth
|
8181 8000 | #[test]
|
8182 - | fn test_289() {
|
8001 + | fn test_288() {
|
8183 8002 | let params = crate::config::endpoint::Params::builder()
|
8184 8003 | .region("us-west-2".to_string())
|
8185 8004 | .bucket("mybucket--usw2-az1--x-s3".to_string())
|
8186 8005 | .use_fips(false)
|
8187 8006 | .use_dual_stack(false)
|
8188 8007 | .accelerate(false)
|
8189 8008 | .endpoint("https://10.0.0.1".to_string())
|
8190 8009 | .build()
|
8191 8010 | .expect("invalid params");
|
8192 8011 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8193 8012 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8194 8013 | let endpoint = endpoint.expect("Expected valid endpoint: https://10.0.0.1/mybucket--usw2-az1--x-s3");
|
8195 8014 | assert_eq!(
|
8196 8015 | endpoint,
|
8197 8016 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
8198 8017 | .url("https://10.0.0.1/mybucket--usw2-az1--x-s3")
|
8199 8018 | .property(
|
8200 8019 | "authSchemes",
|
8201 8020 | vec![::aws_smithy_types::Document::from({
|
8202 8021 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
8203 8022 | out.insert("name".to_string(), "sigv4-s3express".to_string().into());
|
8204 8023 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
8205 8024 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
8206 8025 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
8207 8026 | out
|
8208 8027 | })]
|
8209 8028 | )
|
8210 8029 | .property("backend", "S3Express".to_string())
|
8211 8030 | .build()
|
8212 8031 | );
|
8213 8032 | }
|
8214 8033 |
|
8215 8034 | /// Control Plane host override ip
|
8216 8035 | #[test]
|
8217 - | fn test_290() {
|
8036 + | fn test_289() {
|
8218 8037 | let params = crate::config::endpoint::Params::builder()
|
8219 8038 | .region("us-west-2".to_string())
|
8220 8039 | .bucket("mybucket--usw2-az1--x-s3".to_string())
|
8221 8040 | .use_fips(false)
|
8222 8041 | .use_dual_stack(false)
|
8223 8042 | .accelerate(false)
|
8224 8043 | .use_s3_express_control_endpoint(true)
|
8225 8044 | .disable_s3_express_session_auth(true)
|
8226 8045 | .endpoint("https://10.0.0.1".to_string())
|
8227 8046 | .build()
|
8228 8047 | .expect("invalid params");
|
8229 8048 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8230 8049 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8231 8050 | let endpoint = endpoint.expect("Expected valid endpoint: https://10.0.0.1/mybucket--usw2-az1--x-s3");
|
8232 8051 | assert_eq!(
|
8233 8052 | endpoint,
|
8234 8053 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
8235 8054 | .url("https://10.0.0.1/mybucket--usw2-az1--x-s3")
|
8236 8055 | .property(
|
8237 8056 | "authSchemes",
|
8238 8057 | vec![::aws_smithy_types::Document::from({
|
8239 8058 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
8240 8059 | out.insert("name".to_string(), "sigv4".to_string().into());
|
8241 8060 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
8242 8061 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
8243 8062 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
8244 8063 | out
|
8245 8064 | })]
|
8246 8065 | )
|
8247 8066 | .property("backend", "S3Express".to_string())
|
8248 8067 | .build()
|
8249 8068 | );
|
8250 8069 | }
|
8251 8070 |
|
8252 8071 | /// Data plane host override
|
8253 8072 | #[test]
|
8254 - | fn test_291() {
|
8073 + | fn test_290() {
|
8255 8074 | let params = crate::config::endpoint::Params::builder()
|
8256 8075 | .region("us-west-2".to_string())
|
8257 8076 | .bucket("mybucket--usw2-az1--x-s3".to_string())
|
8258 8077 | .use_fips(false)
|
8259 8078 | .use_dual_stack(false)
|
8260 8079 | .accelerate(false)
|
8261 8080 | .endpoint("https://custom.com".to_string())
|
8262 8081 | .build()
|
8263 8082 | .expect("invalid params");
|
8264 8083 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8265 8084 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8266 8085 | let endpoint = endpoint.expect("Expected valid endpoint: https://mybucket--usw2-az1--x-s3.custom.com");
|
8267 8086 | assert_eq!(
|
8268 8087 | endpoint,
|
8269 8088 | ::aws_smithy_types::endpoint::Endpoint::builder()
|
8270 8089 | .url("https://mybucket--usw2-az1--x-s3.custom.com")
|
8271 8090 | .property(
|
8272 8091 | "authSchemes",
|
8273 8092 | vec![::aws_smithy_types::Document::from({
|
8274 8093 | let mut out = ::std::collections::HashMap::<String, ::aws_smithy_types::Document>::new();
|
8275 8094 | out.insert("name".to_string(), "sigv4-s3express".to_string().into());
|
8276 8095 | out.insert("signingName".to_string(), "s3express".to_string().into());
|
8277 8096 | out.insert("signingRegion".to_string(), "us-west-2".to_string().into());
|
8278 8097 | out.insert("disableDoubleEncoding".to_string(), true.into());
|
8279 8098 | out
|
8280 8099 | })]
|
8281 8100 | )
|
8282 8101 | .property("backend", "S3Express".to_string())
|
8283 8102 | .build()
|
8284 8103 | );
|
8285 8104 | }
|
8286 8105 |
|
8287 8106 | /// bad format error
|
8288 8107 | #[test]
|
8289 - | fn test_292() {
|
8108 + | fn test_291() {
|
8290 8109 | let params = crate::config::endpoint::Params::builder()
|
8291 8110 | .region("us-east-1".to_string())
|
8292 8111 | .bucket("mybucket--usaz1--x-s3".to_string())
|
8293 8112 | .use_fips(false)
|
8294 8113 | .use_dual_stack(false)
|
8295 8114 | .accelerate(false)
|
8296 8115 | .use_s3_express_control_endpoint(false)
|
8297 8116 | .build()
|
8298 8117 | .expect("invalid params");
|
8299 8118 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8300 8119 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8301 8120 | let error = endpoint.expect_err("expected error: Unrecognized S3Express bucket name format. [bad format error]");
|
8302 8121 | assert_eq!(format!("{}", error), "Unrecognized S3Express bucket name format.")
|
8303 8122 | }
|
8304 8123 |
|
8305 8124 | /// bad format error no session auth
|
8306 8125 | #[test]
|
8307 - | fn test_293() {
|
8126 + | fn test_292() {
|
8308 8127 | let params = crate::config::endpoint::Params::builder()
|
8309 8128 | .region("us-east-1".to_string())
|
8310 8129 | .bucket("mybucket--usaz1--x-s3".to_string())
|
8311 8130 | .use_fips(false)
|
8312 8131 | .use_dual_stack(false)
|
8313 8132 | .accelerate(false)
|
8314 8133 | .use_s3_express_control_endpoint(false)
|
8315 8134 | .disable_s3_express_session_auth(true)
|
8316 8135 | .build()
|
8317 8136 | .expect("invalid params");
|
8318 8137 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8319 8138 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8320 8139 | let error = endpoint.expect_err("expected error: Unrecognized S3Express bucket name format. [bad format error no session auth]");
|
8321 8140 | assert_eq!(format!("{}", error), "Unrecognized S3Express bucket name format.")
|
8322 8141 | }
|
8323 8142 |
|
8324 8143 | /// dual-stack error
|
8325 8144 | #[test]
|
8326 - | fn test_294() {
|
8145 + | fn test_293() {
|
8327 8146 | let params = crate::config::endpoint::Params::builder()
|
8328 8147 | .region("us-east-1".to_string())
|
8329 8148 | .bucket("mybucket--use1-az1--x-s3".to_string())
|
8330 8149 | .use_fips(false)
|
8331 8150 | .use_dual_stack(true)
|
8332 8151 | .accelerate(false)
|
8333 8152 | .use_s3_express_control_endpoint(false)
|
8334 8153 | .build()
|
8335 8154 | .expect("invalid params");
|
8336 8155 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8337 8156 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8338 8157 | let error = endpoint.expect_err("expected error: S3Express does not support Dual-stack. [dual-stack error]");
|
8339 8158 | assert_eq!(format!("{}", error), "S3Express does not support Dual-stack.")
|
8340 8159 | }
|
8341 8160 |
|
8342 8161 | /// accelerate error
|
8343 8162 | #[test]
|
8344 - | fn test_295() {
|
8163 + | fn test_294() {
|
8345 8164 | let params = crate::config::endpoint::Params::builder()
|
8346 8165 | .region("us-east-1".to_string())
|
8347 8166 | .bucket("mybucket--use1-az1--x-s3".to_string())
|
8348 8167 | .use_fips(false)
|
8349 8168 | .use_dual_stack(false)
|
8350 8169 | .accelerate(true)
|
8351 8170 | .use_s3_express_control_endpoint(false)
|
8352 8171 | .build()
|
8353 8172 | .expect("invalid params");
|
8354 8173 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8355 8174 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8356 8175 | let error = endpoint.expect_err("expected error: S3Express does not support S3 Accelerate. [accelerate error]");
|
8357 8176 | assert_eq!(format!("{}", error), "S3Express does not support S3 Accelerate.")
|
8358 8177 | }
|
8359 8178 |
|
8360 8179 | /// Data plane bucket format error
|
8361 8180 | #[test]
|
8362 - | fn test_296() {
|
8181 + | fn test_295() {
|
8363 8182 | let params = crate::config::endpoint::Params::builder()
|
8364 8183 | .region("us-east-1".to_string())
|
8365 8184 | .bucket("my.bucket--use1-az1--x-s3".to_string())
|
8366 8185 | .use_fips(false)
|
8367 8186 | .use_dual_stack(false)
|
8368 8187 | .accelerate(false)
|
8369 8188 | .use_s3_express_control_endpoint(false)
|
8370 8189 | .build()
|
8371 8190 | .expect("invalid params");
|
8372 8191 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8373 8192 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8374 8193 | let error =
|
8375 8194 | endpoint.expect_err("expected error: S3Express bucket name is not a valid virtual hostable name. [Data plane bucket format error]");
|
8376 8195 | assert_eq!(format!("{}", error), "S3Express bucket name is not a valid virtual hostable name.")
|
8377 8196 | }
|
8378 8197 |
|
8379 8198 | /// host override data plane bucket error session auth
|
8380 8199 | #[test]
|
8381 - | fn test_297() {
|
8200 + | fn test_296() {
|
8382 8201 | let params = crate::config::endpoint::Params::builder()
|
8383 8202 | .region("us-west-2".to_string())
|
8384 8203 | .bucket("my.bucket--usw2-az1--x-s3".to_string())
|
8385 8204 | .use_fips(false)
|
8386 8205 | .use_dual_stack(false)
|
8387 8206 | .accelerate(false)
|
8388 8207 | .endpoint("https://custom.com".to_string())
|
8389 8208 | .build()
|
8390 8209 | .expect("invalid params");
|
8391 8210 | let resolver = crate::config::endpoint::DefaultResolver::new();
|
8392 8211 | let endpoint = resolver.resolve_endpoint(¶ms);
|
8393 8212 | let error = endpoint.expect_err(
|
8394 8213 | "expected error: S3Express bucket name is not a valid virtual hostable name. [host override data plane bucket error session auth]",
|
8395 8214 | );
|
8396 8215 | assert_eq!(format!("{}", error), "S3Express bucket name is not a valid virtual hostable name.")
|
8397 8216 | }
|
8398 8217 |
|
8399 8218 | /// host override data plane bucket error
|
8400 8219 | #[test]
|
8401 - | fn test_298() {
|
8220 + | fn test_297() {
|
8402 8221 | let params = crate::config::endpoint::Params::builder()
|
8403 8222 | .region("us-west-2".to_string())
|
8404 8223 | .bucket("my.bucket--usw2-az1--x-s3".to_string())
|
8405 8224 | .use_fips(false)
|
8406 8225 | .use_dual_stack(false)
|
8407 8226 | .accelerate(false)
|
8408 8227 | .endpoint("https://custom.com".to_string())
|
8409 8228 | .disable_s3_express_session_auth(true)
|
8410 8229 | .build()
|
8411 8230 | .expect("invalid params");
|