Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Unified Diff: third_party/boto/boto/sts/connection.py

Issue 698893003: Update checked in version of gsutil to version 4.6 (Closed) Base URL: http://dart.googlecode.com/svn/third_party/gsutil/
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/boto/boto/sts/__init__.py ('k') | third_party/boto/boto/support/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/boto/boto/sts/connection.py
===================================================================
--- third_party/boto/boto/sts/connection.py (revision 33376)
+++ third_party/boto/boto/sts/connection.py (working copy)
@@ -70,7 +70,7 @@
proxy_user=None, proxy_pass=None, debug=0,
https_connection_factory=None, region=None, path='/',
converter=None, validate_certs=True, anon=False,
- security_token=None):
+ security_token=None, profile_name=None):
if not region:
region = RegionInfo(self, self.DefaultRegionName,
self.DefaultRegionEndpoint,
@@ -85,7 +85,8 @@
self.region.endpoint, debug,
https_connection_factory, path,
validate_certs=validate_certs,
- security_token=security_token)
+ security_token=security_token,
+ profile_name=profile_name)
def _required_auth_capability(self):
if self.anon:
@@ -237,7 +238,9 @@
FederationToken, verb='POST')
def assume_role(self, role_arn, role_session_name, policy=None,
- duration_seconds=None, external_id=None):
+ duration_seconds=None, external_id=None,
+ mfa_serial_number=None,
+ mfa_token=None):
"""
Returns a set of temporary security credentials (consisting of
an access key ID, a secret access key, and a security token)
@@ -327,6 +330,24 @@
information about the external ID, see `About the External ID`_ in
Using Temporary Security Credentials .
+ :type mfa_serial_number: string
+ :param mfa_serial_number: The identification number of the MFA device that
+ is associated with the user who is making the AssumeRole call.
+ Specify this value if the trust policy of the role being assumed
+ includes a condition that requires MFA authentication. The value is
+ either the serial number for a hardware device (such as
+ GAHT12345678) or an Amazon Resource Name (ARN) for a virtual device
+ (such as arn:aws:iam::123456789012:mfa/user). Minimum length of 9.
+ Maximum length of 256.
+
+ :type mfa_token: string
+ :param mfa_token: The value provided by the MFA device, if the trust
+ policy of the role being assumed requires MFA (that is, if the
+ policy includes a condition that tests for MFA). If the role being
+ assumed requires MFA and if the TokenCode value is missing or
+ expired, the AssumeRole call returns an "access denied" errror.
+ Minimum length of 6. Maximum length of 6.
+
"""
params = {
'RoleArn': role_arn,
@@ -338,6 +359,10 @@
params['DurationSeconds'] = duration_seconds
if external_id is not None:
params['ExternalId'] = external_id
+ if mfa_serial_number is not None:
+ params['SerialNumber'] = mfa_serial_number
+ if mfa_token is not None:
+ params['TokenCode'] = mfa_token
return self.get_object('AssumeRole', params, AssumedRole, verb='POST')
def assume_role_with_saml(self, role_arn, principal_arn, saml_assertion,
« no previous file with comments | « third_party/boto/boto/sts/__init__.py ('k') | third_party/boto/boto/support/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698