vtex-apps / store-graphql

GraphQL schema and resolvers for the VTEX Commerce Stores API
78 stars 45 forks source link

[CHK-2076] Respect Checkout set-cookie directives #630

Closed brunoabreu closed 2 years ago

brunoabreu commented 2 years ago

What problem is this solving?

The current implementation is not forwarding checkout cookies correctly. Is doesn't include SameSite and Secure directives.

Relates to https://github.com/vtex-apps/checkout-graphql/pull/180

How to test it?

Workspace

Screenshots or example usage:

Before
$ curl -v 'https://storetheme.vtex.com/_v/private/graphql/v1?workspace=current' \
      -H 'content-type: application/json' \
      --data-raw '{"operationName":"orderForm","variables":{},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"1ecfbc15a63112ff28cf95d4789812438cf2e9a3a67fcf1dd4d89b6bdf78e39e","sender":"vtex.store-resources@0.x","provider":"vtex.store-graphql@2.x"}}}' \
      2>&1 \
      | grep -Fi Set-Cookie:\ checkout

< set-cookie: checkout.vtex.com=__ofid=85866718f8064e528c6eb97419698ec7; path=/; expires=Sun, 05 Mar 2023 16:37:38 GMT; domain=storetheme.vtex.com; httponly
After
$ curl -v 'https://storetheme.vtex.com/_v/private/graphql/v1?workspace=brunoh' \
      -H 'content-type: application/json' \
      --data-raw '{"operationName":"orderForm","variables":{},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"1ecfbc15a63112ff28cf95d4789812438cf2e9a3a67fcf1dd4d89b6bdf78e39e","sender":"vtex.store-resources@0.x","provider":"vtex.store-graphql@2.x"}}}' \
      2>&1 \
      | grep -Fi Set-Cookie:\ checkout

< set-cookie: checkout.vtex.com=__ofid=3689066e42634ec4ac70f5334aa44503; path=/; expires=Sun, 05 Mar 2023 16:40:16 GMT; domain=storetheme.vtex.com; samesite=lax; secure; httponly
vtex-io-ci-cd[bot] commented 2 years ago

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

vtex-io-docs-bot[bot] commented 2 years ago

Beep boop :robot:

I noticed you didn't make any changes at the docs/ folder

In order to keep track, I'll create an issue if you decide now is not a good time

vtex-io-ci-cd[bot] commented 2 years ago

Your PR has been merged! App is being published. :rocket: Version 2.156.0 → 2.156.1

After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:

vtex deploy vtex.store-graphql@2.156.1

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. :book: