Skip to content

Commit 301357d

Browse files
async-aws-botNyholmjderusse
authored
Update generated code (#989)
* update generated code * Update src/Service/Sqs/CHANGELOG.md Co-authored-by: Jérémy Derussé <[email protected]> Co-authored-by: Tobias Nyholm <[email protected]> Co-authored-by: Jérémy Derussé <[email protected]>
1 parent c1ae5dd commit 301357d

File tree

5 files changed

+65
-8
lines changed

5 files changed

+65
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## NOT RELEASED
44

5+
### Added
6+
7+
- AWS enhancement: STS now supports assume role with Web Identity using JWT token length upto 20000 characters
8+
- AWS api-change: This release adds the SourceIdentity parameter that can be set when assuming a role.
9+
510
## 1.9.2
611

712
### Fixed

src/Sts/Input/AssumeRoleRequest.php

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ final class AssumeRoleRequest extends Input
4545
private $policy;
4646

4747
/**
48-
* The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) up to the maximum
49-
* session duration setting for the role. This setting can have a value from 1 hour to 12 hours. If you specify a value
50-
* higher than this setting, the operation fails. For example, if you specify a session duration of 12 hours, but your
51-
* administrator set the maximum session duration to 6 hours, your operation fails. To learn how to view the maximum
52-
* value for your role, see View the Maximum Session Duration Setting for a Role in the *IAM User Guide*.
48+
* The duration, in seconds, of the role session. The value specified can can range from 900 seconds (15 minutes) up to
49+
* the maximum session duration that is set for the role. The maximum session duration setting can have a value from 1
50+
* hour to 12 hours. If you specify a value higher than this setting or the administrator setting (whichever is lower),
51+
* the operation fails. For example, if you specify a session duration of 12 hours, but your administrator set the
52+
* maximum session duration to 6 hours, your operation fails. To learn how to view the maximum value for your role, see
53+
* View the Maximum Session Duration Setting for a Role in the *IAM User Guide*.
5354
*
5455
* @see https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
5556
*
@@ -104,14 +105,21 @@ final class AssumeRoleRequest extends Input
104105
private $serialNumber;
105106

106107
/**
107-
* The value provided by the MFA device, if the trust policy of the role being assumed requires MFA (that is, if the
108-
* policy includes a condition that tests for MFA). If the role being assumed requires MFA and if the `TokenCode` value
109-
* is missing or expired, the `AssumeRole` call returns an "access denied" error.
108+
* The value provided by the MFA device, if the trust policy of the role being assumed requires MFA. (In other words, if
109+
* the policy includes a condition that tests for MFA). If the role being assumed requires MFA and if the `TokenCode`
110+
* value is missing or expired, the `AssumeRole` call returns an "access denied" error.
110111
*
111112
* @var string|null
112113
*/
113114
private $tokenCode;
114115

116+
/**
117+
* The source identity specified by the principal that is calling the `AssumeRole` operation.
118+
*
119+
* @var string|null
120+
*/
121+
private $sourceIdentity;
122+
115123
/**
116124
* @param array{
117125
* RoleArn?: string,
@@ -124,6 +132,7 @@ final class AssumeRoleRequest extends Input
124132
* ExternalId?: string,
125133
* SerialNumber?: string,
126134
* TokenCode?: string,
135+
* SourceIdentity?: string,
127136
* @region?: string,
128137
* } $input
129138
*/
@@ -139,6 +148,7 @@ public function __construct(array $input = [])
139148
$this->externalId = $input['ExternalId'] ?? null;
140149
$this->serialNumber = $input['SerialNumber'] ?? null;
141150
$this->tokenCode = $input['TokenCode'] ?? null;
151+
$this->sourceIdentity = $input['SourceIdentity'] ?? null;
142152
parent::__construct($input);
143153
}
144154

@@ -185,6 +195,11 @@ public function getSerialNumber(): ?string
185195
return $this->serialNumber;
186196
}
187197

198+
public function getSourceIdentity(): ?string
199+
{
200+
return $this->sourceIdentity;
201+
}
202+
188203
/**
189204
* @return Tag[]
190205
*/
@@ -279,6 +294,13 @@ public function setSerialNumber(?string $value): self
279294
return $this;
280295
}
281296

297+
public function setSourceIdentity(?string $value): self
298+
{
299+
$this->sourceIdentity = $value;
300+
301+
return $this;
302+
}
303+
282304
/**
283305
* @param Tag[] $value
284306
*/
@@ -357,6 +379,9 @@ private function requestBody(): array
357379
if (null !== $v = $this->tokenCode) {
358380
$payload['TokenCode'] = $v;
359381
}
382+
if (null !== $v = $this->sourceIdentity) {
383+
$payload['SourceIdentity'] = $v;
384+
}
360385

361386
return $payload;
362387
}

src/Sts/Result/AssumeRoleResponse.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ class AssumeRoleResponse extends Result
3434
*/
3535
private $packedPolicySize;
3636

37+
/**
38+
* The source identity specified by the principal that is calling the `AssumeRole` operation.
39+
*/
40+
private $sourceIdentity;
41+
3742
public function getAssumedRoleUser(): ?AssumedRoleUser
3843
{
3944
$this->initialize();
@@ -55,6 +60,13 @@ public function getPackedPolicySize(): ?int
5560
return $this->packedPolicySize;
5661
}
5762

63+
public function getSourceIdentity(): ?string
64+
{
65+
$this->initialize();
66+
67+
return $this->sourceIdentity;
68+
}
69+
5870
protected function populateResult(Response $response): void
5971
{
6072
$data = new \SimpleXMLElement($response->getContent());
@@ -71,5 +83,6 @@ protected function populateResult(Response $response): void
7183
'Arn' => (string) $data->AssumedRoleUser->Arn,
7284
]);
7385
$this->packedPolicySize = ($v = $data->PackedPolicySize) ? (int) (string) $v : null;
86+
$this->sourceIdentity = ($v = $data->SourceIdentity) ? (string) $v : null;
7487
}
7588
}

src/Sts/Result/AssumeRoleWithWebIdentityResponse.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ class AssumeRoleWithWebIdentityResponse extends Result
5454
*/
5555
private $audience;
5656

57+
/**
58+
* The value of the source identity that is returned in the JSON web token (JWT) from the identity provider.
59+
*/
60+
private $sourceIdentity;
61+
5762
public function getAssumedRoleUser(): ?AssumedRoleUser
5863
{
5964
$this->initialize();
@@ -89,6 +94,13 @@ public function getProvider(): ?string
8994
return $this->provider;
9095
}
9196

97+
public function getSourceIdentity(): ?string
98+
{
99+
$this->initialize();
100+
101+
return $this->sourceIdentity;
102+
}
103+
92104
public function getSubjectFromWebIdentityToken(): ?string
93105
{
94106
$this->initialize();
@@ -115,5 +127,6 @@ protected function populateResult(Response $response): void
115127
$this->packedPolicySize = ($v = $data->PackedPolicySize) ? (int) (string) $v : null;
116128
$this->provider = ($v = $data->Provider) ? (string) $v : null;
117129
$this->audience = ($v = $data->Audience) ? (string) $v : null;
130+
$this->sourceIdentity = ($v = $data->SourceIdentity) ? (string) $v : null;
118131
}
119132
}

src/Sts/StsClient.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class StsClient extends AbstractApi
4747
* ExternalId?: string,
4848
* SerialNumber?: string,
4949
* TokenCode?: string,
50+
* SourceIdentity?: string,
5051
* @region?: string,
5152
* }|AssumeRoleRequest $input
5253
*

0 commit comments

Comments
 (0)