Conditions | 4 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 18 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
25 | 7 | public function __construct(RamRoleArnCredential $arnCredential) |
|
26 | { |
||
27 | 7 | parent::__construct(); |
|
28 | 7 | $this->product('Sts'); |
|
29 | 7 | $this->version('2015-04-01'); |
|
30 | 7 | $this->action('AssumeRole'); |
|
31 | 7 | $this->host('sts.aliyuncs.com'); |
|
32 | 7 | $this->scheme('https'); |
|
33 | 7 | $this->regionId('cn-hangzhou'); |
|
34 | 7 | $this->options['verify'] = false; |
|
35 | 7 | $this->options['query']['RoleArn'] = $arnCredential->getRoleArn(); |
|
36 | 7 | $this->options['query']['RoleSessionName'] = $arnCredential->getRoleSessionName(); |
|
37 | 7 | $this->options['query']['DurationSeconds'] = Provider::DURATION_SECONDS; |
|
38 | 7 | if ($arnCredential->getPolicy()) { |
|
39 | 2 | if (is_array($arnCredential->getPolicy())) { |
|
|
|||
40 | 1 | $this->options['query']['Policy'] = json_encode($arnCredential->getPolicy()); |
|
41 | 1 | } |
|
42 | 2 | if (is_string($arnCredential->getPolicy())) { |
|
43 | 1 | $this->options['query']['Policy'] = $arnCredential->getPolicy(); |
|
44 | 1 | } |
|
48 |