@ttoss/react-auth 1.7.21 → 1.7.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/esm/index.js +28 -0
  2. package/package.json +4 -4
package/dist/esm/index.js CHANGED
@@ -358,6 +358,10 @@ var DenyStatement = {
358
358
  Action: ["*"],
359
359
  Resource: ["*"]
360
360
  };
361
+ var defaultPrincipalTags = {
362
+ appClientId: "aud",
363
+ userId: "sub"
364
+ };
361
365
  var createAuthTemplate = ({
362
366
  autoVerifiedAttributes = ["email"],
363
367
  identityPool,
@@ -588,6 +592,30 @@ var createAuthTemplate = ({
588
592
  } else {
589
593
  template.Resources.CognitoIdentityPoolRoleAttachment.Properties.Roles.unauthenticated = identityPool.unauthenticatedRoleArn;
590
594
  }
595
+ if (identityPool.principalTags || identityPool.principalTags === void 0) {
596
+ const PrincipalTags = (() => {
597
+ if (typeof identityPool.principalTags === "boolean") {
598
+ return defaultPrincipalTags;
599
+ }
600
+ if (identityPool.principalTags === void 0) {
601
+ return defaultPrincipalTags;
602
+ }
603
+ return identityPool.principalTags;
604
+ })();
605
+ template.Resources.CognitoIdentityPoolPrincipalTag = {
606
+ Type: "AWS::Cognito::IdentityPoolPrincipalTag",
607
+ Properties: {
608
+ IdentityPoolId: {
609
+ Ref: CognitoIdentityPoolLogicalId
610
+ },
611
+ IdentityProviderName: {
612
+ "Fn::GetAtt": [CognitoUserPoolLogicalId, "ProviderName"]
613
+ },
614
+ PrincipalTags,
615
+ UseDefaults: false
616
+ }
617
+ };
618
+ }
591
619
  if (!template.Outputs) {
592
620
  template.Outputs = {};
593
621
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/react-auth",
3
- "version": "1.7.21",
3
+ "version": "1.7.22",
4
4
  "description": "ttoss authentication module for React apps.",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -32,8 +32,8 @@
32
32
  "peerDependencies": {
33
33
  "aws-amplify": "^5.0.0",
34
34
  "react": ">=16.8.0",
35
- "@ttoss/react-i18n": "^1.25.8",
36
35
  "@ttoss/react-notifications": "^1.24.22",
36
+ "@ttoss/react-i18n": "^1.25.8",
37
37
  "@ttoss/ui": "^4.0.7"
38
38
  },
39
39
  "devDependencies": {
@@ -42,11 +42,11 @@
42
42
  "aws-amplify": "^5.3.11",
43
43
  "jest": "^29.7.0",
44
44
  "tsup": "^8.0.1",
45
- "@ttoss/cloud-auth": "^0.11.0",
45
+ "@ttoss/cloud-auth": "^0.12.0",
46
46
  "@ttoss/config": "^1.31.4",
47
47
  "@ttoss/i18n-cli": "^0.7.5",
48
- "@ttoss/react-notifications": "^1.24.22",
49
48
  "@ttoss/react-i18n": "^1.25.8",
49
+ "@ttoss/react-notifications": "^1.24.22",
50
50
  "@ttoss/test-utils": "^2.0.4",
51
51
  "@ttoss/ui": "^4.0.7"
52
52
  },