Skip to content

Reduce permitted attributes for cart update - #6636

Merged
jarednorman merged 1 commit into
solidusio:mainfrom
SuperGoodSoft:bug/reduce-permitted-attributes-cart-update
Sep 18, 2026
Merged

jarednorman merged 1 commit into
solidusio:mainfrom
SuperGoodSoft:bug/reduce-permitted-attributes-cart-update

Conversation

@adammathys

@adammathys adammathys commented Sep 17, 2026

Copy link
Copy Markdown
Member

Summary

The storefront cart controller was using the permitted_order_attributes which allow for editing address, delivery, payment, confirm, and line item attributes. However, the cart endpoint is only actively used to update line item quantities.

Furthermore, some of the attributes that it permits aren't actually usable by this endpoint. For example, passing payment attributes is entirely useless outside of creating new check payments. All other payment methods require a source and it's not possible to pass through source_attributes in this method because it doesn't make use of the PaymentCreate object that handles setting up the source from the attributes. (And you can't modify existing payments because ID is not a valid attribute.)

The only allowed attributes moving forward are:

  • Customer metadata
  • Email (our specs establish this as a valid attribute, so I've left it in.)
  • Line item attributes (the primary use-case)

If an app still needs or wants to use the cart controller for updating other attributes, they can easily add more to the permitted_cart_attributes method.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

@adammathys
adammathys requested a review from a team as a code owner September 17, 2026 22:38
@github-actions github-actions Bot added the changelog:solidus_storefront Changes to the storefront label Sep 17, 2026
The storefront cart controller was using the permitted_order_attributes
which allow for editing address, delivery, payment, confirm, and line
item attributes. However, the cart endpoint is only actively used to
update line item quantities.

Furthermore, some of the attributes that it permits aren't actually
usable by this endpoint. For example, passing payment attributes is
entirely useless outside of creating new check payments. All other
payment methods require a source and it's not possible to pass through
source_attributes in this method because it doesn't make use of the
PaymentCreate object that handles setting up the source from the
attributes. (And you can't modify existing payments because ID is not a
valid attribute.)

The only allowed attributes moving forward are:
- Customer metadata
- Email (our specs establish this as a valid attribute, so I've left it
  in.)
- Line item attributes (the primary use-case)

If an app still needs or wants to use the cart controller for updating
other attributes, they can easily add more to the
permitted_cart_attributes method.
@adammathys
adammathys force-pushed the bug/reduce-permitted-attributes-cart-update branch from 9a7f6a8 to 1030aaa Compare September 17, 2026 22:39
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.33%. Comparing base (319f1a2) to head (1030aaa).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6636   +/-   ##
=======================================
  Coverage   92.33%   92.33%           
=======================================
  Files        1050     1050           
  Lines       21367    21369    +2     
=======================================
+ Hits        19729    19731    +2     
  Misses       1638     1638           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jarednorman
jarednorman merged commit 3e7a91e into solidusio:main Sep 18, 2026
43 checks passed
@jarednorman
jarednorman deleted the bug/reduce-permitted-attributes-cart-update branch September 18, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:solidus_storefront Changes to the storefront

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants