diff --git a/README.md b/README.md index c46c7d4..a729afc 100644 --- a/README.md +++ b/README.md @@ -114,10 +114,10 @@ pyenv rehash tox ``` - [credentials]: http://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs - [best practices]: http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html - [assume a role]: http://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html - [temporary credentials]: http://docs.aws.amazon.com/STS/latest/UsingSTS/Welcome.html - [account number]: http://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html - [requires MFA]: http://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html#cli-roles-mfa - [AWS CLI guide]: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html + [credentials]: https://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs + [best practices]: https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html + [assume a role]: https://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html + [temporary credentials]: https://docs.aws.amazon.com/STS/latest/UsingSTS/Welcome.html + [account number]: https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html + [requires MFA]: https://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html#cli-roles-mfa + [AWS CLI guide]: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html diff --git a/awsudo/config.py b/awsudo/config.py index b042320..49175ea 100644 --- a/awsudo/config.py +++ b/awsudo/config.py @@ -29,8 +29,8 @@ def set(key, value): set('AWS_SECRET_ACCESS_KEY', creds.secret_key) # AWS_SESSION_TOKEN is the ostensibly the standard: - # http://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs - # http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-environment + # https://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs + # https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-environment set('AWS_SESSION_TOKEN', creds.token) # ...but boto expects AWS_SECURITY_TOKEN. Set both for compatibility. diff --git a/awsudo/rotate.py b/awsudo/rotate.py index 5e8bb2f..b580d61 100644 --- a/awsudo/rotate.py +++ b/awsudo/rotate.py @@ -8,7 +8,7 @@ from boto.iam.connection import IAMConnection from boto.exception import BotoServerError -ACCESS_KEY_DOCS = 'http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html' +ACCESS_KEY_DOCS = 'https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html' try: from configparser import RawConfigParser @@ -50,7 +50,7 @@ def updateCredentials(self, keyId, secretKey): self._config.set(self.section, 'aws_secret_access_key', secretKey) os.umask(0o0066) - os.rename(self._filename, self._filename+'~') + os.rename(self._filename, self._filename + '~') with open(self._filename, 'w') as f: self._config.write(f) @@ -130,9 +130,9 @@ def getUserName(iam): @retry( - stop_max_delay=60*1000, + stop_max_delay=60 * 1000, wait_exponential_multiplier=250, - wait_exponential_max=10*1000, + wait_exponential_max=10 * 1000, retry_on_exception=lambda e: isinstance(e, BotoServerError)) def deactivateKey(iam, oldKey, userName): """Set the given key as inactive.