Skip to content

Fix OAuth encoding for ISO 8601 before/after filters #60

Description

@omandryk

Problem

Using WooCommerce before or after query parameters with ISO 8601 timestamps can produce woocommerce_rest_authentication_error because the request parameters and OAuth signature base string are not encoded consistently. This succeeds through other WooCommerce clients but fails in this Java client.

This is the maintained follow-up to #36 and incorporates the investigation and proposed fixes from @xsalefter in #37 and @CasonMo in #49. Those PRs use different strategies—pre-encoding colons versus replacing percent signs during encoding—so neither should be merged without independent proof that values are encoded exactly once.

Acceptance criteria

  • Reproduce the failure with before and after ISO 8601 values in an automated regression test.
  • Make nonce and timestamp deterministic in tests so the complete OAuth parameter set, signature base string, and signature can be asserted against an independently derived known-good vector.
  • Follow OAuth/RFC 3986 percent-encoding rules and prove that colons, percent signs, plus signs, timezone offsets, and already encoded-looking input are encoded exactly once.
  • Verify the final request query and the normalized parameters used for signing remain consistent.
  • Preserve the existing public API and Java 8 compatibility for the 1.x line.
  • Validate the result against a disposable WooCommerce installation before release.
  • Credit the investigations in Not able to get orders between dates #36, fix #36 not able to get orders between dates #37, and fix : can not get orders between date #49 in the eventual fix/release notes.

Out of scope

  • Broad OAuth refactoring without deterministic compatibility evidence.
  • HTTPS Basic Auth support, which should be handled separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions