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

FOM Upgrades - AWS-Amplify #736

Closed
2 tasks
ianliuwk1019 opened this issue Jan 6, 2025 · 0 comments · Fixed by #748
Closed
2 tasks

FOM Upgrades - AWS-Amplify #736

ianliuwk1019 opened this issue Jan 6, 2025 · 0 comments · Fixed by #748
Assignees

Comments

@ianliuwk1019
Copy link
Collaborator

This is part of the FOM Upgrades and aws-amplify is a library used by frontend for handling communicating login authentication flow with AWS Cognito.

AWS Amplify:

  • aws-amplify is also being bumped to a bit higher version of v5 (5.3.27) at PR (feat:#712 migrate angular 17 #731). There are still many warnings within aws-amplify when starting FOM. It would be better to upgrade a bit more (to v6) to get rid of warnings.

  • However, aws-amplify has breaking changes at v6. When attempting to go to aws-amplify v6 it is found that the major drawback is it does not expose normal encoded jwt tokens anymore (the entire jwt token from Cognito), it only provides the decoded jwt token payload. This will cause FOM backend not able to accept any API request as backend relies on request header passing original jwt token for necessary verification.

  • We may need to discuss: do we want to (1) pass the jwt access/id tokens 'paylod' as is to the backend, or (2) encode the token during passing, or (3) find alternative libs than aws-amplify for integration, or (4) combine aws-amplify and amazon-cognito-identity-js for convenient (amplify) and to get original token for passing to the backend(probably can get from amazon-cognito-identity-js). (4) is probably preferred, it might take a bit of investigation but backend won't be impacted.

Acceptance Criteria

  • Amplify is upgraded or resolved with other lib.
  • FOM app is working with backend with token verification.

Additional context

  • Add any other context about the task here.
  • Or here
@ianliuwk1019 ianliuwk1019 self-assigned this Jan 7, 2025
ianliuwk1019 added a commit that referenced this issue Jan 8, 2025
* Update typescript to 5.1.6

* temp: Upgrade angular/cli and angular/core to 16

* temp: upgrade angular material

* temp: upgrade @angular-eslint

* temp: upgrade ng-bootstrap and angular-fontawesome

* angular core/cli upgrade to 16 for admin

* upgrade angular material/cdk to 16 at admin; remove commonjs

* Upgrade angular-fontawesome and ng-bootstrap

* Update typescript and zonejs before angular 17 upgrade.

* update angular core/cli to 17

* Update angular common and various packages to 17

* upgrade angular cdk to 17

* upgrade angular material to 17

* upgrade angular-eslint to 17

* Update ng-bootstrap and ngx-bootstrap

* upgrade libs for angular

* upgrade typescript and zone.js before angular upgrade

* upgrade various angular packages to 17

* Remove not exist NgbNavbar

* @angular-eslint upgrade and some styling adjustment.

* Fix matBadge off issue after angular 17 migration.

* Replace moment with luxon for public

* Add 'luxon' before replacing moment. Re-facgtor some constant. Replacing moment from fom-add-edit compoent with luxon.

* Replace moment with luxon for interaction component.

* Replace moment with luxon for public notice edit component.

* Replace moment with luxon for fom-detail component.

* Remove moment from admin package.

* Replace lodash debounce with remeda funnel

* Replace lodash with remeda  for public-notice component.

* Remove lodash from details-panel component

* Replace lodash with remeda

* Replace isNil with isNullish from remeda for public

* upgrade remeda version at admin and replace lodash isNil to isNullish from remeda.

* Replace lodash with remeda

* Replace file-saver with file-saver-es es module lib

* add allowedCommonJsDependencies to ignore common js warning for only on (leaflet, leaflet.markercluster and object-hash).

* Remove ngx-dropzone and its unused compoent.

* Replace file-saver with file-saver-es at admin

* Use allowedCommonJsDependencies to ignore only leaflet.

* Minor upgrade aws-amplify version

* Upgrade aws-amplify to v6 and adjust cognito.service.ts at admin.

* Add comment

* Minor code rearrangement.

* removed unnecessary async.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant