|
1 | 1 | import { beforeEach, describe, it, mock } from 'node:test'; |
2 | 2 | import { AmplifyAuth } from './construct.js'; |
3 | 3 | import { App, SecretValue, Stack } from 'aws-cdk-lib'; |
4 | | -import { Match, Template } from 'aws-cdk-lib/assertions'; |
| 4 | +import { Template } from 'aws-cdk-lib/assertions'; |
5 | 5 | import assert from 'node:assert'; |
6 | 6 | import { |
7 | 7 | BackendOutputEntry, |
@@ -1399,25 +1399,6 @@ void describe('Auth construct', () => { |
1399 | 1399 | ProviderName: oidcProviderName, |
1400 | 1400 | ProviderType: 'OIDC', |
1401 | 1401 | }); |
1402 | | - template.hasResourceProperties('AWS::Cognito::IdentityPool', { |
1403 | | - OpenIdConnectProviderARNs: [ |
1404 | | - Match.objectEquals({ |
1405 | | - 'Fn::Join': [ |
1406 | | - '', |
1407 | | - [ |
1408 | | - 'arn:aws:iam:', |
1409 | | - { Ref: 'AWS::Region' }, |
1410 | | - ':', |
1411 | | - { Ref: 'AWS::AccountId' }, |
1412 | | - ':oidc-provider/cognito-idp.', |
1413 | | - { Ref: 'AWS::Region' }, |
1414 | | - '.amazonaws.com/', |
1415 | | - { Ref: 'testMyOidcProviderOidcIDP837BDEAD' }, |
1416 | | - ], |
1417 | | - ], |
1418 | | - }), |
1419 | | - ], |
1420 | | - }); |
1421 | 1402 | }); |
1422 | 1403 | void it('oidc defaults to GET for oidc method', () => { |
1423 | 1404 | const app = new App(); |
@@ -1482,25 +1463,6 @@ void describe('Auth construct', () => { |
1482 | 1463 | ProviderName: oidcProviderName, |
1483 | 1464 | ProviderType: 'OIDC', |
1484 | 1465 | }); |
1485 | | - template.hasResourceProperties('AWS::Cognito::IdentityPool', { |
1486 | | - OpenIdConnectProviderARNs: [ |
1487 | | - Match.objectEquals({ |
1488 | | - 'Fn::Join': [ |
1489 | | - '', |
1490 | | - [ |
1491 | | - 'arn:aws:iam:', |
1492 | | - { Ref: 'AWS::Region' }, |
1493 | | - ':', |
1494 | | - { Ref: 'AWS::AccountId' }, |
1495 | | - ':oidc-provider/cognito-idp.', |
1496 | | - { Ref: 'AWS::Region' }, |
1497 | | - '.amazonaws.com/', |
1498 | | - { Ref: 'testMyOidcProviderOidcIDP837BDEAD' }, |
1499 | | - ], |
1500 | | - ], |
1501 | | - }), |
1502 | | - ], |
1503 | | - }); |
1504 | 1466 | }); |
1505 | 1467 | void it('supports oidc and phone', () => { |
1506 | 1468 | const app = new App(); |
@@ -1531,25 +1493,6 @@ void describe('Auth construct', () => { |
1531 | 1493 | 'AWS::Cognito::UserPoolIdentityProvider', |
1532 | 1494 | ExpectedOidcIDPProperties |
1533 | 1495 | ); |
1534 | | - template.hasResourceProperties('AWS::Cognito::IdentityPool', { |
1535 | | - OpenIdConnectProviderARNs: [ |
1536 | | - Match.objectEquals({ |
1537 | | - 'Fn::Join': [ |
1538 | | - '', |
1539 | | - [ |
1540 | | - 'arn:aws:iam:', |
1541 | | - { Ref: 'AWS::Region' }, |
1542 | | - ':', |
1543 | | - { Ref: 'AWS::AccountId' }, |
1544 | | - ':oidc-provider/cognito-idp.', |
1545 | | - { Ref: 'AWS::Region' }, |
1546 | | - '.amazonaws.com/', |
1547 | | - { Ref: 'testMyOidcProviderOidcIDP837BDEAD' }, |
1548 | | - ], |
1549 | | - ], |
1550 | | - }), |
1551 | | - ], |
1552 | | - }); |
1553 | 1496 | }); |
1554 | 1497 | void it('supports multiple oidc providers', () => { |
1555 | 1498 | const app = new App(); |
@@ -1590,40 +1533,6 @@ void describe('Auth construct', () => { |
1590 | 1533 | 'AWS::Cognito::UserPoolIdentityProvider', |
1591 | 1534 | ExpectedOidcIDPProperties2 |
1592 | 1535 | ); |
1593 | | - template.hasResourceProperties('AWS::Cognito::IdentityPool', { |
1594 | | - OpenIdConnectProviderARNs: [ |
1595 | | - Match.objectEquals({ |
1596 | | - 'Fn::Join': [ |
1597 | | - '', |
1598 | | - [ |
1599 | | - 'arn:aws:iam:', |
1600 | | - { Ref: 'AWS::Region' }, |
1601 | | - ':', |
1602 | | - { Ref: 'AWS::AccountId' }, |
1603 | | - ':oidc-provider/cognito-idp.', |
1604 | | - { Ref: 'AWS::Region' }, |
1605 | | - '.amazonaws.com/', |
1606 | | - { Ref: 'testMyOidcProviderOidcIDP837BDEAD' }, |
1607 | | - ], |
1608 | | - ], |
1609 | | - }), |
1610 | | - Match.objectEquals({ |
1611 | | - 'Fn::Join': [ |
1612 | | - '', |
1613 | | - [ |
1614 | | - 'arn:aws:iam:', |
1615 | | - { Ref: 'AWS::Region' }, |
1616 | | - ':', |
1617 | | - { Ref: 'AWS::AccountId' }, |
1618 | | - ':oidc-provider/cognito-idp.', |
1619 | | - { Ref: 'AWS::Region' }, |
1620 | | - '.amazonaws.com/', |
1621 | | - { Ref: 'testMyOidcProvider2OidcIDP43D7B07B' }, |
1622 | | - ], |
1623 | | - ], |
1624 | | - }), |
1625 | | - ], |
1626 | | - }); |
1627 | 1536 | }); |
1628 | 1537 | void it('supports saml and email', () => { |
1629 | 1538 | const app = new App(); |
@@ -1653,23 +1562,6 @@ void describe('Auth construct', () => { |
1653 | 1562 | 'AWS::Cognito::UserPoolIdentityProvider', |
1654 | 1563 | ExpectedSAMLIDPProperties |
1655 | 1564 | ); |
1656 | | - template.hasResourceProperties('AWS::Cognito::IdentityPool', { |
1657 | | - SamlProviderARNs: [ |
1658 | | - Match.objectEquals({ |
1659 | | - 'Fn::Join': [ |
1660 | | - '', |
1661 | | - [ |
1662 | | - 'arn:aws:iam:', |
1663 | | - { Ref: 'AWS::Region' }, |
1664 | | - ':', |
1665 | | - { Ref: 'AWS::AccountId' }, |
1666 | | - ':saml-provider/', |
1667 | | - { Ref: 'testSamlIDP7B98F3F4' }, |
1668 | | - ], |
1669 | | - ], |
1670 | | - }), |
1671 | | - ], |
1672 | | - }); |
1673 | 1565 | }); |
1674 | 1566 | void it('supports saml and phone', () => { |
1675 | 1567 | const app = new App(); |
@@ -1699,23 +1591,6 @@ void describe('Auth construct', () => { |
1699 | 1591 | 'AWS::Cognito::UserPoolIdentityProvider', |
1700 | 1592 | ExpectedSAMLIDPProperties |
1701 | 1593 | ); |
1702 | | - template.hasResourceProperties('AWS::Cognito::IdentityPool', { |
1703 | | - SamlProviderARNs: [ |
1704 | | - Match.objectEquals({ |
1705 | | - 'Fn::Join': [ |
1706 | | - '', |
1707 | | - [ |
1708 | | - 'arn:aws:iam:', |
1709 | | - { Ref: 'AWS::Region' }, |
1710 | | - ':', |
1711 | | - { Ref: 'AWS::AccountId' }, |
1712 | | - ':saml-provider/', |
1713 | | - { Ref: 'testSamlIDP7B98F3F4' }, |
1714 | | - ], |
1715 | | - ], |
1716 | | - }), |
1717 | | - ], |
1718 | | - }); |
1719 | 1594 | }); |
1720 | 1595 | void it('supports saml via URL and email', () => { |
1721 | 1596 | const app = new App(); |
@@ -1745,23 +1620,6 @@ void describe('Auth construct', () => { |
1745 | 1620 | 'AWS::Cognito::UserPoolIdentityProvider', |
1746 | 1621 | ExpectedSAMLIDPViaURLProperties |
1747 | 1622 | ); |
1748 | | - template.hasResourceProperties('AWS::Cognito::IdentityPool', { |
1749 | | - SamlProviderARNs: [ |
1750 | | - Match.objectEquals({ |
1751 | | - 'Fn::Join': [ |
1752 | | - '', |
1753 | | - [ |
1754 | | - 'arn:aws:iam:', |
1755 | | - { Ref: 'AWS::Region' }, |
1756 | | - ':', |
1757 | | - { Ref: 'AWS::AccountId' }, |
1758 | | - ':saml-provider/', |
1759 | | - { Ref: 'testSamlIDP7B98F3F4' }, |
1760 | | - ], |
1761 | | - ], |
1762 | | - }), |
1763 | | - ], |
1764 | | - }); |
1765 | 1623 | }); |
1766 | 1624 |
|
1767 | 1625 | void it('supports additional oauth settings', () => { |
|
0 commit comments