Skip to content

Commit

Permalink
Improved Noce (#206)
Browse files Browse the repository at this point in the history
Improved Noce
  • Loading branch information
aliguyong authored Feb 26, 2020
1 parent 6e08730 commit a11d68d
Show file tree
Hide file tree
Showing 9 changed files with 280 additions and 47 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 1.5.21 - 2020-02-26
- Improved Nonce.
- Updated Endpoints.

## 1.5.20 - 2019-12-30
- Improved Docs.
- Updated Endpoints.
Expand Down
2 changes: 1 addition & 1 deletion src/AlibabaCloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AlibabaCloud
/**
* Version of the Client
*/
const VERSION = '1.5.20';
const VERSION = '1.5.21';

/**
* This static method can directly call the specific service.
Expand Down
305 changes: 267 additions & 38 deletions src/Config/Data.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Support/Sign.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ public static function roaString(Request $request)
*/
public static function uuid($salt)
{
return md5($salt . uniqid(md5(microtime(true)), true));
return md5($salt . uniqid(md5(microtime(true)), true)) . microtime();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function testGetInCache()
);
$cacheMethod->setAccessible(true);
$result = [
'Expiration' => '2020-02-02 11:11:11',
'Expiration' => '2049-10-01 11:11:11',
'AccessKeyId' => 'foo',
'AccessKeySecret' => 'bar',
'SecurityToken' => 'token',
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Credentials/Providers/ProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ public function cache()
[
new AccessKeyClient('foo', 'bar'),
[
'Expiration' => '2020-02-02 11:11:11',
'Expiration' => '2049-10-01 11:11:11',
],
[
'Expiration' => '2020-02-02 11:11:11',
'Expiration' => '2049-10-01 11:11:11',
],
],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testGetInCache()
);
$cacheMethod->setAccessible(true);
$result = [
'Expiration' => '2020-02-02 11:11:11',
'Expiration' => '2049-10-01 11:11:11',
'AccessKeyId' => 'foo',
'AccessKeySecret' => 'bar',
'SecurityToken' => 'token',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function testGetInCache()
);
$cacheMethod->setAccessible(true);
$result = [
'Expiration' => '2020-02-02 11:11:11',
'Expiration' => '2049-10-01 11:11:11',
'SessionAccessKeyId' => 'foo',
'SessionAccessKeySecret' => 'bar',
];
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Support/SignTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace AlibabaCloud\Client\Tests\Unit\Support;

use PHPUnit\Framework\TestCase;
use AlibabaCloud\Client\Support\Sign;
use PHPUnit\Framework\TestCase;

class SignTest extends TestCase
{
public function testUUID()
{
self::assertEquals(32, strlen(Sign::uuid('uuid')));
self::assertEquals(53, strlen(Sign::uuid('uuid')));
}
}

0 comments on commit a11d68d

Please sign in to comment.