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

@W-14758629@ SLAS Private Client Support #1722

Merged
merged 58 commits into from
Apr 2, 2024

Conversation

vcua-mobify
Copy link
Contributor

@vcua-mobify vcua-mobify commented Mar 27, 2024

PR for merging in the SLAS Private Client feature branch onto develop.

This PR aggregates of the following PRs:
#1649 - Update commerce-sdk-react to support SLAS private clients
#1664 - Introduce middleware to inject SLAS client secrets to SLAS requests
#1683 - Update pwa-kit-create-app with options and templates for generating projects that are set up for private clients
#1679 - Error handling if PWA_KIT_SLAS_CLIENT_SECRET env var is not set
#1690 - Add proxy headers (ie. x-mobify) to SLAS calls
#1696 - Update hybrid session sharing to support private clients and reduce session chrun
#1704 - Toggle commerce-sdk-react SLAS private client mode using a boolean
#1714 - Run PWA Kit E2E tests against SLAS private clients in CI

Note: As part of #1714, the version has been bumped to 3.5-dev.1. Without this version bump, the e2e tests seem unable to use the updated pwa-kit-create-app that includes the retail-react-app-private-slas-client

alexvuong and others added 30 commits January 23, 2024 16:06
…sdk-private-slas

W-14764021 - [commerce-sdk-react] Support private slas client
…1664)

* Allow objects in commerceapi path

* Add custom endpoint for SLAS. Works on public client

* Get private client working

* Remove console log

* A more generic header replacement

* Slas credentials from env vars

* Add exclusions for some endpoints

* Custom middleware in ssr.js

* Add dependency

* Private SLAS client handler in runtime

* Update commerce-sdk-react with private client endpoint

* Cleanup

* Public client by default

* more cleanup

* Fix existing tests

* Runtime tests- WIP

* WIP test

* Apply some PR feedback

* Small refactor

* Working tests

* add getSlasEndpoint test

* Lint

* Change endpoint path and other minor adjustments

* Don't start server if env var not set

* Fix flaky test

* Add option for customizing more endpoints with private client

* Rename client secret env var

* Bump up a test timeout
…1683)

* Allow objects in commerceapi path

* Add custom endpoint for SLAS. Works on public client

* Get private client working

* Remove console log

* add private slas/private question

* add private slas/private question

* A more generic header replacement

* Slas credentials from env vars

* Add exclusions for some endpoints

* add private slas/private question

* Custom middleware in ssr.js

* Add dependency

* Private SLAS client handler in runtime

* Update commerce-sdk-react with private client endpoint

* Cleanup

* Public client by default

* more cleanup

* Fix existing tests

* Runtime tests- WIP

* WIP test

* Apply some PR feedback

* Small refactor

* Working tests

* add getSlasEndpoint test

* Lint

* Change endpoint path and other minor adjustments

* Don't start server if env var not set

* Fix flaky test

* Add option for customizing more endpoints with private client

* Rename client secret env var

* Bump up a test timeout

* Update generator

* Lint

* Fix lint in generated projects

* Add comments on the original app config file

* Add templates for non-extensible projects

* More detailed developer note

---------

Co-authored-by: Alex Vuong <alex.vuong@salesforce.com>
* Allow objects in commerceapi path

* Add custom endpoint for SLAS. Works on public client

* Get private client working

* Remove console log

* add private slas/private question

* add private slas/private question

* A more generic header replacement

* Slas credentials from env vars

* Add exclusions for some endpoints

* add private slas/private question

* Custom middleware in ssr.js

* Add dependency

* Private SLAS client handler in runtime

* Update commerce-sdk-react with private client endpoint

* Cleanup

* Public client by default

* more cleanup

* Fix existing tests

* Runtime tests- WIP

* WIP test

* Apply some PR feedback

* Small refactor

* Working tests

* add getSlasEndpoint test

* Lint

* Change endpoint path and other minor adjustments

* Don't start server if env var not set

* Fix flaky test

* Add option for customizing more endpoints with private client

* Rename client secret env var

* Bump up a test timeout

* Update generator

* Lint

* Fix lint in generated projects

* Add comments on the original app config file

* Add templates for non-extensible projects

* Improve missing env var handling in remote environments

* More detailed developer note

* Remove brackets

---------

Co-authored-by: Alex Vuong <alex.vuong@salesforce.com>
* Add header injection to custom proxy

* Refactor to remove duplicate code
shethj and others added 14 commits March 22, 2024 18:56
…private (#1696)

* Replace SFRA->PWA session handoff logic

* Merge branch 'feature/pwa-kit-slas-private-support' into private-client-hybrid

* Remove console.logs

* Adjust cookie name

* Code refactor

* Return empty string

* Tests

* Rework suffix of cookie chunks

* Update more local storage values on SFRA token handoff

* Test local storage update

* Remove refresh token copies from local store

* Remove refresh token copy references in test

* Code cleanup
* Replace SFRA->PWA session handoff logic

* Merge branch 'feature/pwa-kit-slas-private-support' into private-client-hybrid

* Remove console.logs

* Adjust cookie name

* Code refactor

* Return empty string

* Tests

* Rework suffix of cookie chunks

* Update more local storage values on SFRA token handoff

* Test local storage update

* Remove refresh token copies from local store

* Remove refresh token copy references in test

* Enable PWA private client via boolean

* Disable private client in template and update comments

* Move placeholder to constants

* Apply feedback

* Update comment

* Update comments

---------

Signed-off-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com>
…-client-e2e-ci

@W-14758651@ - Update E2E test workflow to test for PWA Kit with Private Clients
@vcua-mobify vcua-mobify marked this pull request as ready for review March 28, 2024 00:30
@vcua-mobify vcua-mobify requested a review from a team as a code owner March 28, 2024 00:30
alexvuong
alexvuong previously approved these changes Mar 28, 2024
shethj
shethj previously approved these changes Mar 28, 2024
@vcua-mobify vcua-mobify dismissed stale reviews from shethj and alexvuong via f2ca521 April 1, 2024 17:52
@vcua-mobify vcua-mobify merged commit 83a2db2 into develop Apr 2, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants