fog-aws 3.9.0 → 3.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +251 -17
- data/README.md +1 -1
- data/fog-aws.gemspec +6 -6
- data/lib/fog/aws/compute.rb +6 -3
- data/lib/fog/aws/credential_fetcher.rb +14 -7
- data/lib/fog/aws/models/compute/security_group.rb +13 -5
- data/lib/fog/aws/models/compute/server.rb +2 -0
- data/lib/fog/aws/models/storage/file.rb +21 -17
- data/lib/fog/aws/parsers/compute/describe_security_groups.rb +18 -4
- data/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +15 -0
- data/lib/fog/aws/requests/compute/create_network_interface.rb +7 -4
- data/lib/fog/aws/requests/compute/create_subnet.rb +3 -3
- data/lib/fog/aws/requests/compute/describe_security_groups.rb +2 -0
- data/lib/fog/aws/requests/compute/run_instances.rb +44 -0
- data/lib/fog/aws/requests/storage/delete_multiple_objects.rb +18 -8
- data/lib/fog/aws/requests/storage/get_object.rb +1 -1
- data/lib/fog/aws/storage.rb +42 -3
- data/lib/fog/aws/version.rb +1 -1
- metadata +11 -297
- data/.gitignore +0 -17
- data/.travis.yml +0 -124
- data/Gemfile +0 -14
- data/Rakefile +0 -14
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/gemfiles/Gemfile-edge +0 -14
- data/gemfiles/Gemfile-ruby-2.0 +0 -7
- data/stale.yml +0 -17
- data/tests/credentials_tests.rb +0 -149
- data/tests/helper.rb +0 -29
- data/tests/helpers/collection_helper.rb +0 -90
- data/tests/helpers/compute/flavors_helper.rb +0 -28
- data/tests/helpers/compute/server_helper.rb +0 -23
- data/tests/helpers/compute/servers_helper.rb +0 -8
- data/tests/helpers/dns_helper.rb +0 -56
- data/tests/helpers/formats_helper.rb +0 -100
- data/tests/helpers/formats_helper_tests.rb +0 -107
- data/tests/helpers/mock_helper.rb +0 -109
- data/tests/helpers/model_helper.rb +0 -30
- data/tests/helpers/responds_to_helper.rb +0 -11
- data/tests/helpers/schema_validator_tests.rb +0 -104
- data/tests/helpers/succeeds_helper.rb +0 -9
- data/tests/lorem.txt +0 -1
- data/tests/models/auto_scaling/activities_tests.rb +0 -6
- data/tests/models/auto_scaling/configuration_test.rb +0 -13
- data/tests/models/auto_scaling/configurations_tests.rb +0 -11
- data/tests/models/auto_scaling/groups_test.rb +0 -27
- data/tests/models/auto_scaling/helper.rb +0 -0
- data/tests/models/auto_scaling/instance_tests.rb +0 -15
- data/tests/models/auto_scaling/instances_tests.rb +0 -6
- data/tests/models/beanstalk/application_tests.rb +0 -69
- data/tests/models/beanstalk/applications_tests.rb +0 -7
- data/tests/models/beanstalk/environment_tests.rb +0 -131
- data/tests/models/beanstalk/environments_tests.rb +0 -34
- data/tests/models/beanstalk/template_tests.rb +0 -47
- data/tests/models/beanstalk/templates_tests.rb +0 -62
- data/tests/models/beanstalk/version_tests.rb +0 -66
- data/tests/models/beanstalk/versions_tests.rb +0 -60
- data/tests/models/cdn/distribution_tests.rb +0 -15
- data/tests/models/cdn/distributions_tests.rb +0 -15
- data/tests/models/cdn/invalidation_tests.rb +0 -31
- data/tests/models/cdn/invalidations_tests.rb +0 -14
- data/tests/models/cdn/streaming_distribution_tests.rb +0 -15
- data/tests/models/cdn/streaming_distributions_tests.rb +0 -15
- data/tests/models/cloud_watch/alarm_data_tests.rb +0 -42
- data/tests/models/cloud_watch/alarm_history_tests.rb +0 -22
- data/tests/models/cloud_watch/metric_statistics_tests.rb +0 -51
- data/tests/models/cloud_watch/metrics_tests.rb +0 -32
- data/tests/models/compute/address_tests.rb +0 -43
- data/tests/models/compute/addresses_tests.rb +0 -5
- data/tests/models/compute/dhcp_option_tests.rb +0 -3
- data/tests/models/compute/dhcp_options_tests.rb +0 -3
- data/tests/models/compute/internet_gateway_tests.rb +0 -3
- data/tests/models/compute/internet_gateways_tests.rb +0 -3
- data/tests/models/compute/key_pair_tests.rb +0 -26
- data/tests/models/compute/key_pairs_tests.rb +0 -5
- data/tests/models/compute/network_acl_tests.rb +0 -109
- data/tests/models/compute/network_acls_tests.rb +0 -20
- data/tests/models/compute/network_interfaces_test.rb +0 -12
- data/tests/models/compute/security_group_tests.rb +0 -98
- data/tests/models/compute/security_groups_tests.rb +0 -5
- data/tests/models/compute/server_tests.rb +0 -94
- data/tests/models/compute/snapshot_tests.rb +0 -10
- data/tests/models/compute/snapshots_tests.rb +0 -10
- data/tests/models/compute/subnet_tests.rb +0 -13
- data/tests/models/compute/subnets_tests.rb +0 -5
- data/tests/models/compute/volume_tests.rb +0 -65
- data/tests/models/compute/volumes_tests.rb +0 -5
- data/tests/models/compute/vpc_tests.rb +0 -26
- data/tests/models/compute/vpcs_tests.rb +0 -19
- data/tests/models/data_pipeline/pipeline_tests.rb +0 -8
- data/tests/models/data_pipeline/pipelines_tests.rb +0 -8
- data/tests/models/dns/record_tests.rb +0 -33
- data/tests/models/dns/records_tests.rb +0 -41
- data/tests/models/dns/zone_tests.rb +0 -4
- data/tests/models/dns/zones_tests.rb +0 -4
- data/tests/models/efs/file_system_tests.rb +0 -12
- data/tests/models/efs/mount_target_tests.rb +0 -45
- data/tests/models/efs/mount_targets_tests.rb +0 -30
- data/tests/models/elasticache/cluster_tests.rb +0 -30
- data/tests/models/elasticache/parameter_groups_tests.rb +0 -15
- data/tests/models/elasticache/security_groups_tests.rb +0 -52
- data/tests/models/elasticache/subnet_groups_tests.rb +0 -43
- data/tests/models/elb/model_tests.rb +0 -360
- data/tests/models/elb/tagging_tests.rb +0 -15
- data/tests/models/glacier/model_tests.rb +0 -47
- data/tests/models/iam/access_keys_tests.rb +0 -53
- data/tests/models/iam/groups_tests.rb +0 -59
- data/tests/models/iam/instance_profile_tests.rb +0 -18
- data/tests/models/iam/managed_policies_tests.rb +0 -89
- data/tests/models/iam/policies_tests.rb +0 -57
- data/tests/models/iam/roles_tests.rb +0 -71
- data/tests/models/iam/users_tests.rb +0 -119
- data/tests/models/rds/cluster_tests.rb +0 -54
- data/tests/models/rds/clusters_tests.rb +0 -5
- data/tests/models/rds/event_subscription_tests.rb +0 -9
- data/tests/models/rds/event_subscriptions_tests.rb +0 -6
- data/tests/models/rds/helper.rb +0 -25
- data/tests/models/rds/instance_option_tests.rb +0 -14
- data/tests/models/rds/parameter_group_tests.rb +0 -24
- data/tests/models/rds/parameter_groups_tests.rb +0 -8
- data/tests/models/rds/security_group_tests.rb +0 -77
- data/tests/models/rds/security_groups_tests.rb +0 -5
- data/tests/models/rds/server_tests.rb +0 -131
- data/tests/models/rds/servers_tests.rb +0 -24
- data/tests/models/rds/snapshot_tests.rb +0 -12
- data/tests/models/rds/snapshots_tests.rb +0 -12
- data/tests/models/rds/tagging_tests.rb +0 -20
- data/tests/models/sns/topic_tests.rb +0 -15
- data/tests/models/sns/topics_tests.rb +0 -6
- data/tests/models/storage/directory_tests.rb +0 -91
- data/tests/models/storage/file_tests.rb +0 -129
- data/tests/models/storage/files_tests.rb +0 -90
- data/tests/models/storage/url_tests.rb +0 -25
- data/tests/models/storage/version_tests.rb +0 -52
- data/tests/models/storage/versions_tests.rb +0 -51
- data/tests/models/support/trusted_advisor_tests.rb +0 -25
- data/tests/parsers/compute/describe_images_tests.rb +0 -33
- data/tests/parsers/elb/describe_load_balancers.rb +0 -65
- data/tests/parsers/elbv2/create_load_balancer_tests.rb +0 -48
- data/tests/parsers/elbv2/describe_listeners_tests.rb +0 -76
- data/tests/parsers/elbv2/describe_load_balancers_tests.rb +0 -54
- data/tests/parsers/elbv2/describe_tags_tests.rb +0 -35
- data/tests/requests/auto_scaling/auto_scaling_tests.rb +0 -111
- data/tests/requests/auto_scaling/describe_types_tests.rb +0 -102
- data/tests/requests/auto_scaling/helper.rb +0 -229
- data/tests/requests/auto_scaling/model_tests.rb +0 -235
- data/tests/requests/auto_scaling/notification_configuration_tests.rb +0 -124
- data/tests/requests/auto_scaling/tag_tests.rb +0 -63
- data/tests/requests/beanstalk/application_tests.rb +0 -140
- data/tests/requests/beanstalk/solution_stack_tests.rb +0 -22
- data/tests/requests/cdn/cdn_tests.rb +0 -252
- data/tests/requests/cloud_formation/stack_tests.rb +0 -167
- data/tests/requests/cloud_watch/get_metric_statistics_tests.rb +0 -28
- data/tests/requests/cloud_watch/list_metrics_test.rb +0 -64
- data/tests/requests/cloud_watch/put_metric_data_tests.rb +0 -36
- data/tests/requests/compute/address_tests.rb +0 -144
- data/tests/requests/compute/assign_private_ip_tests.rb +0 -55
- data/tests/requests/compute/availability_zone_tests.rb +0 -25
- data/tests/requests/compute/client_tests.rb +0 -25
- data/tests/requests/compute/dhcp_options_tests.rb +0 -39
- data/tests/requests/compute/helper.rb +0 -27
- data/tests/requests/compute/image_tests.rb +0 -169
- data/tests/requests/compute/instance_attrib_tests.rb +0 -168
- data/tests/requests/compute/instance_tests.rb +0 -338
- data/tests/requests/compute/internet_gateway_tests.rb +0 -49
- data/tests/requests/compute/key_pair_tests.rb +0 -67
- data/tests/requests/compute/network_acl_tests.rb +0 -112
- data/tests/requests/compute/network_interface_tests.rb +0 -239
- data/tests/requests/compute/placement_group_tests.rb +0 -48
- data/tests/requests/compute/region_tests.rb +0 -52
- data/tests/requests/compute/route_tests.rb +0 -341
- data/tests/requests/compute/security_group_tests.rb +0 -446
- data/tests/requests/compute/snapshot_tests.rb +0 -77
- data/tests/requests/compute/spot_datafeed_subscription_tests.rb +0 -47
- data/tests/requests/compute/spot_instance_tests.rb +0 -55
- data/tests/requests/compute/spot_price_history_tests.rb +0 -23
- data/tests/requests/compute/subnet_tests.rb +0 -87
- data/tests/requests/compute/tag_tests.rb +0 -101
- data/tests/requests/compute/volume_tests.rb +0 -263
- data/tests/requests/compute/vpc_tests.rb +0 -222
- data/tests/requests/data_pipeline/helper.rb +0 -78
- data/tests/requests/data_pipeline/pipeline_tests.rb +0 -80
- data/tests/requests/dns/change_resource_record_sets_tests.rb +0 -34
- data/tests/requests/dns/dns_tests.rb +0 -240
- data/tests/requests/dns/health_check_tests.rb +0 -159
- data/tests/requests/dns/helper.rb +0 -21
- data/tests/requests/dynamodb/item_tests.rb +0 -137
- data/tests/requests/dynamodb/table_tests.rb +0 -99
- data/tests/requests/ecs/cluster_tests.rb +0 -112
- data/tests/requests/ecs/container_instance_tests.rb +0 -119
- data/tests/requests/ecs/helper.rb +0 -276
- data/tests/requests/ecs/sample_task_definition1.json +0 -56
- data/tests/requests/ecs/service_tests.rb +0 -132
- data/tests/requests/ecs/task_definitions_tests.rb +0 -97
- data/tests/requests/ecs/task_tests.rb +0 -145
- data/tests/requests/efs/file_system_tests.rb +0 -152
- data/tests/requests/efs/helper.rb +0 -44
- data/tests/requests/elasticache/cache_cluster_tests.rb +0 -137
- data/tests/requests/elasticache/describe_events.rb +0 -17
- data/tests/requests/elasticache/describe_reserved_cache_nodes.rb +0 -17
- data/tests/requests/elasticache/helper.rb +0 -103
- data/tests/requests/elasticache/parameter_group_tests.rb +0 -105
- data/tests/requests/elasticache/security_group_tests.rb +0 -108
- data/tests/requests/elasticache/subnet_group_tests.rb +0 -52
- data/tests/requests/elb/helper.rb +0 -91
- data/tests/requests/elb/listener_tests.rb +0 -68
- data/tests/requests/elb/load_balancer_tests.rb +0 -89
- data/tests/requests/elb/policy_tests.rb +0 -132
- data/tests/requests/elbv2/helper.rb +0 -66
- data/tests/requests/elbv2/load_balancer_tests.rb +0 -50
- data/tests/requests/emr/helper.rb +0 -167
- data/tests/requests/emr/instance_group_tests.rb +0 -106
- data/tests/requests/emr/job_flow_tests.rb +0 -88
- data/tests/requests/federation/get_signin_token_tests.rb +0 -11
- data/tests/requests/glacier/archive_tests.rb +0 -13
- data/tests/requests/glacier/multipart_upload_tests.rb +0 -29
- data/tests/requests/glacier/tree_hash_tests.rb +0 -91
- data/tests/requests/glacier/vault_tests.rb +0 -35
- data/tests/requests/iam/access_key_tests.rb +0 -53
- data/tests/requests/iam/account_policy_tests.rb +0 -20
- data/tests/requests/iam/account_tests.rb +0 -34
- data/tests/requests/iam/group_policy_tests.rb +0 -48
- data/tests/requests/iam/group_tests.rb +0 -44
- data/tests/requests/iam/helper.rb +0 -154
- data/tests/requests/iam/instance_profile_tests.rb +0 -44
- data/tests/requests/iam/login_profile_tests.rb +0 -62
- data/tests/requests/iam/managed_policy_tests.rb +0 -110
- data/tests/requests/iam/mfa_tests.rb +0 -23
- data/tests/requests/iam/role_tests.rb +0 -156
- data/tests/requests/iam/server_certificate_tests.rb +0 -130
- data/tests/requests/iam/user_policy_tests.rb +0 -45
- data/tests/requests/iam/user_tests.rb +0 -78
- data/tests/requests/iam/versioned_managed_policy_tests.rb +0 -105
- data/tests/requests/kinesis/helper.rb +0 -111
- data/tests/requests/kinesis/stream_tests.rb +0 -169
- data/tests/requests/kms/helper.rb +0 -27
- data/tests/requests/kms/key_tests.rb +0 -23
- data/tests/requests/lambda/function_sample_1.js +0 -9
- data/tests/requests/lambda/function_sample_2.js +0 -9
- data/tests/requests/lambda/function_tests.rb +0 -460
- data/tests/requests/lambda/helper.rb +0 -81
- data/tests/requests/rds/cluster_snapshot_tests.rb +0 -43
- data/tests/requests/rds/cluster_tests.rb +0 -37
- data/tests/requests/rds/db_engine_versions.rb +0 -7
- data/tests/requests/rds/db_snapshot_tests.rb +0 -62
- data/tests/requests/rds/describe_events.rb +0 -16
- data/tests/requests/rds/event_subscription_tests.rb +0 -30
- data/tests/requests/rds/helper.rb +0 -406
- data/tests/requests/rds/instance_option_tests.rb +0 -27
- data/tests/requests/rds/instance_tests.rb +0 -149
- data/tests/requests/rds/log_file_tests.rb +0 -19
- data/tests/requests/rds/parameter_group_tests.rb +0 -62
- data/tests/requests/rds/parameter_request_tests.rb +0 -32
- data/tests/requests/rds/security_group_tests.rb +0 -101
- data/tests/requests/rds/subnet_groups_tests.rb +0 -52
- data/tests/requests/rds/tagging_tests.rb +0 -78
- data/tests/requests/redshift/cluster_parameter_group_tests.rb +0 -76
- data/tests/requests/redshift/cluster_security_group_tests.rb +0 -42
- data/tests/requests/redshift/cluster_snapshot_tests.rb +0 -73
- data/tests/requests/redshift/cluster_tests.rb +0 -80
- data/tests/requests/ses/helper.rb +0 -9
- data/tests/requests/ses/verified_domain_identity_tests.rb +0 -16
- data/tests/requests/ses/verified_email_address_tests.rb +0 -27
- data/tests/requests/simpledb/attributes_tests.rb +0 -86
- data/tests/requests/simpledb/domain_tests.rb +0 -51
- data/tests/requests/simpledb/helper.rb +0 -10
- data/tests/requests/sns/helper.rb +0 -9
- data/tests/requests/sns/subscription_tests.rb +0 -86
- data/tests/requests/sns/topic_tests.rb +0 -53
- data/tests/requests/sqs/helper.rb +0 -9
- data/tests/requests/sqs/message_tests.rb +0 -51
- data/tests/requests/sqs/queue_tests.rb +0 -50
- data/tests/requests/storage/acl_utils_tests.rb +0 -209
- data/tests/requests/storage/bucket_tests.rb +0 -416
- data/tests/requests/storage/cors_utils_tests.rb +0 -108
- data/tests/requests/storage/delete_multiple_objects_tests.rb +0 -12
- data/tests/requests/storage/multipart_copy_tests.rb +0 -93
- data/tests/requests/storage/multipart_upload_tests.rb +0 -121
- data/tests/requests/storage/object_tests.rb +0 -269
- data/tests/requests/storage/versioning_tests.rb +0 -262
- data/tests/requests/sts/assume_role_tests.rb +0 -19
- data/tests/requests/sts/assume_role_with_saml_tests.rb +0 -18
- data/tests/requests/sts/assume_role_with_web_identity_tests.rb +0 -28
- data/tests/requests/sts/get_federation_token_tests.rb +0 -20
- data/tests/requests/sts/session_token_tests.rb +0 -16
- data/tests/requests/support/helper.rb +0 -43
- data/tests/requests/support/trusted_advisor_check_tests.rb +0 -16
- data/tests/signaturev4_tests.rb +0 -106
- data/tests/signed_params_tests.rb +0 -17
- data/tests/storage_tests.rb +0 -7
@@ -1,53 +0,0 @@
|
|
1
|
-
Shindo.tests('AWS::IAM | access key requests', ['aws']) do
|
2
|
-
|
3
|
-
Fog::AWS[:iam].create_user('fog_access_key_tests')
|
4
|
-
|
5
|
-
tests('success') do
|
6
|
-
|
7
|
-
@access_key_format = {
|
8
|
-
'AccessKey' => {
|
9
|
-
'AccessKeyId' => String,
|
10
|
-
'UserName' => String,
|
11
|
-
'SecretAccessKey' => String,
|
12
|
-
'Status' => String
|
13
|
-
},
|
14
|
-
'RequestId' => String
|
15
|
-
}
|
16
|
-
|
17
|
-
tests("#create_access_key('UserName' => 'fog_access_key_tests')").formats(@access_key_format) do
|
18
|
-
data = Fog::AWS[:iam].create_access_key('UserName' => 'fog_access_key_tests').body
|
19
|
-
@access_key_id = data['AccessKey']['AccessKeyId']
|
20
|
-
data
|
21
|
-
end
|
22
|
-
|
23
|
-
@access_keys_format = {
|
24
|
-
'AccessKeys' => [{
|
25
|
-
'AccessKeyId' => String,
|
26
|
-
'Status' => String
|
27
|
-
}],
|
28
|
-
'IsTruncated' => Fog::Boolean,
|
29
|
-
'RequestId' => String
|
30
|
-
}
|
31
|
-
|
32
|
-
tests("#list_access_keys('Username' => 'fog_access_key_tests')").formats(@access_keys_format) do
|
33
|
-
Fog::AWS[:iam].list_access_keys('UserName' => 'fog_access_key_tests').body
|
34
|
-
end
|
35
|
-
|
36
|
-
tests("#update_access_key('#{@access_key_id}', 'Inactive', 'UserName' => 'fog_access_key_tests')").formats(AWS::IAM::Formats::BASIC) do
|
37
|
-
pending if Fog.mocking?
|
38
|
-
Fog::AWS[:iam].update_access_key(@access_key_id, 'Inactive', 'UserName' => 'fog_access_key_tests').body
|
39
|
-
end
|
40
|
-
|
41
|
-
tests("#delete_access_key('#{@access_key_id}', 'UserName' => 'fog_access_key_tests)").formats(AWS::IAM::Formats::BASIC) do
|
42
|
-
Fog::AWS[:iam].delete_access_key(@access_key_id, 'UserName' => 'fog_access_key_tests').body
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
tests('failure') do
|
48
|
-
test('failing conditions')
|
49
|
-
end
|
50
|
-
|
51
|
-
Fog::AWS[:iam].delete_user('fog_access_key_tests')
|
52
|
-
|
53
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Shindo.tests('AWS::IAM | account policy requests', ['aws']) do
|
2
|
-
|
3
|
-
tests('success') do
|
4
|
-
tests("#update_account_password_policy(minimum_password_length, max_password_age, password_reuse_prevention,require_symbols,require_numbers,require_uppercase_characters, require_lowercase_characters,allow_users_to_change_password, hard_expiry, expire_passwords)").formats(AWS::IAM::Formats::BASIC) do
|
5
|
-
minimum_password_length, password_reuse_prevention, max_password_age = 5
|
6
|
-
require_symbols, require_numbers, require_uppercase_characters, require_lowercase_characters, allow_users_to_change_password, hard_expiry, expire_passwords = false
|
7
|
-
|
8
|
-
Fog::AWS[:iam].update_account_password_policy(minimum_password_length, max_password_age, password_reuse_prevention,require_symbols,require_numbers,require_uppercase_characters, require_lowercase_characters,allow_users_to_change_password, hard_expiry, expire_passwords).body
|
9
|
-
end
|
10
|
-
|
11
|
-
tests("#get_account_password_policy()") do
|
12
|
-
Fog::AWS[:iam].get_account_password_policy().body['AccountPasswordPolicy']
|
13
|
-
end
|
14
|
-
|
15
|
-
tests("#delete_account_password_policy()").formats(AWS::IAM::Formats::BASIC) do
|
16
|
-
|
17
|
-
Fog::AWS[:iam].delete_account_password_policy().body
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
Shindo.tests('AWS::IAM | account requests', ['aws']) do
|
2
|
-
tests('success') do
|
3
|
-
@get_account_summary_format = {
|
4
|
-
'Summary' => {
|
5
|
-
'AccessKeysPerUserQuota' => Integer,
|
6
|
-
'AccountMFAEnabled' => Integer,
|
7
|
-
'AssumeRolePolicySizeQuota' => Fog::Nullable::Integer,
|
8
|
-
'GroupPolicySizeQuota' => Integer,
|
9
|
-
'Groups' => Integer,
|
10
|
-
'GroupsPerUserQuota' => Integer,
|
11
|
-
'GroupsQuota' => Integer,
|
12
|
-
'InstanceProfiles' => Fog::Nullable::Integer,
|
13
|
-
'InstanceProfilesQuota' => Fog::Nullable::Integer,
|
14
|
-
'MFADevices' => Integer,
|
15
|
-
'MFADevicesInUse' => Integer,
|
16
|
-
'Providers' => Fog::Nullable::Integer,
|
17
|
-
'RolePolicySizeQuota' => Fog::Nullable::Integer,
|
18
|
-
'Roles' => Fog::Nullable::Integer,
|
19
|
-
'RolesQuota' => Fog::Nullable::Integer,
|
20
|
-
'ServerCertificates' => Integer,
|
21
|
-
'ServerCertificatesQuota' => Integer,
|
22
|
-
'SigningCertificatesPerUserQuota' => Integer,
|
23
|
-
'UserPolicySizeQuota' => Integer,
|
24
|
-
'Users' => Integer,
|
25
|
-
'UsersQuota' => Integer,
|
26
|
-
},
|
27
|
-
'RequestId' => String,
|
28
|
-
}
|
29
|
-
|
30
|
-
tests('#get_account_summary').formats(@get_account_summary_format) do
|
31
|
-
Fog::AWS[:iam].get_account_summary.body
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
Shindo.tests('AWS::IAM | group policy requests', ['aws']) do
|
2
|
-
|
3
|
-
Fog::AWS[:iam].create_group('fog_group_policy_tests')
|
4
|
-
|
5
|
-
tests('success') do
|
6
|
-
|
7
|
-
@policy = {"Statement" => [{"Effect" => "Allow", "Action" => "*", "Resource" => "*"}]}
|
8
|
-
|
9
|
-
tests("#put_group_policy('fog_group_policy_tests', 'fog_policy', #{@policy.inspect})").formats(AWS::IAM::Formats::BASIC) do
|
10
|
-
Fog::AWS[:iam].put_group_policy('fog_group_policy_tests', 'fog_policy', @policy).body
|
11
|
-
end
|
12
|
-
|
13
|
-
@group_policies_format = {
|
14
|
-
'IsTruncated' => Fog::Boolean,
|
15
|
-
'PolicyNames' => [String],
|
16
|
-
'RequestId' => String
|
17
|
-
}
|
18
|
-
|
19
|
-
tests("list_group_policies('fog_group_policy_tests')").formats(@group_policies_format) do
|
20
|
-
pending if Fog.mocking?
|
21
|
-
Fog::AWS[:iam].list_group_policies('fog_group_policy_tests').body
|
22
|
-
end
|
23
|
-
|
24
|
-
@group_policy_format = {
|
25
|
-
'GroupName' => String,
|
26
|
-
'PolicyName' => String,
|
27
|
-
'PolicyDocument' => Hash,
|
28
|
-
}
|
29
|
-
|
30
|
-
tests("#get_group_policy('fog_group_policy_tests', 'fog_policy'").formats(@group_policy_format) do
|
31
|
-
Fog::AWS[:iam].get_group_policy('fog_policy', 'fog_group_policy_tests').body['Policy']
|
32
|
-
end
|
33
|
-
|
34
|
-
tests("#delete_group_policy('fog_group_policy_tests', 'fog_policy')").formats(AWS::IAM::Formats::BASIC) do
|
35
|
-
pending if Fog.mocking?
|
36
|
-
Fog::AWS[:iam].delete_group_policy('fog_group_policy_tests', 'fog_policy').body
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
tests('failure') do
|
41
|
-
test('failing conditions')
|
42
|
-
end
|
43
|
-
|
44
|
-
unless Fog.mocking?
|
45
|
-
Fog::AWS[:iam].delete_group('fog_group_policy_tests')
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
Shindo.tests('AWS::IAM | group requests', ['aws']) do
|
2
|
-
|
3
|
-
tests('success') do
|
4
|
-
|
5
|
-
@group_format = {
|
6
|
-
'Group' => {
|
7
|
-
'Arn' => String,
|
8
|
-
'GroupId' => String,
|
9
|
-
'GroupName' => String,
|
10
|
-
'Path' => String
|
11
|
-
},
|
12
|
-
'RequestId' => String
|
13
|
-
}
|
14
|
-
|
15
|
-
tests("#create_group('fog_group')").formats(@group_format) do
|
16
|
-
Fog::AWS[:iam].create_group('fog_group').body
|
17
|
-
end
|
18
|
-
|
19
|
-
@groups_format = {
|
20
|
-
'Groups' => [{
|
21
|
-
'Arn' => String,
|
22
|
-
'GroupId' => String,
|
23
|
-
'GroupName' => String,
|
24
|
-
'Path' => String
|
25
|
-
}],
|
26
|
-
'IsTruncated' => Fog::Boolean,
|
27
|
-
'RequestId' => String
|
28
|
-
}
|
29
|
-
|
30
|
-
tests("#list_groups").formats(@groups_format) do
|
31
|
-
Fog::AWS[:iam].list_groups.body
|
32
|
-
end
|
33
|
-
|
34
|
-
tests("#delete_group('fog_group')").formats(AWS::IAM::Formats::BASIC) do
|
35
|
-
Fog::AWS[:iam].delete_group('fog_group').body
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
tests('failure') do
|
41
|
-
test('failing conditions')
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
@@ -1,154 +0,0 @@
|
|
1
|
-
class AWS
|
2
|
-
module IAM
|
3
|
-
# A self-signed test keypair. Generated using the command:
|
4
|
-
# openssl req -new -newkey rsa:1024 -days 3650 -nodes -x509 -keyout server-private.key -out server-public.crt
|
5
|
-
# NB: Amazon returns an error on extraneous linebreaks
|
6
|
-
SERVER_CERT = %{-----BEGIN CERTIFICATE-----
|
7
|
-
MIIDQzCCAqygAwIBAgIJAJaZ8wH+19AtMA0GCSqGSIb3DQEBBQUAMHUxCzAJBgNV
|
8
|
-
BAYTAlVTMREwDwYDVQQIEwhOZXcgWW9yazERMA8GA1UEBxMITmV3IFlvcmsxHzAd
|
9
|
-
BgNVBAoTFkZvZyBUZXN0IFNuYWtlb2lsIENlcnQxHzAdBgNVBAsTFkZvZyBUZXN0
|
10
|
-
IFNuYWtlb2lsIENlcnQwHhcNMTEwNTA3MTc0MDU5WhcNMjEwNTA0MTc0MDU5WjB1
|
11
|
-
MQswCQYDVQQGEwJVUzERMA8GA1UECBMITmV3IFlvcmsxETAPBgNVBAcTCE5ldyBZ
|
12
|
-
b3JrMR8wHQYDVQQKExZGb2cgVGVzdCBTbmFrZW9pbCBDZXJ0MR8wHQYDVQQLExZG
|
13
|
-
b2cgVGVzdCBTbmFrZW9pbCBDZXJ0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
|
14
|
-
gQC0CR76sovjdmpWRmEaf8XaG+nGe7czhpdLKkau2b16VtSjkPctxPL5U4vaMxQU
|
15
|
-
boLPr+9oL+9fSYN31VzDD4hyaeGoeI5fhnGeqk71kq5uHONBOQUMbZbBQ8PVd9Sd
|
16
|
-
k+y9JJ6E5fC+GhLL5I+y2DK7syBzyymq1Wi6rPp1XXF7AQIDAQABo4HaMIHXMB0G
|
17
|
-
A1UdDgQWBBRfqBkpU/jEV324748fq6GJM80iVTCBpwYDVR0jBIGfMIGcgBRfqBkp
|
18
|
-
U/jEV324748fq6GJM80iVaF5pHcwdTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE5l
|
19
|
-
dyBZb3JrMREwDwYDVQQHEwhOZXcgWW9yazEfMB0GA1UEChMWRm9nIFRlc3QgU25h
|
20
|
-
a2VvaWwgQ2VydDEfMB0GA1UECxMWRm9nIFRlc3QgU25ha2VvaWwgQ2VydIIJAJaZ
|
21
|
-
8wH+19AtMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAUV6NDdLHKNhl
|
22
|
-
ACtzLycIhlMTmDr0xBeIBx3lpgw2K0+4oefMS8Z17eeZPeNodxnz56juJm81BZwt
|
23
|
-
DF3qnnPyArLFx0HLB7wQdm9xYVIqQuLO+V6GRuOd+uSX//aDLDZhwbERf35hoyto
|
24
|
-
Jfk4gX/qwuRFNy0vjQeTzdvhB1igG/w=
|
25
|
-
-----END CERTIFICATE-----
|
26
|
-
}
|
27
|
-
# The public key for SERVER_CERT. Generated using the command:
|
28
|
-
# openssl x509 -inform pem -in server-public.crt -pubkey -noout > server.pubkey
|
29
|
-
SERVER_CERT_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC0CR76sovjdmpWRmEaf8XaG+nGe7czhpdLKkau2b16VtSjkPctxPL5U4vaMxQUboLPr+9oL+9fSYN31VzDD4hyaeGoeI5fhnGeqk71kq5uHONBOQUMbZbBQ8PVd9Sdk+y9JJ6E5fC+GhLL5I+y2DK7syBzyymq1Wi6rPp1XXF7AQIDAQAB"
|
30
|
-
|
31
|
-
SERVER_CERT_PRIVATE_KEY = %{-----BEGIN RSA PRIVATE KEY-----
|
32
|
-
MIICXAIBAAKBgQC0CR76sovjdmpWRmEaf8XaG+nGe7czhpdLKkau2b16VtSjkPct
|
33
|
-
xPL5U4vaMxQUboLPr+9oL+9fSYN31VzDD4hyaeGoeI5fhnGeqk71kq5uHONBOQUM
|
34
|
-
bZbBQ8PVd9Sdk+y9JJ6E5fC+GhLL5I+y2DK7syBzyymq1Wi6rPp1XXF7AQIDAQAB
|
35
|
-
AoGANjjRBbwkeXs+h4Fm2W5GDmx9ufOkt3X/tvmilCKr+F6SaDjO2RAKBaFt62ea
|
36
|
-
0pR9/UMFnaFiPJaNa9fsuirBcwId+RizruEp+7FGziM9mC5kcE7WKZrXgGGnLtqg
|
37
|
-
4x5twVLArgp0ji7TA18q/74uTrI4az8H5iTY4n29ORlLmmkCQQDsGMuLEgGHgN5Y
|
38
|
-
1c9ax1DT/rUXKxnqsIrijRkgbiTncHAArFJ88c3yykWqGvYnSFwMS8DSWiPyPaAI
|
39
|
-
nNNlb/fPAkEAwzZ4CfvJ+OlE++rTPH9jemC89dnxC7EFGuWJmwdadnev8EYguvve
|
40
|
-
cdGdGttD7QsZKpcz5mDngOUghbVm8vBELwJAMHfOoVgq9DRicP5DuTEdyMeLSZxR
|
41
|
-
j7p6aJPqypuR++k7NQgrTvcc/nDD6G3shpf2PZf3l7dllb9M8TewtixMRQJBAIdX
|
42
|
-
c0AQtoYBTJePxiYyd8i32ypkkK83ar+sFoxKO9jYwD1IkZax2xZ0aoTdMindQPR7
|
43
|
-
Yjs+QiLmOHcbPqX+GHcCQERsSn0RjzKmKirDntseMB59BB/cEN32+gMDVsZuCfb+
|
44
|
-
fOy2ZavFl13afnhbh2/AjKeDhnb19x/uXjF7JCUtwpA=
|
45
|
-
-----END RSA PRIVATE KEY-----
|
46
|
-
}
|
47
|
-
|
48
|
-
# openssl pkcs8 -nocrypt -topk8 -in SERVER_CERT_PRIVATE_KEY.key -outform pem
|
49
|
-
SERVER_CERT_PRIVATE_KEY_PKCS8 = %{-----BEGIN PRIVATE KEY-----
|
50
|
-
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALQJHvqyi+N2alZG
|
51
|
-
YRp/xdob6cZ7tzOGl0sqRq7ZvXpW1KOQ9y3E8vlTi9ozFBRugs+v72gv719Jg3fV
|
52
|
-
XMMPiHJp4ah4jl+GcZ6qTvWSrm4c40E5BQxtlsFDw9V31J2T7L0knoTl8L4aEsvk
|
53
|
-
j7LYMruzIHPLKarVaLqs+nVdcXsBAgMBAAECgYA2ONEFvCR5ez6HgWbZbkYObH25
|
54
|
-
86S3df+2+aKUIqv4XpJoOM7ZEAoFoW3rZ5rSlH39QwWdoWI8lo1r1+y6KsFzAh35
|
55
|
-
GLOu4Sn7sUbOIz2YLmRwTtYpmteAYacu2qDjHm3BUsCuCnSOLtMDXyr/vi5Osjhr
|
56
|
-
PwfmJNjifb05GUuaaQJBAOwYy4sSAYeA3ljVz1rHUNP+tRcrGeqwiuKNGSBuJOdw
|
57
|
-
cACsUnzxzfLKRaoa9idIXAxLwNJaI/I9oAic02Vv988CQQDDNngJ+8n46UT76tM8
|
58
|
-
f2N6YLz12fELsQUa5YmbB1p2d6/wRiC6+95x0Z0a20PtCxkqlzPmYOeA5SCFtWby
|
59
|
-
8EQvAkAwd86hWCr0NGJw/kO5MR3Ix4tJnFGPunpok+rKm5H76Ts1CCtO9xz+cMPo
|
60
|
-
beyGl/Y9l/eXt2WVv0zxN7C2LExFAkEAh1dzQBC2hgFMl4/GJjJ3yLfbKmSQrzdq
|
61
|
-
v6wWjEo72NjAPUiRlrHbFnRqhN0yKd1A9HtiOz5CIuY4dxs+pf4YdwJARGxKfRGP
|
62
|
-
MqYqKsOe2x4wHn0EH9wQ3fb6AwNWxm4J9v587LZlq8WXXdp+eFuHb8CMp4OGdvX3
|
63
|
-
H+5eMXskJS3CkA==
|
64
|
-
-----END PRIVATE KEY-----
|
65
|
-
}
|
66
|
-
|
67
|
-
SERVER_CERT_PRIVATE_KEY_MISMATCHED = %{-----BEGIN RSA PRIVATE KEY-----
|
68
|
-
MIIEowIBAAKCAQEAyITMqYJMzkPMcaC+x0W2hnZVW99RXzLR8RYyD3xo2AotdJKx
|
69
|
-
1DXR4ryegAjsnAhJVwVtxqzPcBMq/XS0hNtWFfKzf+vMZl7uAqotGjURUV8SRQPA
|
70
|
-
8tT07MemD929xRSV2vTnVATiPn87vcu5igsZ01+Ewd6rGythmvcZD13vtZ4rx0c8
|
71
|
-
kQJV3ok/CkFaIgDR6Or1NZBCtcIVK9nvqAmYMp6S5mWUMIsl/1qYPerpefrSJjlk
|
72
|
-
J2+jyLp0LHarbzjkzzAdOkBRX1hPkk6cisBeQIpx35shLzfCe8U25XNqquP+ftcu
|
73
|
-
JZ0Wjw+C4pTIzfgdGXmGGtBFY13BwiJvd4/i2wIDAQABAoIBABk8XWWX+IKdFcXX
|
74
|
-
LSt3IpmZmvSNDniktLday8IXLjrCTSY2sBq9C0U159zFQsIAaPqCvGYcqZ65StfL
|
75
|
-
MEzoLdVlTiHzUy4vFFVRhYue0icjh/EXn9jv5ENIfSXSCmgbRyDfYZ25X5/t817X
|
76
|
-
nOo6q21mwBaGJ5KrywTtxEGi2OBKZrIbBrpJLhCXJc5xfuKT6DRa9X/OBSBiGKJP
|
77
|
-
V9wHcZJkPG1HnC8izvQ37kNN/NyYE+8AGdYXQVNbTHq/emNLbEbdcR3tpGZamM9Q
|
78
|
-
TwG5WsDPAnXnRsEEYvlVTOBI6DqdvkyBxM35iqd5aAc6i/Iu04Unfhhc5pAXmmIB
|
79
|
-
a22GHcECgYEA7OheVHDDP8quO2qZjqaTlMbMnXnrFXJ41llFMoivTW9EmlTl9dOC
|
80
|
-
fnkHEBcFCTPV0m6S2AQjt9QOgPqCFAq1r3J/xvEGBtl/UKnPRmjqXFgl0ENtGn5t
|
81
|
-
w9wj/CsOPD05KkXXtXP+MyLPRD6gAxiQCTnXjvsLuVfP+E9BO2EQXScCgYEA2K2x
|
82
|
-
QtcAAalrk3c0KzNVESzyFlf3ddEXThShVblSa7r6Ka9q9sxN/Xe2B+1oemPJm26G
|
83
|
-
PfqKgxdKX0R0jl4f5pRBWKoarzWtUge/su8rx/xzbY/1hFKVuimtc6oTeU5xsOTS
|
84
|
-
PVuCz4bxDTVhrbmKqbmMgqy17jfPA4BrF1FMRS0CgYBdMA4i4vQ6fIxKfOUIMsfs
|
85
|
-
hsJn01RAbHXRwu2wMgnayMDQgEKwjtFO1GaN0rA9bXFXQ/1pET/HiJdn7qIKJihP
|
86
|
-
aheO9rHrMdSdsx4AUTaWummtYUhiWobsuwRApeMEmQSKd0yhaI3+KVwkOQoSDbBi
|
87
|
-
oKkE6gUzk7IPt4UuSUD5kwKBgQCjo/IGr8dieegz08gDhF4PfalLdJ4ATaxTHMOH
|
88
|
-
sVFs6SY7Sy72Ou//qGRCcmsAW9KL35nkvw3S2Ukiz9lTGATxqC/93WIPxvMhy5Zc
|
89
|
-
dcLT43XtXdanW5OWqBlGDEFu0O6OERIyoqUVRC1Ss2kUwdbWPbq/id5Qjbd7RoYa
|
90
|
-
cxyt9QKBgF4bFLw1Iw2RBngQxIzoDbElEqme20FUyGGzyFQtxVwmwNr4OY5UzJzX
|
91
|
-
7G6diyzGrvRX81Yw616ppKJUJVr/zRc13K+eRXXKtNpGkf35B+1NDDjjWZpIHqgx
|
92
|
-
Xb9WSr07saxZQbxBPQyTlb0Q9Tu2djAq2/o/nYD1/50/fXUTuWMB
|
93
|
-
-----END RSA PRIVATE KEY-----
|
94
|
-
}
|
95
|
-
|
96
|
-
module Formats
|
97
|
-
BASIC = {
|
98
|
-
'RequestId' => String
|
99
|
-
}
|
100
|
-
|
101
|
-
USER = {
|
102
|
-
'Arn' => String,
|
103
|
-
'Path' => String,
|
104
|
-
'UserId' => String,
|
105
|
-
'UserName' => String,
|
106
|
-
}
|
107
|
-
|
108
|
-
CREATE_USER = BASIC.merge('User' => USER)
|
109
|
-
|
110
|
-
GET_USER = BASIC.merge('User' => USER.merge('CreateDate' => Time))
|
111
|
-
|
112
|
-
GET_CURRENT_USER = BASIC.merge(
|
113
|
-
'User' => {
|
114
|
-
'Arn' => String,
|
115
|
-
'UserId' => String,
|
116
|
-
'CreateDate' => Time
|
117
|
-
}
|
118
|
-
)
|
119
|
-
|
120
|
-
LIST_USER = BASIC.merge(
|
121
|
-
'Users' => [USER.merge('CreateDate' => Time)],
|
122
|
-
'IsTruncated' => Fog::Boolean
|
123
|
-
)
|
124
|
-
|
125
|
-
GROUPS = BASIC.merge(
|
126
|
-
'GroupsForUser' => [{
|
127
|
-
'Arn' => String,
|
128
|
-
'GroupId' => String,
|
129
|
-
'GroupName' => String,
|
130
|
-
'Path' => String
|
131
|
-
}],
|
132
|
-
'IsTruncated' => Fog::Boolean
|
133
|
-
)
|
134
|
-
|
135
|
-
INSTANCE_PROFILE = {
|
136
|
-
'Arn' => String,
|
137
|
-
'CreateDate' => Time,
|
138
|
-
'InstanceProfileId' => String,
|
139
|
-
'InstanceProfileName' => String,
|
140
|
-
'Path' => String,
|
141
|
-
'Roles' => Array
|
142
|
-
}
|
143
|
-
|
144
|
-
INSTANCE_PROFILE_RESULT = BASIC.merge(
|
145
|
-
'InstanceProfile' => INSTANCE_PROFILE
|
146
|
-
)
|
147
|
-
|
148
|
-
LIST_INSTANCE_PROFILE_RESULT = BASIC.merge(
|
149
|
-
"IsTruncated" => Fog::Boolean,
|
150
|
-
"InstanceProfiles" => [INSTANCE_PROFILE]
|
151
|
-
)
|
152
|
-
end
|
153
|
-
end
|
154
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
include AWS::IAM::Formats
|
2
|
-
|
3
|
-
Shindo.tests("AWS::IAM | instance profile requests", ['aws']) do
|
4
|
-
tests('success') do
|
5
|
-
profile_name = uniq_id('fog-instance-profile')
|
6
|
-
@instance_profile_count = Fog::AWS[:iam].list_instance_profiles.body["InstanceProfiles"].count
|
7
|
-
|
8
|
-
tests("#create_instance_profile('#{profile_name}')").formats(INSTANCE_PROFILE_RESULT) do
|
9
|
-
Fog::AWS[:iam].create_instance_profile(profile_name).body
|
10
|
-
end
|
11
|
-
|
12
|
-
tests("#list_instance_profiles").formats(LIST_INSTANCE_PROFILE_RESULT) do
|
13
|
-
body = Fog::AWS[:iam].list_instance_profiles.body
|
14
|
-
returns(@instance_profile_count + 1) { body["InstanceProfiles"].count }
|
15
|
-
body
|
16
|
-
end
|
17
|
-
|
18
|
-
tests("#get_instance_profile('#{profile_name}')").formats(INSTANCE_PROFILE_RESULT) do
|
19
|
-
Fog::AWS[:iam].get_instance_profile(profile_name).body
|
20
|
-
end
|
21
|
-
|
22
|
-
@role = Fog::AWS[:iam].roles.create(:rolename => uniq_id('instance-profile-role'))
|
23
|
-
|
24
|
-
tests("#add_role_to_instance_profile('#{@role.rolename}', '#{profile_name}')").formats(BASIC) do
|
25
|
-
Fog::AWS[:iam].add_role_to_instance_profile(@role.rolename, profile_name).body
|
26
|
-
end
|
27
|
-
|
28
|
-
tests("#list_instance_profiles_for_role('#{@role.rolename}')").formats(LIST_INSTANCE_PROFILE_RESULT) do
|
29
|
-
body = Fog::AWS[:iam].list_instance_profiles_for_role(@role.rolename).body
|
30
|
-
returns(1) { body["InstanceProfiles"].count }
|
31
|
-
body
|
32
|
-
end
|
33
|
-
|
34
|
-
tests("#remove_role_from_instance_profile('#{@role.rolename}', '#{profile_name}')").formats(BASIC) do
|
35
|
-
Fog::AWS[:iam].remove_role_from_instance_profile(@role.rolename, profile_name).body
|
36
|
-
end
|
37
|
-
|
38
|
-
@role.destroy
|
39
|
-
|
40
|
-
tests("#delete_instance_profile('#{profile_name}')").formats(BASIC) do
|
41
|
-
Fog::AWS[:iam].delete_instance_profile(profile_name).body
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
Shindo.tests('AWS::IAM | user requests', ['aws']) do
|
2
|
-
|
3
|
-
unless Fog.mocking?
|
4
|
-
Fog::AWS[:iam].create_user('fog_user')
|
5
|
-
end
|
6
|
-
|
7
|
-
tests('success') do
|
8
|
-
@login_profile_format = {
|
9
|
-
'LoginProfile' => {
|
10
|
-
'UserName' => String,
|
11
|
-
'CreateDate' => Time
|
12
|
-
|
13
|
-
},
|
14
|
-
'RequestId' => String
|
15
|
-
}
|
16
|
-
|
17
|
-
tests("#create_login_profile('fog_user')").formats(@login_profile_format) do
|
18
|
-
pending if Fog.mocking?
|
19
|
-
Fog::AWS[:iam].create_login_profile('fog_user', 'somepassword').body
|
20
|
-
end
|
21
|
-
|
22
|
-
tests("#get_login_profile('fog_user')").formats(@login_profile_format) do
|
23
|
-
pending if Fog.mocking?
|
24
|
-
result = Fog::AWS[:iam].get_login_profile('fog_user').body
|
25
|
-
returns('fog_user') {result['LoginProfile']['UserName']}
|
26
|
-
result
|
27
|
-
end
|
28
|
-
|
29
|
-
tests("#update_login_profile('fog_user')").formats(AWS::IAM::Formats::BASIC) do
|
30
|
-
pending if Fog.mocking?
|
31
|
-
begin
|
32
|
-
Fog::AWS[:iam].update_login_profile('fog_user', 'otherpassword').body
|
33
|
-
rescue Excon::Errors::Conflict #profile cannot be updated or deleted until it has finished creating; api provides no way of telling whether creation process complete
|
34
|
-
sleep 5
|
35
|
-
retry
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
tests("#delete_login_profile('fog_user')").formats(AWS::IAM::Formats::BASIC) do
|
40
|
-
pending if Fog.mocking?
|
41
|
-
Fog::AWS[:iam].delete_login_profile('fog_user').body
|
42
|
-
end
|
43
|
-
|
44
|
-
tests("#get_login_profile('fog_user')") do
|
45
|
-
pending if Fog.mocking?
|
46
|
-
raises(Excon::Errors::NotFound) {Fog::AWS[:iam].get_login_profile('fog_user')}
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
tests('failure') do
|
52
|
-
tests('get login profile for non existing user') do
|
53
|
-
pending if Fog.mocking?
|
54
|
-
raises(Fog::AWS::IAM::NotFound) { Fog::AWS[:iam].get_login_profile('idontexist')}
|
55
|
-
raises(Fog::AWS::IAM::NotFound) { Fog::AWS[:iam].delete_login_profile('fog_user')}
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
unless Fog.mocking?
|
60
|
-
Fog::AWS[:iam].delete_user('fog_user')
|
61
|
-
end
|
62
|
-
end
|
@@ -1,110 +0,0 @@
|
|
1
|
-
Shindo.tests('AWS::IAM | managed policy requests', ['aws']) do
|
2
|
-
|
3
|
-
Fog::AWS[:iam].create_group('fog_policy_test_group')
|
4
|
-
Fog::AWS[:iam].create_user('fog_policy_test_user')
|
5
|
-
Fog::AWS[:iam].create_role('fog_policy_test_role', Fog::AWS::IAM::EC2_ASSUME_ROLE_POLICY)
|
6
|
-
|
7
|
-
tests('success') do
|
8
|
-
@policy = {'Version' => '2012-10-17', "Statement" => [{"Effect" => "Deny", "Action" => "*", "Resource" => "*"}]}
|
9
|
-
@policy_format = {
|
10
|
-
'Arn' => String,
|
11
|
-
'AttachmentCount' => Integer,
|
12
|
-
'Description' => Fog::Nullable::String,
|
13
|
-
'DefaultVersionId' => String,
|
14
|
-
'IsAttachable' => Fog::Boolean,
|
15
|
-
'Path' => String,
|
16
|
-
'PolicyId' => String,
|
17
|
-
'PolicyName' => String,
|
18
|
-
'CreateDate' => Time,
|
19
|
-
'UpdateDate' => Time
|
20
|
-
}
|
21
|
-
|
22
|
-
create_policy_format = {
|
23
|
-
'RequestId' => String,
|
24
|
-
'Policy' => @policy_format
|
25
|
-
}
|
26
|
-
|
27
|
-
list_policies_format = {
|
28
|
-
'RequestId' => String,
|
29
|
-
'Policies' => [@policy_format],
|
30
|
-
'Marker' => Fog::Nullable::String,
|
31
|
-
'IsTruncated' => Fog::Boolean
|
32
|
-
}
|
33
|
-
|
34
|
-
attached_policy_format = {
|
35
|
-
'PolicyArn' => String,
|
36
|
-
'PolicyName' => String
|
37
|
-
}
|
38
|
-
|
39
|
-
list_managed_policies_format = {
|
40
|
-
'RequestId' => String,
|
41
|
-
'Policies' => [attached_policy_format]
|
42
|
-
}
|
43
|
-
|
44
|
-
tests("#create_policy('fog_policy')").formats(create_policy_format) do
|
45
|
-
body = Fog::AWS[:iam].create_policy('fog_policy', @policy, '/fog/').body
|
46
|
-
@policy_arn = body['Policy']['Arn']
|
47
|
-
body
|
48
|
-
end
|
49
|
-
|
50
|
-
tests("#list_policies()").formats(list_policies_format) do
|
51
|
-
body = Fog::AWS[:iam].list_policies('PathPrefix' => '/fog/').body
|
52
|
-
tests('length 1').returns(1) do
|
53
|
-
body['Policies'].length
|
54
|
-
end
|
55
|
-
body
|
56
|
-
end
|
57
|
-
|
58
|
-
|
59
|
-
tests("#attach_user_policy()").formats(AWS::IAM::Formats::BASIC) do
|
60
|
-
Fog::AWS[:iam].attach_user_policy('fog_policy_test_user', @policy_arn).body
|
61
|
-
end
|
62
|
-
|
63
|
-
tests("#list_attach_user_policies()").formats(list_managed_policies_format) do
|
64
|
-
Fog::AWS[:iam].list_attached_user_policies('fog_policy_test_user').body
|
65
|
-
end
|
66
|
-
|
67
|
-
tests("#detach_user_policy()").formats(AWS::IAM::Formats::BASIC) do
|
68
|
-
Fog::AWS[:iam].detach_user_policy('fog_policy_test_user', @policy_arn).body
|
69
|
-
end
|
70
|
-
|
71
|
-
tests("#attach_group_policy()").formats(AWS::IAM::Formats::BASIC) do
|
72
|
-
Fog::AWS[:iam].attach_group_policy('fog_policy_test_group', @policy_arn).body
|
73
|
-
end
|
74
|
-
|
75
|
-
tests("#list_attach_group_policies()").formats(list_managed_policies_format) do
|
76
|
-
Fog::AWS[:iam].list_attached_group_policies('fog_policy_test_group').body
|
77
|
-
end
|
78
|
-
|
79
|
-
tests("#detach_group_policy()").formats(AWS::IAM::Formats::BASIC) do
|
80
|
-
Fog::AWS[:iam].detach_group_policy('fog_policy_test_group', @policy_arn).body
|
81
|
-
end
|
82
|
-
|
83
|
-
tests("#attach_role_policy()").formats(AWS::IAM::Formats::BASIC) do
|
84
|
-
body = Fog::AWS[:iam].attach_role_policy('fog_policy_test_role', @policy_arn).body
|
85
|
-
end
|
86
|
-
|
87
|
-
tests("#list_attached_role_policies()").formats(list_managed_policies_format) do
|
88
|
-
Fog::AWS[:iam].list_attached_role_policies('fog_policy_test_role').body
|
89
|
-
end
|
90
|
-
|
91
|
-
tests("#detach_role_policy()").formats(AWS::IAM::Formats::BASIC) do
|
92
|
-
Fog::AWS[:iam].detach_role_policy('fog_policy_test_role', @policy_arn).body
|
93
|
-
end
|
94
|
-
|
95
|
-
tests("#delete_policy()").formats(AWS::IAM::Formats::BASIC) do
|
96
|
-
Fog::AWS[:iam].delete_policy(@policy_arn).body
|
97
|
-
end
|
98
|
-
|
99
|
-
end
|
100
|
-
|
101
|
-
tests('failure') do
|
102
|
-
test('failing conditions')
|
103
|
-
end
|
104
|
-
|
105
|
-
Fog::AWS[:iam].delete_group('fog_policy_test_group')
|
106
|
-
Fog::AWS[:iam].delete_user('fog_policy_test_user')
|
107
|
-
Fog::AWS[:iam].delete_role('fog_policy_test_role')
|
108
|
-
|
109
|
-
|
110
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
Shindo.tests('AWS::IAM | mfa requests', ['aws']) do
|
2
|
-
|
3
|
-
tests('success') do
|
4
|
-
@mfa_devices_format = {
|
5
|
-
'MFADevices' => [{
|
6
|
-
'EnableDate' => Time,
|
7
|
-
'SerialNumber' => String,
|
8
|
-
'UserName' => String
|
9
|
-
}],
|
10
|
-
'IsTruncated' => Fog::Boolean,
|
11
|
-
'RequestId' => String
|
12
|
-
}
|
13
|
-
|
14
|
-
tests('#list_mfa_devices').formats(@mfa_devices_format) do
|
15
|
-
Fog::AWS[:iam].list_mfa_devices.body
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
tests('failure') do
|
20
|
-
test('failing conditions')
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|