-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Feat/user agent enhancements/auth #11442
Feat/user agent enhancements/auth #11442
Conversation
…e based on changes
Note: bundle size for api-graphql has been addressed in another user-agent-enhancements branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good, my only concern if we need to mention this APIs are for internal use only.
callback.onFailure.mockClear(); | ||
callback.onSuccess.mockClear(); | ||
callback.customChallenge.mockClear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jest.clearAllMocks()
doesnt work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for these specifically, that I found. Adding these lines prevented the issues with tests affecting each other. Perhaps because they are nested and imported from a separate file?
SignUp: '1', | ||
InitiateAuth: '2', | ||
ConfirmSignUp: '3', | ||
ResendConfirmationCode: '4', | ||
GetUser: '5', | ||
SetUserMFAPreference: '6', | ||
SetUserSettings: '7', | ||
AssociateSoftwareToken: '8', | ||
VerifySoftwareToken: '9', | ||
RespondToAuthChallenge: '10', | ||
DeleteUserAttributes: '11', | ||
DeleteUser: '12', | ||
UpdateUserAttributes: '13', | ||
GetUserAttributeVerificationCode: '14', | ||
VerifyUserAttribute: '15', | ||
GlobalSignOut: '16', | ||
RevokeToken: '17', | ||
ChangePassword: '18', | ||
ForgotPassword: '19', | ||
ConfirmForgotPassword: '20', | ||
ConfirmDevice: '21', | ||
UpdateDeviceStatus: '22', | ||
ForgetDevice: '23', | ||
ListDevices: '24', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why strings and not numbers? Just curious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been the convention we went with. Same for other categories in core/src/Platform/types. I think initially because we were not sure which format we were going to use, then I was concerned about skipping numbers, but that wouldn't actually break anything with enums or this object. We could change them all, but I would want cognito to reflect what is being done in core.
…ain' into feat/user-agent-enhancements/auth
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## feat/user-agent-enhancements/main #11442 +/- ##
=====================================================================
+ Coverage 83.14% 83.15% +0.01%
=====================================================================
Files 260 260
Lines 20429 20437 +8
Branches 4402 4402
=====================================================================
+ Hits 16985 16995 +10
+ Misses 3158 3156 -2
Partials 286 286
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Thanks @erinleigh90 🏅 🎶
Description of changes
Adds category, action, and framework to Auth calls through amazon-cognito-identity-js.
Description of how you validated changes
Tested in sample app via package linking and validating the x-amz-user-agent is as expected for each action.
Thorough unit tests on CognitoUser still in progress.
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.