Skip to content

Commit 896595b

Browse files
authored
Merge branch 'main' into feature/12820/crossTab-signIn-signOut
2 parents e9c1725 + ac06885 commit 896595b

File tree

335 files changed

+10883
-2454
lines changed

Some content is hidden

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

335 files changed

+10883
-2454
lines changed

.github/CODEOWNERS

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@
1515

1616
# The following paths involve server-side use cases, token/user session management.
1717
# Changes made to these paths requires additional reviews and approvals.
18-
/packages/auth @pranavosu @sobolk @Amplifiyer @avi-karthik
19-
/packages/aws-amplify/src/adapter-core @pranavosu @sobolk @Amplifiyer @avi-karthik
20-
/packages/core/src/adapterCore @pranavosu @sobolk @Amplifiyer @avi-karthik
21-
/packages/core/src/singleton @pranavosu @sobolk @Amplifiyer @avi-karthik
22-
/packages/core/src/utils/convert @pranavosu @sobolk @Amplifiyer @avi-karthik
23-
/packages/core/src/utils/WordArray.ts @pranavosu @sobolk @Amplifiyer @avi-karthik
24-
/packages/core/src/storage @pranavosu @sobolk @Amplifiyer @avi-karthik
25-
/packages/core/src/utils/generateRandomString.ts @pranavosu @sobolk @Amplifiyer @avi-karthik
26-
/packages/core/src/utils/globalHelpers @pranavosu @sobolk @Amplifiyer @avi-karthik
27-
/packages/core/src/utils/urlSafeDecode.ts @pranavosu @sobolk @Amplifiyer @avi-karthik
28-
/packages/core/src/awsClients/cognitoIdentity @pranavosu @sobolk @Amplifiyer @avi-karthik
29-
/packages/core/src/clients/internal @pranavosu @sobolk @Amplifiyer @avi-karthik
30-
/packages/core/src/Hub @pranavosu @sobolk @Amplifiyer @avi-karthik
31-
/packages/adapter-nextjs @pranavosu @sobolk @Amplifiyer @avi-karthik
32-
/packages/rtn-web-browser @pranavosu @sobolk @Amplifiyer @avi-karthik
33-
/packages/storage/src/providers/s3/apis/internal @pranavosu @sobolk @Amplifiyer @avi-karthik
34-
/packages/storage/src/providers/s3/apis/server @pranavosu @sobolk @Amplifiyer @avi-karthik
35-
/packages/api-rest/src/apis/server.ts @pranavosu @sobolk @Amplifiyer @avi-karthik
36-
/packages/api-rest/src/apis/common/internalPost.ts @pranavosu @sobolk @Amplifiyer @avi-karthik
37-
/packages/api-graphql/src/server @pranavosu @sobolk @Amplifiyer @avi-karthik
38-
/packages/api-graphql/src/internals/server @pranavosu @sobolk @Amplifiyer @avi-karthik
18+
/packages/auth @pranavosu @sarayev @avi-karthik
19+
/packages/aws-amplify/src/adapter-core @pranavosu @sarayev @avi-karthik
20+
/packages/core/src/adapterCore @pranavosu @sarayev @avi-karthik
21+
/packages/core/src/singleton @pranavosu @sarayev @avi-karthik
22+
/packages/core/src/utils/convert @pranavosu @sarayev @avi-karthik
23+
/packages/core/src/utils/WordArray.ts @pranavosu @sarayev @avi-karthik
24+
/packages/core/src/storage @pranavosu @sarayev @avi-karthik
25+
/packages/core/src/utils/generateRandomString.ts @pranavosu @sarayev @avi-karthik
26+
/packages/core/src/utils/globalHelpers @pranavosu @sarayev @avi-karthik
27+
/packages/core/src/utils/urlSafeDecode.ts @pranavosu @sarayev @avi-karthik
28+
/packages/core/src/awsClients/cognitoIdentity @pranavosu @sarayev @avi-karthik
29+
/packages/core/src/clients/internal @pranavosu @sarayev @avi-karthik
30+
/packages/core/src/Hub @pranavosu @sarayev @avi-karthik
31+
/packages/adapter-nextjs @pranavosu @sarayev @avi-karthik
32+
/packages/rtn-web-browser @pranavosu @sarayev @avi-karthik
33+
/packages/storage/src/providers/s3/apis/internal @pranavosu @sarayev @avi-karthik
34+
/packages/storage/src/providers/s3/apis/server @pranavosu @sarayev @avi-karthik
35+
/packages/api-rest/src/apis/server.ts @pranavosu @sarayev @avi-karthik
36+
/packages/api-rest/src/apis/common/internalPost.ts @pranavosu @sarayev @avi-karthik
37+
/packages/api-graphql/src/server @pranavosu @sarayev @avi-karthik
38+
/packages/api-graphql/src/internals/server @pranavosu @sarayev @avi-karthik

.github/actions/node-and-build/action.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ inputs:
77
runs:
88
using: 'composite'
99
steps:
10-
- name: Setup Node.js 20
11-
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
10+
- name: Setup Node.js 22
11+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1212
with:
13-
node-version: 20
13+
node-version: 22
1414
env:
1515
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
1616
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
@@ -33,9 +33,15 @@ runs:
3333
# TODO We should be able to skip yarn / bootstrap if we cache enough things. Leaving because skipping causes issues.
3434
- name: Install
3535
if: inputs.is-prebuild != 'true' || steps.cache-build-artifacts.outputs.cache-hit != 'true'
36-
run: yarn
3736
shell: bash
3837
working-directory: ./amplify-js
38+
run: |
39+
for i in {1..3}; do
40+
echo "Starting attempt $i."
41+
yarn && break
42+
echo "Attempt $i failed."
43+
sleep 5
44+
done
3945
- name: Bootstrap
4046
if: inputs.is-prebuild != 'true' || steps.cache-build-artifacts.outputs.cache-hit != 'true'
4147
run: yarn bootstrap
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: 'Set Status'
2+
description: 'Set status on a specified head-sha'
3+
inputs:
4+
context:
5+
description: 'Name of the status'
6+
required: true
7+
description:
8+
description: 'Short description of the status'
9+
required: false
10+
state:
11+
description: >-
12+
State of the status with possible values of 'error', 'failure', 'pending', 'success'
13+
required: true
14+
sha:
15+
description: 'The commit ID to add the status to'
16+
required: true
17+
target-url:
18+
description: >-
19+
Target URL to associate with this status.
20+
This URL will be linked from the GitHub UI to allow users to easily see the source of the status.'
21+
required: false
22+
runs:
23+
using: 'composite'
24+
steps:
25+
- name: Set a commit status
26+
id: set-status
27+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 https://github.com/actions/github-script/commit/60a0d83039c74a4aee543508d2ffcb1c3799cdea
28+
env:
29+
status_context: ${{ inputs.context }}
30+
description: ${{ inputs.description }}
31+
state: ${{ inputs.state }}
32+
sha: ${{ inputs.sha }}
33+
target_url: ${{ inputs.target-url }}
34+
owner: ${{ github.event.repository.owner.login }}
35+
repo: ${{ github.event.repository.name }}
36+
with:
37+
result-encoding: string
38+
script: |
39+
const { status_context, description, state, sha, target_url, owner, repo } = process.env;
40+
const inputValidationErrors = [];
41+
if (!state || state.length === 0) {
42+
inputValidationErrors.push('"state" input cannot be empty.');
43+
}
44+
if (!["error", "failure", "pending", "success"].includes(state)) {
45+
inputValidationErrors.push('"state" must be a string input with possible value of "error", "failure", "pending", "success".');
46+
}
47+
if (!status_context || status_context.length === 0) {
48+
inputValidationErrors.push('"context" input cannot be empty.');
49+
}
50+
if (!sha || sha.length === 0) {
51+
inputValidationErrors.push('"sha" input cannot be empty.');
52+
}
53+
if (!sha.match(/^[0-9a-z]+$/)) {
54+
inputValidationErrors.push('"sha" must be an alphanumeric string.');
55+
}
56+
if (target_url && target_url.length > 0) {
57+
if (target_url.length > 2048) {
58+
inputValidationErrors.push('"target-url" must be less than 2048 characters.');
59+
}
60+
61+
try {
62+
const url = new URL(target_url);
63+
64+
if (url.protocol !== 'https:') {
65+
inputValidationErrors.push('"target-url" must use HTTPS protocol.');
66+
}
67+
68+
const allowedHostnames = ['github.com', 'api.github.com'];
69+
if (!allowedHostnames.includes(url.hostname)) {
70+
inputValidationErrors.push(`"target-url" must be one of: ${allowedHostnames.join(', ')}.`);
71+
}
72+
73+
} catch (error) {
74+
if (error instanceof TypeError && error.message.includes('Invalid URL')) {
75+
inputValidationErrors.push('"target-url" must be a valid URL format.');
76+
} else {
77+
inputValidationErrors.push(`"target-url" validation failed: ${error.message}`);
78+
}
79+
}
80+
}
81+
if (inputValidationErrors.length > 0) {
82+
inputValidationErrors.forEach(core.error);
83+
process.exit(1);
84+
}
85+
github.rest.repos.createCommitStatus({
86+
owner,
87+
repo,
88+
sha,
89+
state,
90+
context: status_context,
91+
description: description && description.length > 0 ? description : undefined,
92+
target_url: target_url && target_url.length > 0 ? target_url : undefined,
93+
});

.github/actions/setup-samples-staging/action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ runs:
4545
fi
4646
4747
- name: Install
48-
run: |
49-
yarn
5048
shell: bash
5149
working-directory: ./amplify-js-samples-staging
50+
run: |
51+
for i in {1..3}; do
52+
echo "Starting attempt $i."
53+
yarn && break
54+
echo "Attempt $i failed."
55+
sleep 5
56+
done

.github/dependency-review/dependency-review-config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ allow-licenses:
1515
- 'ISC'
1616
- 'JSON'
1717
- 'MIT'
18+
- 'MIT-0'
1819
- 'OpenSSL'
1920
- 'PDDL-1.0'
2021
- 'PostgreSQL'

.github/integ-config/detox-integ-all.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@
2020
working_directory: amplify-js-samples-staging/samples/react-native/auth/HosteduiApp
2121
timeout_minutes: 120
2222
host_signout_page: true
23+
- test_name: 'integ_rn_ios_passkeys'
24+
working_directory: amplify-js-samples-staging/samples/react-native/auth/Passkeys
25+
timeout_minutes: 120
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
tests:
22
[]
3-
# integ_auth_test_cypress_no_ui
4-
# - test_name: 'Token revocation'
5-
# category: 'auth'
6-
# spec: 'token-revocation'
7-
# is_headless: true

.github/integ-config/integ-all.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,13 @@ tests:
528528
sample_name: [sign-in-with-oauth]
529529
spec: sign-out-oidc-provider
530530
browser: [chrome]
531+
- test_name: integ_next_auth_token_revocation
532+
desc: 'Token Revocation'
533+
framework: next
534+
category: auth
535+
sample_name: [auth-rsc]
536+
spec: token-revocation
537+
browser: [chrome]
531538

532539
# AUTH GEN2
533540
- test_name: integ_react_javascript_authentication_gen2
@@ -622,13 +629,15 @@ tests:
622629
category: auth
623630
sample_name: [custom-auth]
624631
spec: custom-auth
632+
retry_count: 15
625633
browser: *minimal_browser_list
626634
- test_name: integ_next_auth_sign_in_with_sms_mfa
627635
desc: 'Resumable sign in with SMS MFA flow'
628636
framework: next
629637
category: auth
630638
sample_name: [mfa]
631639
spec: sign-in-resumable-mfa
640+
retry_count: 15
632641
browser: *minimal_browser_list
633642
env:
634643
NEXT_PUBLIC_BACKEND_CONFIG: resum-signin
@@ -837,20 +846,23 @@ tests:
837846
category: storage
838847
sample_name: [storage-gen2]
839848
spec: storage-gen2
849+
retry_count: 10
840850
browser: *minimal_browser_list
841851
- test_name: integ_react_storage_internal
842852
desc: 'React Storage Gen2 Internal APIs'
843853
framework: react
844854
category: storage
845855
sample_name: [storage-gen2-internal]
846856
spec: storage-gen2-internal
857+
retry_count: 10
847858
browser: *minimal_browser_list
848859
- test_name: integ_next_storage
849860
desc: 'Next Storage Auth'
850861
framework: next
851862
category: storage
852863
sample_name: [storage-auth]
853864
spec: storage-client-server
865+
retry_count: 10
854866
browser: [chrome] # firefox issues with secure cookies in cypress, manual testing works fine
855867

856868
# INAPPMESSAGING
@@ -913,6 +925,7 @@ tests:
913925
category: auth
914926
sample_name: [mfa]
915927
spec: mfa-req-email
928+
retry_count: 15
916929
browser: *minimal_browser_list
917930
env:
918931
NEXT_PUBLIC_BACKEND_CONFIG: mfa-req-email
@@ -922,6 +935,7 @@ tests:
922935
category: auth
923936
sample_name: [mfa]
924937
spec: mfa-req-phone
938+
retry_count: 15
925939
browser: *minimal_browser_list
926940
env:
927941
NEXT_PUBLIC_BACKEND_CONFIG: mfa-req-phone
@@ -931,6 +945,7 @@ tests:
931945
category: auth
932946
sample_name: [mfa]
933947
spec: mfa-opt-email
948+
retry_count: 15
934949
browser: *minimal_browser_list
935950
env:
936951
NEXT_PUBLIC_BACKEND_CONFIG: mfa-opt-email
@@ -940,6 +955,7 @@ tests:
940955
category: auth
941956
sample_name: [mfa]
942957
spec: mfa-opt-phone
958+
retry_count: 15
943959
browser: *minimal_browser_list
944960
env:
945961
NEXT_PUBLIC_BACKEND_CONFIG: mfa-opt-phone
@@ -949,6 +965,7 @@ tests:
949965
category: auth
950966
sample_name: [mfa]
951967
spec: mfa-setup
968+
retry_count: 15
952969
browser: *minimal_browser_list
953970
env:
954971
NEXT_PUBLIC_BACKEND_CONFIG: mfa-setup
@@ -958,6 +975,7 @@ tests:
958975
category: auth
959976
sample_name: [mfa]
960977
spec: passwordless/auto-sign-in
978+
retry_count: 15
961979
browser: *minimal_browser_list
962980
env:
963981
NEXT_PUBLIC_BACKEND_CONFIG: pwl-autosignin
@@ -985,6 +1003,7 @@ tests:
9851003
category: auth
9861004
sample_name: [mfa]
9871005
spec: passwordless/sign-up
1006+
retry_count: 15
9881007
browser: *minimal_browser_list
9891008
env:
9901009
NEXT_PUBLIC_BACKEND_CONFIG: pwl-signup
@@ -994,6 +1013,7 @@ tests:
9941013
category: auth
9951014
sample_name: [mfa]
9961015
spec: passwordless/miscellaneous
1016+
retry_count: 15
9971017
browser: *minimal_browser_list
9981018
env:
9991019
NEXT_PUBLIC_BACKEND_CONFIG: pwl-misc
@@ -1014,6 +1034,8 @@ tests:
10141034
category: auth
10151035
sample_name: [mfa]
10161036
spec: refresh-token-auth
1037+
retry_count: 15
1038+
timeout_minutes: 90
10171039
browser: *minimal_browser_list
10181040
env:
10191041
NEXT_PUBLIC_BACKEND_CONFIG: misc-tokenref

.github/workflows/callable-e2e-test-detox.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ jobs:
3131
path: amplify-js
3232
- name: Setup node and build the repository
3333
uses: ./amplify-js/.github/actions/node-and-build
34+
- name: Set Xcode version
35+
run: |
36+
sudo xcode-select -s /Applications/Xcode_16.4.app
37+
- name: Download iOS platform and create simulator
38+
if: ${{ contains(inputs.test_name, 'integ_rn_ios_passkeys') }}
39+
run: |
40+
xcodebuild -downloadPlatform iOS -buildVersion 17.4
41+
xcrun simctl create "iPhone 15" "com.apple.CoreSimulator.SimDeviceType.iPhone-15" "com.apple.CoreSimulator.SimRuntime.iOS-17-4"
3442
- name: Setup samples staging repository
3543
uses: ./amplify-js/.github/actions/setup-samples-staging
3644
with:

.github/workflows/callable-get-package-list.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
packages:
77
description: The json encoded package list
88
value: ${{ jobs.get-package-list.outputs.packages }}
9+
nativePackages:
10+
description: The json encoded native package list
11+
value: ${{ jobs.get-package-list.outputs.nativePackages }}
912
jobs:
1013
get-package-list:
1114
name: Get packages list
@@ -31,11 +34,14 @@ jobs:
3134
- name: Dump Package List
3235
if: steps.cache-package-list.outputs.cache-hit != 'true'
3336
run: |
34-
echo "packages=$(yarn lerna ll | egrep -v "lerna|Done|yarn" | jq -R -s -c 'split("\n")[:-1] | map({name: split(" ")[0], path: split(" ")[-1]})')" > package-list.json
37+
yarn lerna ll | egrep -v "lerna|Done|yarn" | jq -R -s -c 'split("\n")[:-1] | map({name: split(" ")[0], path: split(" ")[-1]})' > package-list.json
3538
- name: Get Package List
3639
id: get_package_list
3740
run: |
38-
cat package-list.json >> $GITHUB_OUTPUT
39-
cat package-list.json
41+
echo "packages=$(cat package-list.json)" >> $GITHUB_OUTPUT
42+
# temporarily filter to only packages with runnable tests
43+
echo "nativePackages=$(jq -c 'map(select(.name | test("rtn-passkeys|react-native")))' package-list.json)" >> $GITHUB_OUTPUT
4044
outputs:
4145
packages: ${{ steps.get_package_list.outputs.packages }}
46+
# todo: expand native package list as other tests are made runnable
47+
nativePackages: ${{ steps.get_package_list.outputs.nativePackages }}

0 commit comments

Comments
 (0)