Skip to content

Commit

Permalink
Store API - Cart JWT tokens/session handling (woocommerce#5953)
Browse files Browse the repository at this point in the history
* Re-apply token support

* Updated nonce headers

* Updated package-lock.json

* test commit to debug failing git hooks

* Revert "test commit to debug failing git hooks"

This reverts commit e64086b.

* JsonWebToken utility class for generating and validating HS256 JWT tokens. Removed third-party JWT library.

* Add ext-hash to composer (required by hash_hmac())

* Removed unnecessary method param.

* Tests for retrieving cart contents via Cart-Token

* Removed token tests ( we can't properly test cart token functionality until we refactor the way it intercepts calls to replace the session object )

* Abstracted payload from JsonWebToken class. We can now use it to encode custom payloads and reuse them wherever we want.

* Fixed missing check for token expiration in the payload.

* MD lint error and config fix

* Update composer.lock

* Fixed bug using the wrong nonce header.

* Refactor to properly save session data based on cart token.

* Refactored DB queries to properly use prepared statement

* Removed underscore prefix for class attributes

* Fixed spaces instead of tabs indenting composer.json. Cleaned up .editorconfig

* Cleaned up borked .md comments.

* Comment for WP_SETUP_CONFIG check.

* Reverted SQL prepared statement for including table names.

* Used hash_equals() for signature comparison. Renamed some wrongly named properties.

* Updated composer.lock

* Reverted some accidentally removed lines on some documentation files.

* Reverted accidentally removed line on docs/internal-developers/testing/releases/404.md

* Changed param type from mixed to

Co-authored-by: Paulo Arromba <[email protected]>
Co-authored-by: Seghir Nadir <[email protected]>
  • Loading branch information
3 people committed Nov 12, 2022
1 parent ddf35ca commit 8f15cef
Show file tree
Hide file tree
Showing 8 changed files with 476 additions and 50 deletions.
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ trim_trailing_whitespace = true
[*.txt]
trim_trailing_whitespace = false

[*.{json,yml}]
[*.yml]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2

[*.json]
indent_style = tab
[*.md]
indent_style = space
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"prefer-stable": true,
"minimum-stability": "dev",
"require": {
"ext-hash": "*",
"ext-json": "*",
"composer/installers": "^1.7.0",
"automattic/jetpack-autoloader": "^2.9.1"
},
Expand Down
53 changes: 28 additions & 25 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8f15cef

Please sign in to comment.