Commit Graph

147 Commits

Author SHA1 Message Date
acsbendi
48f0c6f194 Fixed format of access key ID and secret access key. 2019-07-04 20:20:08 +02:00
Steve Pulec
172e089854
Merge branch 'master' into policy-version-fixes 2019-07-01 20:58:38 -05:00
acsbendi
ed2682582f Policy validation precedes finding policy for create_policy_version. 2019-07-01 18:54:32 +02:00
acsbendi
4748c6b073 Enabled validating policies for all operations similar to CreatePolicy. 2019-06-30 17:35:26 +02:00
acsbendi
ef20b47f97 Implemented checking policy documents for syntax errors. 2019-06-30 17:09:55 +02:00
acsbendi
c799b1a122 Fixed being able to create more than 5 policy versions. 2019-06-29 19:01:43 +02:00
acsbendi
6f5948af33 Fixed is_default is not reset on old default version. 2019-06-29 18:55:19 +02:00
Bendegúz Ács
ab8a189bbf Fixed policy version's Document type for AWS managed policies (#2234)
* Added checking Document's type in AWS managed policy version response.

* Fixed policy version's Document type for AWS managed policies.
2019-06-10 20:00:37 +01:00
Bendegúz Ács
97ab7fd307 Fixes for get_policy and get_policy_version with AWS managed policies (#2231)
* Created test for get_policy with AWS managed policy.

* Created failing test for get_policy_version with AWS managed policy.

* Updated AWS managed policies.

* Fixed failing tests.

* Fixed trying to compare datetime with string in test case.

* Fixed CreateDate of AWS managed policies overwritten by their version's CreateDate.

* Fixed and improved tests for managed AWS policies.

* Added test for AWS managed policy with v4 default version.

* Fixed not correctly returning dates for AWS managed policies.
2019-06-06 13:36:39 +01:00
Pall Valmundsson
d25a7ff936 Uniform IAM datetime ISO 8601 handling (#2169)
`str(datetime.utcnow())` returns a timestamp that's not of the same
format as the AWS SDK uses, in short it's missing the `T` between the
date and the time.

This causes issues for e.g. Terraform and probably other AWS Go SDK
users. There seems to be some differences between endpoints whether they
return milliseconds or not, the AWS API docs were reviewed and the
decision whether to return timestamps with milliseconds or not based on
the example response documented.

As the timstamps are generated for uniqueness rather than being
hardcoded and then directly cast to a UTC (Z) formed timestamp pytz was
removed as timezone correctness is probably not important.
2019-06-02 19:18:50 +01:00
Travis Truman
b8ba7980a0 Adding support for specifying a PermissionsBoundary ARN in calls to i… (#2182)
* Adding support for specifying a PermissionsBoundary ARN in calls to iam.create_role

Closes #2181

* Correcting whitespace error

* Adding support for Role PermissionsBoundary to be returned from
calls to list_roles

* Raise ClientError when a bad permissions boundary ARN is supplied
2019-05-21 17:44:05 +01:00
Mike Grima
5d955985b9
Merge pull request #2106 from andytumelty/iam-update-user
Add support for iam update_user
2019-04-17 11:13:14 -07:00
Santosh Ananthakrishnan
4f1a1a9d1e [iam] create_policy_version: Fix version id calculation
When creating a new IAM policy version with create_policy_version,
we cannot use the length of the versions list to calculate VersionId.
Keep track of the next version id to use as a non-decreasing counter.

Fixes #2157
2019-04-16 20:15:57 +00:00
Jessie Nadler
497965fadc Return InstanceProfile arn instead of NotImplementedError for get_cfn_attribute 2019-03-26 14:36:31 -04:00
Andy Tumelty
d53626ad9a Add support for iam update_user
This covers both the NewPath and NewUserName parameters for update_user, but
without regex validation for these values.
2019-03-12 17:23:32 +00:00
William Rubel
e9d8021c86 Fixing list entities for policy 2019-02-18 21:20:29 -06:00
William Rubel
ce7b5ebf54 Fix policy date 2019-02-17 21:37:33 -06:00
William Rubel
9e9e37eb62 Add test for roles 2019-02-17 15:35:49 -06:00
William Rubel
31258e9e9e Add test for roles 2019-02-17 15:23:59 -06:00
William Rubel
921a993330 cleaning up files 2019-02-17 14:30:43 -06:00
Mike Grima
1a36c0c377 IAM Role Tagging support 2019-01-31 17:37:26 -08:00
Steve Pulec
25595815e5
Merge pull request #1972 from surfaslt/implement-get-access-key-last-used
Implement get_access_key_last_used
2018-12-28 21:08:13 -05:00
Steve Pulec
46bf7f0176
Merge branch 'master' into master 2018-12-28 20:57:47 -05:00
Steve Pulec
48b19e8655
Merge pull request #1951 from jmillxyz/add-default-path-iam
Add default path to Role & InstanceProfile
2018-12-28 20:42:55 -05:00
martynaspaulikas
9418a6916d Fix tests and functionality of get_access_key_last_used() 2018-11-27 16:12:41 +00:00
martynaspaulikas
7189d019df Implemented get_access_key_last_used
Written test that still does not work due to:
    ParamValidationError: Parameter validation failed:
    Unknown parameter in input: "UserName", must be one of: AccessKeyId
Refactored update_access_key and delete_access_key functions
2018-11-27 11:28:09 +00:00
Joe Engel
57fa11136b Add functionalities for SAML Providers 2018-11-19 15:53:02 -08:00
Jon Miller
b5eb724773 Add default path to Role & InstanceProfile 2018-11-15 15:24:45 -08:00
Mike Grima
94b5438d76 Added IAM User signing certificate support 2018-11-05 13:15:44 -08:00
Mike Grima
b4b0ae5077 Some IAM fixes.
- Fixed InstanceProfiles having `Path` set to `None`.
- Added in some dynamic `CreateDate`s.
- Fixed missing Instance Profile ID's being sent over
2018-11-05 09:24:28 -08:00
Mike Grima
8ae1a2b357 Fixes for IAM Groups 2018-10-16 17:14:23 -07:00
Karl Gutwin
de4d5d9d62 Correct flake8 failures 2018-08-08 11:13:25 -04:00
Karl Gutwin
5ae5ae0efa Correct deviation in behavior of policy versions from standard API 2018-08-07 17:24:15 -04:00
Karl Gutwin
9e667d6b25 Add get_policy IAM action 2018-08-07 16:59:15 -04:00
Will Bengtson
a420064621 IAM get account authorization details (#1736)
* start of get_account_authorization_details for iam

* add get_account_authorization_details dynamic template

* remove old commented out template

* Fix flake8 problems and add unit test
2018-08-07 10:31:36 -07:00
Nathan Mische
ff80ecb56d Adding account id to ManagedPolicy ARN 2018-07-17 13:31:18 -04:00
Brian Pandola
350cf9257e Add update_access_key endpoint (#1423) 2018-01-10 18:29:08 -05:00
William Richard
df7a7958c1 Path is an optional property of instance profile cloudformation resource (#1382)
* Path is an optional property of instance profile cloudformation resource

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html

* Path is also optional for iam role clouformation resources

Based on http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html

* Use `properities.get` with a default instead of doing default handling myself
2017-12-14 12:06:04 +00:00
David Bartle
52ce8d378f IAM delete_server_certificate (#1380)
* IAM delete_server_certificate

* flake8 fixes
2017-12-08 10:43:09 +00:00
Terry Cain
a027f86cc8
Merge branch 'master' into batch 2017-10-03 19:37:53 +01:00
Jack Danger
353f8387a2 implementing detach_group_policy 2017-10-01 15:05:33 -07:00
Jack Danger
37ae61871c add model methods for iam attached group policies 2017-10-01 15:01:33 -07:00
Terry Cain
56e4300ad4
Added preliminary CreateComputeEnvironment 2017-09-26 22:22:59 +01:00
Jack Danger
b840cb7455 fixing whitespace on AWS managed policies 2017-09-19 14:19:29 -07:00
Jack Danger
8f2f7fa20d Adding a script to import all of AWS' managed policies
fixes #1118
2017-09-19 14:01:08 -07:00
Toshiya Kawasaki
ee4ca0c39a Support IAM account alias (#1088) 2017-09-07 11:21:44 -07:00
Brian Pandola
bca5047202 Implement additional IAM endpoints
- attach_user_policy
- detach_user_policy
- list_attached_user_policies
2017-08-14 13:55:53 -07:00
David Cuthbert
672604d3e7 Add support for iam:DetachRolePolicy and iam:DeleteRolePolicy. (#1052)
* Add support for iam:DetachRolePolicy and iam:DeleteRolePolicy.

* Raise proper exceptions for iam:DetachRolePolicy and iam:DeleteRolePolicy when the policy doesn't exist.
2017-08-13 21:58:11 -07:00
Jack Danger
e445c81e83 Implement IAM {update,get}_login_profile 2017-07-27 14:22:25 -07:00
Jack Danger Canty
15d3397a60 implementing IAM delete_role
Fixes #957
2017-05-19 16:23:42 -07:00
Jack Danger
6ff8d500e5 Merge pull request #946 from heddle317/add_policy_version
Add policy version
2017-05-15 15:10:49 -07:00
Kate Heddleston
992b475093 testing create, get, list, delete policy versions 2017-05-15 14:56:30 -07:00
Kate Heddleston
e307dc38e6 Implementing IAM policy versions
Adding definitions for create, list, and delete policy_versions
2017-05-15 14:56:28 -07:00
graham-hargreaves
835fe2d742 Update list IAM AccessKeys
Add the creation date, including timezone info, to the data returned
when requesting all AccessKeys for an IAM user.

This fixes #75
2017-05-07 16:31:26 +01:00
Steve Pulec
34c711189f Cleanup IAM user create format. Closes #898. 2017-04-13 21:39:07 -04:00
Sean Marlow
9a2f2fcd4b
Add list user policies endpoint to iam backend.
- Add response and endpoint methods.
- Add test covering put, get, delete and list user policy.
2017-04-13 15:09:23 -06:00
Sean Marlow
8b9d685f1c
Add mfa device endpoints to iam backend.
- Add mfa device class
- Add mfa devices dictionary to user class
- Add responses, endpoints and tests
2017-03-27 13:13:40 -06:00
Steve Pulec
bba197e29f Make IAM ARNs more dynamic. Closes #663. 2017-03-19 11:58:24 -04:00
Steve Pulec
6d422d1f37 Add BaseModel to all models. 2017-03-11 23:41:12 -05:00
Steve Pulec
3b4ef2cf15 Merge in master. 2017-03-05 09:58:39 -05:00
Léo Cavaillé
9b6d3983d2 iam: add group policy methods (#849)
Implemented mocks for:
* get_all_group_policies
* list_group_policies (boto3)
* get_group_policy
* put_group_policy
2017-03-04 22:56:36 -05:00
Steve Pulec
f37bad0e00 Lints. 2017-02-23 21:37:43 -05:00
Jesse Szwedko
d42432bfef IAM: raise error if requiested instance profile does not exist (#802)
Signed-off-by: Andrew Harris <andrew.harris@getbraintree.com>
2017-01-18 21:36:50 -05:00
Steve Pulec
201efd5773 Fix bug with listing IAM users. 2017-01-11 20:54:47 -05:00
Sean Marlow
fa3663c610 Add support for login profile deletion (#768)
* Add support for delete_login_profile.

Mock deletion of login profile. Set password to
none. Add tests to cover new endpoint.

* Fix typo in create_login_profile response.

Change CreateUserResult to CreateLoginProfileResult
in the CREATE_LOGIN_PROFILE_TEMPLATE. Caused KeyError
when using boto3.

Add test to cover boto3 in addition to boto.
2016-11-11 17:05:01 -05:00
Steve Pulec
9101b58934 Need to speficy how we are sorting. 2016-11-06 10:57:01 -05:00
Taro Sato
159a81723c Implement IAM managed policy.
This requires boto 2.39 for managed policy tests
2016-10-20 10:07:41 -07:00
Steve Pulec
ea319698aa Merge pull request #669 from netors/feature/implement-iam-list-users-for-boto3
implemented iam list users (Closes #668)
2016-08-27 21:13:53 -04:00
Michael Barrett
4bfbcf4d03 Causes get_server_certificate to fail correctly
When no certificate with the name exists, the API should return a 404
(NoSuchEntity).
2016-08-14 17:40:39 -07:00
Ernesto Ruy Sanchez
e84dad6509 implemented iam list users 2016-07-20 15:12:02 -07:00
Steve Pulec
68de6feb01 Add iam remove_role_from_instance_profile. Closes #563. 2016-05-04 22:25:46 -04:00
Steve Pulec
587893f0c7 Duplicate user needs to be EntityAlreadyExists error code. 2015-12-03 21:59:55 -05:00
Steve Pulec
3a38a2a1a7 Cleanup IAM exceptions. Closes #476. 2015-12-03 20:56:28 -05:00
Simon-Pierre Gingras
9a2e7ad8b0 IAM: unnecessary check for role 2015-06-29 11:04:40 -04:00
Simon-Pierre Gingras
db7d7a9330 IAM: get_role should thrown when role is unexisting 2015-06-29 10:46:05 -04:00
Steve Pulec
be5f041416 Add IAM list_groups and list_groups_for_user. Closes #343. 2015-04-30 19:32:53 -04:00
Mike Grima
3a357c0fe3 Added in test for the boto IAM method: list_instance_profiles_for_role() 2015-02-26 21:28:15 -08:00
Mike Fuller
abae19d273 fixing up base64 encoding for python 3 back to using base64 module 2015-02-05 17:07:08 +11:00
Mike Fuller
d0a60d8702 fixing up base64 encoding for python 3 2015-02-05 17:03:11 +11:00
Mike Fuller
ffff67692c encode credential_report to ascii to help the base64 encoding work. 2015-02-04 12:39:28 +11:00
Mike Fuller
5eab1901e4 added get/generate credential report to mock_iam 2015-02-03 09:42:57 +11:00
Steve Pulec
6331c2e1f1 IAM py3 fix. 2014-12-06 19:42:42 -05:00
Steve Pulec
20dda251f8 Updates for IAM changes. 2014-12-06 19:37:10 -05:00
Kevin Glisson
cc312d29fc Adding put_role_policy, get_role_policy, and list_role_policies, update_assume_role_policy 2014-11-30 20:11:13 -08:00
Kevin Glisson
7f6af025f3 Create role does not allow for document policies to be passed to it 2014-11-30 11:16:29 -08:00
Steve Pulec
bd847bd941 Cleanup multi-region support for ELB, SQS, Cloudformation, EC2, Autoscaling. 2014-11-15 13:34:52 -05:00
Steve Pulec
c77207a8b8 More flake8. 2014-11-15 09:53:45 -05:00
ttacon
5aec4d9de5 Add create_login_profile for iam service 2014-10-29 15:31:49 -04:00
Joseph Lawson
20a69255c3 tweak Fn::GetAtt to return resource_json if resource is not implemented. DRY
This is better than failing out with a misleading Boto 400 error which should only happen when get_cfn_attribute is called but fails.
2014-10-21 14:51:26 -04:00
Joseph Lawson
1d9ffafaa5 create CloudFormation outputs and enable 'Fn::GetAtt' to work. 2014-10-21 12:45:03 -04:00
Rory-Finnegan
f1227e396a Fixed stupid "random_alphanumeric" typo that got repeated due to tab completion. 2014-09-04 10:34:01 -04:00
Rory-Finnegan
bf996f1461 Fixed py26 errors related to using assert_raises in tests. 2014-09-03 19:24:05 -04:00
Rory-Finnegan
a3b02f3f8b Added get_user and delete_access_key endpoints. 2014-09-03 16:57:51 -04:00
Rory-Finnegan
ac74af4085 Added several new endpoints for accessing iam groups and users,
include unit tests.
2014-09-03 16:57:03 -04:00
David Baumgold
4201e6b430 from __future__ import unicode_literals 2014-08-27 11:33:55 -04:00
Kevin Glisson
d2029c3fa3 adding - get all certificates, get certificate, and upload certificates endpoints 2014-05-29 14:25:26 -07:00
Steve Pulec
ef876dd27e Fix merge conflicts. Add basic cloudformation support. Closes #111. 2014-03-27 19:12:53 -04:00