Commit Graph

221 Commits

Author SHA1 Message Date
Anton Grübel
fe9f1dfe14
Add tag & untag user (#3638)
* Add iam.tag_user

* Add iam.untag_user

* Fix Python2 error
2021-02-01 11:37:54 +00:00
Bert Blommers
8591eda9d6
Introduce Github Actions to replace TravisCI (#3610) 2021-01-26 12:37:03 +00:00
Brian Pandola
8f83f51897
Refactor tests marked xfail to use proper assertions (#3515) 2020-12-04 16:00:48 +00:00
Brian Pandola
d58d3e2c2e
Fix: yield tests ignored by pytest runner (#3500)
Closes #3499
2020-11-25 10:48:05 +00:00
Steve Pulec
6107561717
Merge pull request #3451 from bpandola/fix-3450
Fix: Return `Tags` in iam:CreateUserResponse
2020-11-15 11:25:10 -06:00
Bert Blommers
273ca63d59 Linting 2020-11-11 15:55:37 +00:00
Matěj Cepl
5697ff87a8 Back to Black 2020-11-10 14:12:38 +01:00
Matěj Cepl
ea489bce6c Finish porting from nose to pytest. 2020-11-10 08:25:05 +01:00
Matěj Cepl
77dc60ea97 Port test suite from nose to pytest.
This just eliminates all errors on the tests collection. Elimination of
failures is left to the next commit.
2020-11-10 08:23:44 +01:00
Brian Pandola
b8e08539e3 Fix: Return Tags in iam:CreateUserResponse
Fixes #3450
2020-11-09 14:59:06 -08:00
waynemetcalfe
0a938f7bb4
issue-3379 iam list_roles: implement PathPrefix, MaxItems and Marker (#3380)
* issue-3379 iam list_roles: implement PathPrefix, MaxItems and Marker

* issue-3379 fix cloudformation test
2020-10-12 12:13:20 +01:00
ljakimczuk
a668349a70
Add set_default_policy_version to the IAM backend (#3347)
* Adding set_default_policy_version

* Adding tests and reformatting

* Reformatting tests
2020-10-01 10:24:03 +01:00
Macwan Nevil
427a222aa0
feature added: support for api RolePermissionsBoundary (#3329)
* feature added: support for api PutUserPermissionsBoundary; DeleteRolePermissionsBoundary

* minor test fix

* lint fixed

* refractored test case

* Issue 3224 s3 copy glacier object (#3318)

* 3224 Enhancement - S3 Copy restored glacier objects

- adds setter for expiry date
- copy sets expiry date to none when source is glacier object
- throws error for copying glacier object only if not restored/still restoring

* 3224 Enhancement - S3 Copy restored glacier objects

- throws error for copying deep archive object only if not restored/still restoring

* Fix:s3 List Object response:delimiter  (#3254)

* Fix:s3 List Object delimiter in response

* fixed tests

* fixed failed tests

Co-authored-by: usmankb <usman@krazybee.com>

* feature added: support for api PutUserPermissionsBoundary; DeleteRolePermissionsBoundary

* minor test fix

* lint fixed

* refractored test case

* added test case for put role exception

Co-authored-by: ruthbovell <63656505+ruthbovell@users.noreply.github.com>
Co-authored-by: usmangani1 <sgosman_chem@yahoo.com>
Co-authored-by: usmankb <usman@krazybee.com>
2020-09-22 12:43:59 +01:00
Nick Stocchero
fd69c93a09 use botocore regions and refactor sorting 2020-09-21 17:42:44 -06:00
Nick Stocchero
8d5c70a924 different aggregation strategy 2020-09-21 17:42:44 -06:00
Nick Stocchero
d8cea0213d straighten out filter logic 2020-09-21 17:42:44 -06:00
Nick Stocchero
8dd90db83c add missing test for policies 2020-09-21 17:42:44 -06:00
Nick Stocchero
ff84b63484 address PR comments 2020-09-21 17:42:44 -06:00
Nick Stocchero
7bc5b5c08f Add IAM Role and Policy to Config 2020-09-21 17:42:44 -06:00
jweite
49d92861c0
Iam cloudformation update, singificant cloudformation refactoring (#3218)
* IAM User Cloudformation Enhancements: update, delete, getatt.

* AWS::IAM::Policy Support

* Added unit tests for AWS:IAM:Policy for roles and groups.  Fixed bug related to groups.

* AWS:IAM:AccessKey CloudFormation support.

* Refactor of CloudFormation parsing.py methods to simplify and standardize how they call to the models.  Adjusted some models accordingly.

* Further model CloudFormation support changes to align with revised CloudFormation logic.  Mostly avoidance of getting resoure name from properties.

* Support for Kinesis Stream RetentionPeriodHours param.

* Kinesis Stream Cloudformation Tag Support.

* Added omitted 'region' param to boto3.client() calls in new tests.

Co-authored-by: Joseph Weitekamp <jweite@amazon.com>
2020-08-27 10:11:47 +01:00
usmangani1
1db42fb865
FIX : IAM - Added support for pathPrefix in list_users_function (#3180)
* FIX:IAM-Added support for pathPrefix in list_users_function

* removed changes for roles

* Added test for non decorator

* changed filter function

Co-authored-by: usmankb <usman@krazybee.com>
2020-07-27 15:32:41 +01:00
ngander64
069c159492
Always return 'HardExpiry' for account password policy. (#3117)
Co-authored-by: Nick B Gander <NGANDER@amfam.com>
2020-07-11 09:38:33 +01:00
Tomoya Kabe
849f16ff2d
Correct group inline policy rendering (#3069)
* Correct group inline policy rendering in iam:GetAccountAuthorizationDetails response

* Include user inline policy if exists

* Add tests for IAM inline policies

* Remove unnecessary print stmts
2020-06-14 09:23:52 +01:00
jweite
4303123312
Implemented IAM delete_instance_profile (#3020)
* Implemented IAM delete_instance_profile

* PR adjustment: positively verifying instance profile deletion in test case.

Co-authored-by: Joseph Weitekamp <jweite@amazon.com>
2020-05-27 18:22:06 +01:00
jweite
b7a1b666a8
Corrected bug in IAM delete_role() due to overloading of name 'role' … (#3019)
* Corrected bug in IAM delete_role() due to overloading of name 'role' in function

* PR-requested fixes: added region to tests boto client create, reformatted with black

Co-authored-by: Joseph Weitekamp <jweite@amazon.com>
2020-05-27 17:00:28 +01:00
zscholl
1f1404352e use conditional TEST_SERVER_MODE for backend tests 2020-04-30 09:42:22 -05:00
zscholl
0423be259a remove backend logic & py27 incompatible timezone 2020-04-30 09:10:42 -05:00
zscholl
51e7002cbb add tests 2020-04-30 09:10:42 -05:00
Owen Farrell
142e237b0b Made UserName parameter optional for IAM access key functions 2020-01-27 12:12:21 -05:00
Asher Foa
c2e444a210 Update tests. 2019-12-20 10:54:33 -08:00
Asher Foa
1415a93596 Implement List user tags 2019-12-19 19:45:56 -08:00
Fabio Dias
743dd46399 black linting 2019-12-16 21:25:20 -05:00
Fabio Dias
fd9ac4b9a5 ACCOUNT_ID moved to moto.core, MOTO_ACCOUNT_ID env var override 2019-12-16 21:05:29 -05:00
Fabio Dias
b83a750630 Added references to moto.iam.models.ACCOUNT_ID instead of hardcoded id 2019-12-16 19:56:11 -05:00
Barry Allwood
7c1cc01eb9 chore: add MaxSessionDuration to IAM Role
fix: Description field is optional on return of IAM Role
2019-11-24 18:19:09 +00:00
Steve Pulec
72da9e96c2 Lint. 2019-11-21 17:53:58 -05:00
Matt Conway
d9c8bdb2a0 Add the ssh_public_key methods that were missing from the IAM implementation 2019-11-18 09:02:32 -05:00
Mike Grima
dab7f9fdad
Merge pull request #2574 from gruebel/add-iam-get-account-summary
Add iam.get_account_summary
2019-11-17 15:53:34 -08:00
gruebel
e9c3cba4d6 Fix tests 2019-11-17 14:34:00 +01:00
gruebel
d05ebadce8 Add iam.get_account_summary 2019-11-17 13:47:19 +01:00
Bert Blommers
85570f0abe IAM - Add Validation on duplicate policy names 2019-11-16 17:36:50 +00:00
Bert Blommers
422bca8e90 IAM - Add Validation on duplicate role names 2019-11-16 17:33:59 +00:00
Mike Grima
3afb93d9db
Merge pull request #2548 from bblommers/feature/implement-iam-delete-group-endpoint
Feature/implement iam delete group endpoint
2019-11-15 10:52:21 -08:00
Mike Grima
7ca35514ca
Merge pull request #2542 from ianyon/create_policy_already_exist
Added Exception for create_policy when policy exists
2019-11-15 10:38:35 -08:00
Steven Reiling
cd0769af7e Fix IAM instance profile tracking to reflect AWS's requirement for account-unique names 2019-11-14 17:23:44 -08:00
Bert Blommers
cd5b64b0c5 #2163 - Delete IAM group; Add test case and align error message with AWS 2019-11-08 01:19:45 -08:00
Robin Taylor
876ff476f1 Implementing delete-group endpoint and appropriate test case 2019-11-08 01:12:20 -08:00
Ian Yon
f235fa145e Added Exception for create_policy when policy exists 2019-11-05 15:57:38 -03:00
gruebel
78e2714496 black format 2019-11-01 07:14:03 +01:00
gruebel
89c43820c9 Add iam.delete_account_password_policy 2019-11-01 07:07:33 +01:00
gruebel
65fa8f1a1b Add iam.get_account_password_policy 2019-11-01 07:07:32 +01:00
gruebel
06581391bd Add iam.update_account_password_policy 2019-11-01 07:03:27 +01:00
Asher Foa
96e5b1993d Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
Jack Danger
00045ae480
Merge branch 'master' into add-iam-virtual-mfa-device 2019-10-22 14:54:10 -07:00
Chris Murton
f0b22fcd2f Fix absent role deletion, Add more delete_user tests, add no conflict deletion testing 2019-10-22 15:28:59 +01:00
Chris Murton
ccdcb7ca60 Add conflict detection on IAM delete_role and delete_user 2019-10-22 14:27:49 +01:00
gruebel
802fb3baad Connect user with virtual mfa device 2019-10-21 22:51:00 +02:00
gruebel
1d9382b5e5 Add iam.list_virtual_mfa_devices 2019-10-21 21:48:50 +02:00
gruebel
c80135a6db Add iam.delete_virtual_mfa_device 2019-10-20 23:03:20 +02:00
gruebel
9671730f16 Add iam.create_virtual_mfa_device 2019-10-20 22:39:57 +02:00
gruebel
3f3feb5bdb Fix tests 2019-10-19 14:23:35 +02:00
gruebel
cd8027ce9d Add iam.list_open_id_connect_providers 2019-10-18 21:15:48 +02:00
gruebel
f4af9a1d54 Add iam.delete_open_id_connect_provider 2019-10-18 21:15:48 +02:00
gruebel
c492c5c228 Add iam.get_open_id_connect_provider 2019-10-18 21:15:05 +02:00
gruebel
bd627b65f7 Add iam.create_open_id_connect_provider 2019-10-18 21:15:05 +02:00
Bert Blommers
deffefbfb8
PR changes 2019-10-18 09:18:12 +01:00
Bert Blommers
856a06a778 IAM - Delete Policy implementation 2019-10-17 09:28:19 +01:00
Bruno Oliveira
21933052d3 Fix multiple IAM Policy Statement creation with empty sid 2019-09-10 23:43:50 -03:00
Mike Grima
38866bfcef Fixed some IAM APIs for tagging and role descriptions 2019-08-21 13:08:33 -07:00
wndhydrnt
67326ace4f Raise exception if a role policy is not found 2019-07-07 21:46:26 +02:00
Steve Pulec
3bafc89b40
Merge pull request #2268 from acsbendi/policy-version-fixes
IAM policy version fixes
2019-07-06 15:52:10 -05:00
acsbendi
48f0c6f194 Fixed format of access key ID and secret access key. 2019-07-04 20:20:08 +02:00
acsbendi
0bd2c5adb4 Fixed minor errors in test. 2019-07-04 20:12:53 +02:00
acsbendi
ef97e0f28f Extended create_access_key test. 2019-07-04 20:04:27 +02:00
acsbendi
6ac315b903 Fixed broken tests due to policy validation. 2019-07-02 12:24:19 +02:00
Steve Pulec
172e089854
Merge branch 'master' into policy-version-fixes 2019-07-01 20:58:38 -05:00
acsbendi
1bda3f2213 Added tests for valid policy documents. 2019-07-01 18:21:54 +02:00
acsbendi
85efec29b1 Added more tests. 2019-07-01 17:30:59 +02:00
acsbendi
d2b0812edc Added more tests. 2019-06-30 20:33:17 +02:00
acsbendi
e133344846 Implemented validating action prefixes. 2019-06-30 18:48:27 +02:00
acsbendi
55f9040296 Fixed old unit tests in test_iam that didn't use valid IAM policies. 2019-06-30 17:57:50 +02:00
acsbendi
99336cbe6a Reorganized tests using a generator method and fixed error messages. 2019-06-30 17:04:02 +02:00
acsbendi
896f7b6eb2 Added more tests. 2019-06-30 16:36:49 +02:00
acsbendi
a4b850aab9 Added test cases for mutually exclusive elements. 2019-06-30 14:03:18 +02:00
acsbendi
f0e9ea4e72 Created tests for policy documents. 2019-06-30 13:47:17 +02:00
acsbendi
3cd373f1f9 Created failing tests. 2019-06-29 18:15:01 +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
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
Chris Opland
dd898add4d Add test verifying create_role path defaults to / 2019-04-21 18:29:36 -05: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
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
37a765db8d Fix policy date 2019-02-17 17:12:27 -06:00
William Rubel
0e73cddf2f Add test for roles 2019-02-17 16:25:49 -06:00
William Rubel
6e7bd088b3 Add test for roles 2019-02-17 16:04:28 -06:00
William Rubel
31258e9e9e Add test for roles 2019-02-17 15:23:59 -06:00
William Rubel
37cb5ab4e6 Add test for roles 2019-02-17 14:36:53 -06:00