Skip to content

Commit 1c99a8e

Browse files
author
ogorkun
committed
AC-1344: Update Integrations
1 parent 274ee76 commit 1c99a8e

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,19 @@ class OauthTest extends TestCase
6161
*/
6262
private $_loggerMock;
6363

64+
/**
65+
* @var string
66+
*/
6467
private $_oauthToken;
6568

69+
/**
70+
* @var string
71+
*/
6672
private $_oauthSecret;
6773

74+
/**
75+
* @var string
76+
*/
6877
private $_oauthVerifier;
6978

7079
const CONSUMER_ID = 1;

dev/tests/api-functional/framework/Magento/TestFramework/Authentication/Rest/OauthClient.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,4 +278,12 @@ public function validateAccessToken($token, $method = 'GET')
278278

279279
return json_decode($responseBody);
280280
}
281+
282+
/**
283+
* @inheritDoc
284+
*/
285+
protected function getSignatureMethod()
286+
{
287+
return 'HMAC-SHA256';
288+
}
281289
}

dev/tests/api-functional/framework/Magento/TestFramework/Authentication/Rest/OauthClient/Signature.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,17 @@ function ($carry, $item) {
5151

5252
return base64_encode($this->hash($baseString));
5353
}
54+
55+
/**
56+
* @inheritDoc
57+
*/
58+
protected function hash($data)
59+
{
60+
switch (strtoupper($this->algorithm)) {
61+
case 'HMAC-SHA256':
62+
return hash_hmac('sha256', $data, $this->getSigningKey(), true);
63+
default:
64+
return parent::hash($data);
65+
}
66+
}
5467
}

0 commit comments

Comments
 (0)