Skip to content

Commit 8371448

Browse files
committed
Merge branch 'main' into next-release/main
2 parents 563f3a9 + b338b11 commit 8371448

File tree

89 files changed

+6429
-695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+6429
-695
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
* @aws-amplify/documentation-team
2-
31
#Other
42
/src/pages/gen1/\[platform\]/build-a-backend/existing-resources/ @josefaidt @hdworld11 @dbanksdesign
53
/src/pages/gen1/\[platform\]/build-a-backend/functions/ @josefaidt
@@ -162,9 +160,9 @@
162160
/src/pages/gen1/\[platform\]/prev/build-a-backend/utilities/ @josefaidt
163161

164162
#Deploy and Host
165-
/src/pages/gen1/\[platform\]/deploy-and-host/ @mauerbac
166-
/src/pages/gen1/\[platform\]/prev/deploy-and-host/ @mauerbac
167-
/src/pages/\[platform\]/deploy-and-host/ @mauerbac
163+
/src/pages/gen1/\[platform\]/deploy-and-host/ @mauerbac @josefaidt
164+
/src/pages/gen1/\[platform\]/prev/deploy-and-host/ @mauerbac @josefaidt
165+
/src/pages/\[platform\]/deploy-and-host/ @mauerbac @josefaidt
168166

169167
#Docs Engineering
170168
/src/components @aws-amplify/documentation-team
@@ -186,4 +184,4 @@
186184
.github @aws-amplify/documentation-team
187185

188186
#Protected Content
189-
/src/protected @reesscot @srquinn21 @swaminator
187+
/src/protected @srquinn21 @swaminator

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ We welcome contributions to the documentation site! Here's how to do it:
3737

3838
## Authoring pages
3939

40-
Our docs are generated using [Next.js](https://nextjs.org/). Refer to their docs on [how to create pages](https://nextjs.org/docs/basic-features/pages) as a primer.
40+
Our docs are generated using [Next.js](https://nextjs.org/). Refer to their docs on [how to create pages](https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts) as a primer.
4141

4242
The source for each page is in **src**. This folder is the only directory you need to touch to edit or create pages.
4343

cspell.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,14 +1614,29 @@
16141614
"ampx",
16151615
"autodetection",
16161616
"jamba",
1617-
"knowledgebases"
1617+
"webauthn",
1618+
"knowledgebases",
1619+
"rehype",
1620+
"assetlinks",
1621+
"AMPLIFYRULES",
1622+
"manylinux",
1623+
"GOARCH",
1624+
"norpc"
1625+
],
1626+
"flagWords": [
1627+
"hte",
1628+
"full-stack",
1629+
"Full-stack",
1630+
"Full-Stack",
1631+
"sudo"
16181632
],
1619-
"flagWords": ["hte", "full-stack", "Full-stack", "Full-Stack", "sudo"],
16201633
"patterns": [
16211634
{
16221635
"name": "youtube-embed-ids",
16231636
"pattern": "/embedId=\".*\" /"
16241637
}
16251638
],
1626-
"ignoreRegExpList": ["youtube-embed-ids"]
1639+
"ignoreRegExpList": [
1640+
"youtube-embed-ids"
1641+
]
16271642
}

mdx-components.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from 'react';
22
import type { MDXComponents } from 'mdx/types';
33
import ExportedImage from 'next-image-export-optimizer';
4+
import { AIBanner } from './src/components/AIBanner';
45
import InlineFilter from './src/components/InlineFilter';
56
import { YoutubeEmbed } from './src/components/YoutubeEmbed';
67
import { Accordion } from './src/components/Accordion';
@@ -64,6 +65,7 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
6465
InlineFilter,
6566
MigrationAlert,
6667
YoutubeEmbed,
68+
AIBanner,
6769
Overview,
6870
ExternalLink,
6971
ExternalLinkButton,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"private": true,
1111
"dependencies": {
1212
"@aws-amplify/amplify-cli-core": "^4.3.9",
13-
"@aws-amplify/ui-react": "^6.3.1",
13+
"@aws-amplify/ui-react": "^6.7.0",
14+
"@aws-amplify/ui-react-ai": "^1.0.0",
1415
"@docsearch/react": "3",
1516
"ajv": "^8.16.0",
1617
"aws-amplify": "^6.0.9",
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
# AMPLIFYRULES
2+
3+
- RULES THAT SHOULD BE ADHERED TO THE LAST WORD.
4+
5+
1. EXTERNAL PROVIDERS THAT ARE AVAILABLE ARE LISTED BELOW IN THE EXAMPLE, DON'T CHANGE THE NAMING CONVENTION WHILE USING THOSE IN THE CODE GENERATION.
6+
2. DON'T FORGET TO IMPORT SECRET FOR ANY AUTHENTICATION BASED QUESTION.
7+
8+
```typescript
9+
import { defineAuth, secret } from "@aws-amplify/backend";
10+
```
11+
12+
3. CALLBACK AND LOGOUT URLS SHOULD BE INSIDE THE "EXTERNALPROVIDERS" OBJECT.
13+
4. WHILE ADDING THE CUSTOM ATTRIBUTES, IF THE ATTRIBUTE YOU ARE ADDING DOESNT BELONG TO THE STANDARD USER ATTRIBUTES LIST THEN ADD IT AS A CUSTOM ATTRIBUTE LIKE THIS "CUSTOM:ATTRIBUTE_NAME" AND THIS DOESN'T SUPPORT "REQUIRED" FIELD SO IGNORE IT WHILE GENERATING THE ANSWER.
14+
5. WHILE ADDING THE CUSTOM ATTRIBUTES, MAKE SURE TO ALWAYS ADD THE "DATATYPE" FIELD AS IT IS A REQUIRED FIELD.
15+
6. STATNDARD ATTIBUTES THAT ARE ALLOWED: `familyName`, `giveName`, `middleName`, `nickname`, `preferredUsername`, `profile`, `profilePicture`, `website`, `gender`, `birthdate`, `zoneinfo`, `locale`, `updatedAt`, `address`, `email`, `phoneNumber`, `sub`. THE `userAttributes` ARE SUPPOSED TO BE OUTSIDE THE `loginWith` OBJECT
16+
17+
7. THE FOLLOWING IS THE REQUIRED SYNTAX FOR `externalProviders`. ONLY THE FOUR LISTED PROVIDERS BELOW ARE SUPPORTED:
18+
19+
```typescript
20+
loginWith:{
21+
//loginMethods
22+
externalProviders: {
23+
google: {
24+
25+
},
26+
signInWithApple: {
27+
},
28+
loginWithAmazon: {
29+
30+
},
31+
facebook: {
32+
},
33+
callbackUrls: [
34+
// Callback URLs should be included inside the `externalProviders` object only, as per rule.
35+
36+
],
37+
logoutUrls: [
38+
// Logout URLs should also be included inside `externalProviders` as per rule.
39+
40+
],
41+
},
42+
}
43+
```
44+
45+
8. THE `userAttributes` ARE SUPPOSED TO BE OUTSIDE THE `loginWith` OBJECT
46+
`// Example configuration for user attributes and login methods
47+
loginWith: {
48+
// Specify login methods separately from user attributes, ONLY MENTION THE LOGINMETHODS THAT ARE SUPPOSED TO BE TRUE
49+
email: true, // Enable login with email
50+
phone: false, // Disable login with phone number
51+
},userAttributes: {
52+
email: true, // Attribute set as required
53+
phoneNumber: false, // Attribute not required
54+
givenName: true, // Attribute set as required
55+
},`
56+
9. THIS IS THE WAY TO SETUP THE MULTIFACTOR AUTHENTHICATION
57+
export const auth = defineAuth({
58+
loginWith: {
59+
email: true,
60+
phone: true,
61+
},
62+
multifactor: {
63+
mode: "OPTIONAL",
64+
sms: true,
65+
totp: false,
66+
},
67+
// IMPORTANT! THE LOGIC TO RESOLVE THIS VALUE CANNOT DETERMINE WHETHER EMAIL MFA IS ENABLED WHEN OVERRIDING THE RESOURCE.
68+
// BE SURE TO PICK A RECOVERY OPTION APPROPRIATE FOR YOUR APPLICATION.
69+
accountRecovery: "EMAIL_AND_PHONE_WITHOUT_MFA",
70+
senders: {
71+
email: {
72+
fromEmail: "[email protected]",
73+
},
74+
},
75+
})
76+
10. DON'T ADD THE `passwordPolicy` IN THE AUTH/RESOURCE.TS FILE.
77+
11. THE `username` SHOULD BE REPLACED WITH `userAttributes` WHEN REQUESTED TO SETUP USERNAME AS A LOGIN METHOD AS USERNAME IS NOT A VALID LOGIN METHOD ON DEFINEAUTH, FOR EXAMPLE:
78+
79+
```typescript
80+
userAttributes: {
81+
preferredUsername: {
82+
mutable: true,
83+
required: false
84+
}
85+
}
86+
```
87+
88+
12. `loginWith` SUPPORTS ONLY TWO METHODS THAT IS `email` and `phone`. THERE IS NO `username` attribute to that.
89+
13. THE `callbackUrls` AND `logoutUrls` SHOULD ONLY BE MENTIONED ONCE AS MENTIONED IN RULE #7 AND NOT FOR EACH EXTERNAL PROVIDER
90+
91+
```typescript
92+
import { defineAuth, secret } from "@aws-amplify/backend";
93+
94+
export const auth = defineAuth({
95+
// Login Methods Configuration
96+
loginWith: {
97+
// Only email and phone are supported as login methods
98+
email: true,
99+
phone: true,
100+
101+
// External Providers Configuration - all providers shown with required fields
102+
externalProviders: {
103+
// Google Authentication
104+
google: {
105+
clientId: secret("GOOGLE_CLIENT_ID"),
106+
clientSecret: secret("GOOGLE_CLIENT_SECRET"),
107+
},
108+
// Sign in with Apple
109+
signInWithApple: {
110+
clientId: secret("SIWA_CLIENT_ID"),
111+
keyId: secret("SIWA_KEY_ID"),
112+
privateKey: secret("SIWA_PRIVATE_KEY"),
113+
teamId: secret("SIWA_TEAM_ID"),
114+
},
115+
// Login with Amazon
116+
loginWithAmazon: {
117+
clientId: secret("LOGINWITHAMAZON_CLIENT_ID"),
118+
clientSecret: secret("LOGINWITHAMAZON_CLIENT_SECRET"),
119+
},
120+
// Facebook Authentication
121+
facebook: {
122+
clientId: secret("FACEBOOK_CLIENT_ID"),
123+
clientSecret: secret("FACEBOOK_CLIENT_SECRET"),
124+
},
125+
// Callback and logout URLs must be inside externalProviders
126+
callbackUrls: [
127+
"http://localhost:3000/profile",
128+
"https://mywebsite.com/profile",
129+
],
130+
logoutUrls: ["http://localhost:3000/", "https://mywebsite.com"],
131+
},
132+
},
133+
134+
// User Attributes Configuration - outside loginWith
135+
userAttributes: {
136+
// Standard attributes examples
137+
email: {
138+
mutable: true,
139+
required: true,
140+
},
141+
phoneNumber: {
142+
mutable: true,
143+
required: false,
144+
},
145+
givenName: {
146+
mutable: true,
147+
required: true,
148+
},
149+
familyName: {
150+
mutable: true,
151+
required: false,
152+
},
153+
birthdate: {
154+
mutable: true,
155+
required: false,
156+
},
157+
// Username configuration using preferredUsername
158+
preferredUsername: {
159+
mutable: true,
160+
required: false,
161+
},
162+
// Additional standard attributes
163+
address: {
164+
mutable: true,
165+
required: false,
166+
},
167+
gender: {
168+
mutable: true,
169+
required: false,
170+
},
171+
locale: {
172+
mutable: true,
173+
required: false,
174+
},
175+
profilePicture: {
176+
mutable: true,
177+
required: false,
178+
},
179+
website: {
180+
mutable: true,
181+
required: false,
182+
},
183+
// Custom attributes examples - note the 'custom:' prefix and required dataType
184+
"custom:organization": {
185+
dataType: "String",
186+
mutable: true,
187+
minLen: 3,
188+
maxLen: 100,
189+
},
190+
"custom:employeeId": {
191+
dataType: "Number",
192+
mutable: false,
193+
min: 1000,
194+
max: 9999999,
195+
},
196+
"custom:isVerified": {
197+
dataType: "Boolean",
198+
mutable: true,
199+
},
200+
},
201+
202+
// Multi-factor Authentication Configuration
203+
multifactor: {
204+
mode: "OPTIONAL", // Can be OPTIONAL or REQUIRED
205+
sms: true,
206+
totp: false,
207+
},
208+
209+
// Account Recovery Configuration
210+
accountRecovery: "EMAIL_AND_PHONE_WITHOUT_MFA",
211+
212+
// Email Sender Configuration
213+
senders: {
214+
email: {
215+
fromEmail: "[email protected]",
216+
},
217+
},
218+
});
219+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# AMPLIFYRULES
2+
3+
1. ALWAYS MENTION WHICH FILE PATH THE USER NEED TO PASTE THE CODE IN.
4+
2. MAKE SURE IF IT IS IN TWO DIFFERENT FILES, YOU DIVIDE THE CODE SNIPPET AND MENTION THE FILE PATH
5+
3. IF THE FILE DOESN'T ALREADY EXIST, GIVE THE STEPS TO GENERATE THE FILES.
6+
4. COMMENT ON EVERY PIECE OF CODE THAT CAN HELP IMPROVE CODE QUALITY THAT EXPLAINS WHAT THE LINE DOES

0 commit comments

Comments
 (0)