Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@aldeed
Copy link
Contributor

@aldeed aldeed commented Sep 16, 2019

Impact: minor
Type: feature|bugfix

Changes

Resolves a few small issues that have come up recently.

  • The cart GraphQL transforms no longer force the fulfillmentTypes field on the FulfillmentMethod type to always be ["shipping"]. You will not notice any difference here because it is always ["shipping"] in the database for now, too, but this fix allows exploration of supporting other fulfillment types such as "pickup" or "digital".
  • The CommonOrder passed to many different types of plugin calculation functions now has accountId set on it if the source cart or order belongs to an account. This allows you to do pricing, shipping options, discounts, surcharges, etc. based on which account is placing the order.
  • Request headers are and have been available to GraphQL resolvers on context.requestHeaders. We now remove the authorization, cookie, and meteor-login-token headers, which contain sensitive information, from this object as a precaution.

Breaking changes

None, unless you have a custom plugin relying on the headers that were removed from context.requestHeaders, which is unlikely.

Testing

  • The fulfillmentTypes change does not need testing.
  • No built-in plugins use the CommonOrder accountId, but you can temporarily log commonOrder.accountId somewhere to verify that it is set as you go through checkout while logged in.
  • Log context.requestHeaders in any resolver, and make a GraphQL request that will call that resolver, passing authorization header with your request. Verify that no headers with sensitive information are logged.

from context.requestHeaders

Signed-off-by: Eric Dobbertin <[email protected]>
@aldeed aldeed self-assigned this Sep 16, 2019
@aldeed aldeed requested a review from kieckhafer September 19, 2019 17:01
Copy link
Member

@kieckhafer kieckhafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good, headers are there, but without the sensitive ones.

accountId is there when a logged in user creates an order, and null when it's a guest.

@kieckhafer kieckhafer merged commit a94d8dc into develop Sep 23, 2019
@kieckhafer kieckhafer deleted the feat-aldeed-small-tasks branch September 23, 2019 17:25
@kieckhafer kieckhafer mentioned this pull request Sep 25, 2019
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.

3 participants