Skip to content

Commit

Permalink
Prioritize auth middlware (#167)
Browse files Browse the repository at this point in the history
Ensure the `TEvoAuthMiddleware` is before any additional middleware so the computed X-Signature can be available to a logger middlware.
  • Loading branch information
jwcobb authored Apr 4, 2022
1 parent 84de1c4 commit 4e6dfa4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 4.4.0 (April 4, 2022)
- Ensure the `TEvoAuthMiddleware` is before any additional middleware so the computed X-Signature can be available to a logger middlware.

## 4.3.0 (March 9, 2022)
- Add new `completeShipment()` and `updateShipment()` methods that are most often used when fulfilling mobile transfer sales.

Expand Down
7 changes: 3 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Client
*
* @const string
*/
const VERSION = '4.3.0';
const VERSION = '4.4.0';

/**
* Guzzle service description
Expand Down Expand Up @@ -60,12 +60,11 @@ class Client
public function __construct(array $settings = [], array $middleware = [])
{
$this->settings = $settings;
$this->middleware = $middleware;

// Use the TEvoAuth middleware to handle the request signing
$this->middleware[] = new TEvoAuthMiddleware($this->settings['apiToken'], $this->settings['apiSecret']);
$this->middleware = array_merge([new TEvoAuthMiddleware($this->settings['apiToken'], $this->settings['apiSecret'])], $middleware);

// Don’t need these any more
// Don’t need these anymore
unset($this->settings['apiToken'], $this->settings['apiSecret']);

// TEvo API servers don't like the “Expect: 100” header so override it
Expand Down

0 comments on commit 4e6dfa4

Please sign in to comment.