Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: Amplify JS release #13538

Merged
merged 8 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
/packages/aws-amplify/package.json @aws-amplify/amplify-js-admins
/.circleci/ @aws-amplify/amplify-js @aws-amplify/amplify-devops
/.github/ @aws-amplify/amplify-js-admins

# The following paths involve server-side use cases, token/user session management.
# Changes made to these paths requires additional reviews and approvals.
/packages/auth @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
/packages/aws-amplify/src/adapter-core @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
/packages/core/src/adapterCore @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
Expand All @@ -23,3 +26,10 @@
/packages/core/src/awsClients/cognitoIdentity @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
/packages/core/src/clients/internal @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
/packages/core/src/Hub @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
/packages/adapter-nextjs @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
/packages/storage/src/providers/s3/apis/internal @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
/packages/storage/src/providers/s3/apis/server @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
/packages/api-rest/src/apis/server.ts @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
/packages/api-rest/src/apis/common/internalPost.ts @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
/packages/api-graphql/src/server @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
/packages/api-graphql/src/internals/server @ukhan-amazon @haverchuck @cshfang @jimblanc @HuiSF
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ the requirements below.
- [ ] `yarn test` passes
- [ ] Tests are [changed or added](https://github.com/aws-amplify/amplify-js/blob/main/CONTRIBUTING.md#steps-towards-contributions)
- [ ] Relevant documentation is changed or added (and PR referenced)

- [ ] New source file paths included in this PR have been added to CODEOWNERS, if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
4 changes: 0 additions & 4 deletions .github/integ-config/detox-integ-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,3 @@
- test_name: 'integ_rn_ios_api_v6_rn_72_detox_cli'
working_directory: amplify-js-samples-staging/samples/react-native/api/v6/ApiGRAPHQL
timeout_minutes: 120
# - test_name: 'integ_rn_android_storage'
# working_directory: ~/amplify-js-samples-staging/samples/react-native/storage/StorageApp
# - test_name: 'integ_rn_android_storage_multipart_progress'
# working_directory: ~/amplify-js-samples-staging/samples/react-native/storage/MultiPartUploadWithProgress
3 changes: 2 additions & 1 deletion license_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"**/.rollup.cache",
"**/rollup.config.mjs",
"rollup",
".husky"
".husky",
"packages/core/metadata"
],
"ignoreFile": ".gitignore",
"license": "license_header.txt",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
"unlink-all": "lerna exec --no-bail --parallel -- yarn unlink; exit 0",
"publish:preid": "./scripts/preid-env-vars-exist.sh && lerna publish --canary --force-publish --dist-tag=${PREID_PREFIX} --preid=${PREID_PREFIX}${PREID_HASH_SUFFIX} --yes",
"publish:main": "lerna publish --canary --force-publish --dist-tag=unstable --preid=unstable${PREID_HASH_SUFFIX} --yes",
"publish:release": "lerna publish --conventional-commits --message 'chore(release): Publish [skip release]' --yes",
"publish:release": "yarn generate-metadata && lerna publish --conventional-commits --message 'chore(release): Publish [skip release]' --yes",
"publish:v5-stable": "lerna publish --conventional-commits --yes --dist-tag=stable-5 --message 'chore(release): Publish [ci skip]' --no-verify-access",
"publish:verdaccio": "lerna publish --canary --force-publish --no-push --dist-tag=unstable --preid=unstable --yes",
"generate-metadata": "git rev-parse --short HEAD > packages/core/metadata && git commit -am 'chore: set core metadata [skip release]'",
"ts-coverage": "lerna run ts-coverage",
"prepare": "husky && ./scripts/set-preid-versions.sh"
},
Expand Down
32 changes: 32 additions & 0 deletions packages/auth/__tests__/providers/cognito/signUp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,38 @@ describe('signUp', () => {
userId,
});
});

it('should send UserContextData', async () => {
(window as any).AmazonCognitoAdvancedSecurityData = {
getData() {
return 'abcd';
},
};
await signUp({
username: user1.username,
password: user1.password,
options: {
userAttributes: { email: user1.email },
},
});
expect(mockSignUp).toHaveBeenCalledWith(
{
region: 'us-west-2',
userAgentValue: expect.any(String),
},
{
ClientMetadata: undefined,
Password: user1.password,
UserAttributes: [{ Name: 'email', Value: user1.email }],
Username: user1.username,
ValidationData: undefined,
ClientId: '111111-aaaaa-42d8-891d-ee81a1549398',
UserContextData: { EncodedData: 'abcd' },
},
);
expect(mockSignUp).toHaveBeenCalledTimes(1);
(window as any).AmazonCognitoAdvancedSecurityData = undefined;
});
});

describe('Error Path Cases:', () => {
Expand Down
14 changes: 11 additions & 3 deletions packages/auth/src/providers/cognito/apis/signUp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
setAutoSignInStarted,
setUsernameUsedForAutoSignIn,
} from '../utils/signUpHelpers';
import { getUserContextData } from '../utils/userContextData';
import { getAuthUserAgentValue } from '../../../utils';

import { setAutoSignIn } from './autoSignIn';
Expand Down Expand Up @@ -62,7 +63,6 @@ export async function signUp(input: SignUpInput): Promise<SignUpOutput> {
username,
options: signInServiceOptions,
};

// if the authFlowType is 'CUSTOM_WITHOUT_SRP' then we don't include the password
if (signInServiceOptions?.authFlowType !== 'CUSTOM_WITHOUT_SRP') {
signInInput.password = password;
Expand All @@ -71,9 +71,12 @@ export async function signUp(input: SignUpInput): Promise<SignUpOutput> {
setUsernameUsedForAutoSignIn(username);
setAutoSignInStarted(true);
}

const { userPoolId, userPoolClientId } = authConfig;

const clientOutput = await signUpClient(
{
region: getRegion(authConfig.userPoolId),
region: getRegion(userPoolId),
userAgentValue: getAuthUserAgentValue(AuthAction.SignUp),
},
{
Expand All @@ -83,7 +86,12 @@ export async function signUp(input: SignUpInput): Promise<SignUpOutput> {
options?.userAttributes && toAttributeType(options?.userAttributes),
ClientMetadata: clientMetadata,
ValidationData: validationData && toAttributeType(validationData),
ClientId: authConfig.userPoolClientId,
ClientId: userPoolClientId,
UserContextData: getUserContextData({
username,
userPoolId,
userPoolClientId,
}),
},
);
const { UserSub, CodeDeliveryDetails } = clientOutput;
Expand Down
1 change: 1 addition & 0 deletions packages/core/metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9d9192371
18 changes: 9 additions & 9 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading