cifrado 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/.gitignore +18 -0
- data/CHANGELOG.md +44 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +247 -0
- data/RELEASE.md +10 -0
- data/Rakefile +21 -0
- data/TODO.md +6 -0
- data/bin/cifrado +7 -0
- data/cifrado.gemspec +31 -0
- data/gem-public_cert.pem +20 -0
- data/lib/cifrado.rb +48 -0
- data/lib/cifrado/cli.rb +140 -0
- data/lib/cifrado/cli/cinema.rb +81 -0
- data/lib/cifrado/cli/delete.rb +36 -0
- data/lib/cifrado/cli/download.rb +54 -0
- data/lib/cifrado/cli/jukebox.rb +94 -0
- data/lib/cifrado/cli/list.rb +64 -0
- data/lib/cifrado/cli/post.rb +10 -0
- data/lib/cifrado/cli/progressbar.rb +86 -0
- data/lib/cifrado/cli/saio.rb +11 -0
- data/lib/cifrado/cli/saio/base.rb +20 -0
- data/lib/cifrado/cli/saio/bootstrap.rb +118 -0
- data/lib/cifrado/cli/saio/destroy.rb +16 -0
- data/lib/cifrado/cli/saio/scripts/saio.sh.erb +445 -0
- data/lib/cifrado/cli/set_acl.rb +10 -0
- data/lib/cifrado/cli/setup.rb +64 -0
- data/lib/cifrado/cli/stat.rb +41 -0
- data/lib/cifrado/cli/upload.rb +269 -0
- data/lib/cifrado/config.rb +18 -0
- data/lib/cifrado/core_ext/ruby18_base64.rb +15 -0
- data/lib/cifrado/crypto_services.rb +218 -0
- data/lib/cifrado/file_splitter.rb +67 -0
- data/lib/cifrado/rate_limit.rb +23 -0
- data/lib/cifrado/streaming_downloader.rb +49 -0
- data/lib/cifrado/streaming_uploader.rb +57 -0
- data/lib/cifrado/swift_client.rb +313 -0
- data/lib/cifrado/utils.rb +59 -0
- data/lib/cifrado/version.rb +3 -0
- data/tests/cli/list_tests.rb +28 -0
- data/tests/cli/upload_multi_tests.rb +94 -0
- data/tests/cli/upload_tests.rb +167 -0
- data/tests/cli_tests.rb +2 -0
- data/tests/crypto_services_tests.rb +145 -0
- data/tests/file_splitter_tests.rb +61 -0
- data/tests/helper.rb +117 -0
- data/tests/swift_client/create_directory.rb +14 -0
- data/tests/swift_client/download_tests.rb +208 -0
- data/tests/swift_client/file_available.rb +25 -0
- data/tests/swift_client/head_tests.rb +34 -0
- data/tests/swift_client/match_tests.rb +29 -0
- data/tests/swift_client/upload_tests.rb +70 -0
- data/tests/swift_client_tests.rb +29 -0
- data/tests/utils_tests.rb +33 -0
- data/vendor/fog/.document +3 -0
- data/vendor/fog/.gitignore +23 -0
- data/vendor/fog/.irbrc +82 -0
- data/vendor/fog/.travis.yml +21 -0
- data/vendor/fog/README.cifrado +3 -0
- data/vendor/fog/README.md +156 -0
- data/vendor/fog/RELEASE.md +39 -0
- data/vendor/fog/changelog.txt +4156 -0
- data/vendor/fog/fog.gemspec +70 -0
- data/vendor/fog/lib/fog.rb +17 -0
- data/vendor/fog/lib/fog/cdn.rb +30 -0
- data/vendor/fog/lib/fog/compute.rb +127 -0
- data/vendor/fog/lib/fog/compute/models/server.rb +73 -0
- data/vendor/fog/lib/fog/core.rb +38 -0
- data/vendor/fog/lib/fog/core/attributes.rb +221 -0
- data/vendor/fog/lib/fog/core/collection.rb +145 -0
- data/vendor/fog/lib/fog/core/connection.rb +36 -0
- data/vendor/fog/lib/fog/core/credentials.rb +65 -0
- data/vendor/fog/lib/fog/core/current_machine.rb +34 -0
- data/vendor/fog/lib/fog/core/deprecated_connection_accessors.rb +41 -0
- data/vendor/fog/lib/fog/core/deprecation.rb +23 -0
- data/vendor/fog/lib/fog/core/errors.rb +108 -0
- data/vendor/fog/lib/fog/core/hmac.rb +48 -0
- data/vendor/fog/lib/fog/core/json.rb +34 -0
- data/vendor/fog/lib/fog/core/logger.rb +45 -0
- data/vendor/fog/lib/fog/core/mock.rb +92 -0
- data/vendor/fog/lib/fog/core/model.rb +79 -0
- data/vendor/fog/lib/fog/core/parser.rb +116 -0
- data/vendor/fog/lib/fog/core/provider.rb +35 -0
- data/vendor/fog/lib/fog/core/scp.rb +96 -0
- data/vendor/fog/lib/fog/core/service.rb +223 -0
- data/vendor/fog/lib/fog/core/ssh.rb +137 -0
- data/vendor/fog/lib/fog/core/time.rb +32 -0
- data/vendor/fog/lib/fog/core/timeout.rb +11 -0
- data/vendor/fog/lib/fog/core/wait_for.rb +15 -0
- data/vendor/fog/lib/fog/digitalocean.rb +9 -0
- data/vendor/fog/lib/fog/digitalocean/compute.rb +100 -0
- data/vendor/fog/lib/fog/digitalocean/examples/getting_started.md +106 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/flavor.rb +14 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/flavors.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/image.rb +15 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/images.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/region.rb +14 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/regions.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/server.rb +150 -0
- data/vendor/fog/lib/fog/digitalocean/models/compute/servers.rb +27 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/create_server.rb +49 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/create_ssh_key.rb +26 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/destroy_server.rb +28 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/get_server_details.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/list_flavors.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/list_images.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/list_regions.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/list_servers.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/list_ssh_keys.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/power_cycle_server.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/power_off_server.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/power_on_server.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/reboot_server.rb +25 -0
- data/vendor/fog/lib/fog/digitalocean/requests/compute/shutdown_server.rb +25 -0
- data/vendor/fog/lib/fog/dns.rb +59 -0
- data/vendor/fog/lib/fog/identity.rb +27 -0
- data/vendor/fog/lib/fog/image.rb +24 -0
- data/vendor/fog/lib/fog/local.rb +11 -0
- data/vendor/fog/lib/fog/local/models/storage/directories.rb +33 -0
- data/vendor/fog/lib/fog/local/models/storage/directory.rb +57 -0
- data/vendor/fog/lib/fog/local/models/storage/file.rb +131 -0
- data/vendor/fog/lib/fog/local/models/storage/files.rb +87 -0
- data/vendor/fog/lib/fog/local/storage.rb +103 -0
- data/vendor/fog/lib/fog/network.rb +26 -0
- data/vendor/fog/lib/fog/openstack.rb +214 -0
- data/vendor/fog/lib/fog/openstack/README.identity.md +69 -0
- data/vendor/fog/lib/fog/openstack/compute.rb +423 -0
- data/vendor/fog/lib/fog/openstack/identity.rb +299 -0
- data/vendor/fog/lib/fog/openstack/image.rb +217 -0
- data/vendor/fog/lib/fog/openstack/models/compute/address.rb +71 -0
- data/vendor/fog/lib/fog/openstack/models/compute/addresses.rb +33 -0
- data/vendor/fog/lib/fog/openstack/models/compute/flavor.rb +45 -0
- data/vendor/fog/lib/fog/openstack/models/compute/flavors.rb +28 -0
- data/vendor/fog/lib/fog/openstack/models/compute/host.rb +29 -0
- data/vendor/fog/lib/fog/openstack/models/compute/hosts.rb +32 -0
- data/vendor/fog/lib/fog/openstack/models/compute/image.rb +58 -0
- data/vendor/fog/lib/fog/openstack/models/compute/images.rb +33 -0
- data/vendor/fog/lib/fog/openstack/models/compute/key_pair.rb +60 -0
- data/vendor/fog/lib/fog/openstack/models/compute/key_pairs.rb +31 -0
- data/vendor/fog/lib/fog/openstack/models/compute/metadata.rb +68 -0
- data/vendor/fog/lib/fog/openstack/models/compute/metadatum.rb +29 -0
- data/vendor/fog/lib/fog/openstack/models/compute/network.rb +13 -0
- data/vendor/fog/lib/fog/openstack/models/compute/networks.rb +29 -0
- data/vendor/fog/lib/fog/openstack/models/compute/security_group.rb +44 -0
- data/vendor/fog/lib/fog/openstack/models/compute/security_groups.rb +27 -0
- data/vendor/fog/lib/fog/openstack/models/compute/server.rb +278 -0
- data/vendor/fog/lib/fog/openstack/models/compute/servers.rb +44 -0
- data/vendor/fog/lib/fog/openstack/models/compute/snapshot.rb +44 -0
- data/vendor/fog/lib/fog/openstack/models/compute/snapshots.rb +26 -0
- data/vendor/fog/lib/fog/openstack/models/compute/tenant.rb +24 -0
- data/vendor/fog/lib/fog/openstack/models/compute/tenants.rb +24 -0
- data/vendor/fog/lib/fog/openstack/models/compute/volume.rb +59 -0
- data/vendor/fog/lib/fog/openstack/models/compute/volumes.rb +26 -0
- data/vendor/fog/lib/fog/openstack/models/identity/ec2_credential.rb +44 -0
- data/vendor/fog/lib/fog/openstack/models/identity/ec2_credentials.rb +53 -0
- data/vendor/fog/lib/fog/openstack/models/identity/role.rb +50 -0
- data/vendor/fog/lib/fog/openstack/models/identity/roles.rb +21 -0
- data/vendor/fog/lib/fog/openstack/models/identity/tenant.rb +62 -0
- data/vendor/fog/lib/fog/openstack/models/identity/tenants.rb +29 -0
- data/vendor/fog/lib/fog/openstack/models/identity/user.rb +70 -0
- data/vendor/fog/lib/fog/openstack/models/identity/users.rb +32 -0
- data/vendor/fog/lib/fog/openstack/models/image/image.rb +91 -0
- data/vendor/fog/lib/fog/openstack/models/image/images.rb +60 -0
- data/vendor/fog/lib/fog/openstack/models/meta_parent.rb +33 -0
- data/vendor/fog/lib/fog/openstack/models/network/floating_ip.rb +52 -0
- data/vendor/fog/lib/fog/openstack/models/network/floating_ips.rb +34 -0
- data/vendor/fog/lib/fog/openstack/models/network/network.rb +47 -0
- data/vendor/fog/lib/fog/openstack/models/network/networks.rb +34 -0
- data/vendor/fog/lib/fog/openstack/models/network/port.rb +53 -0
- data/vendor/fog/lib/fog/openstack/models/network/ports.rb +34 -0
- data/vendor/fog/lib/fog/openstack/models/network/subnet.rb +56 -0
- data/vendor/fog/lib/fog/openstack/models/network/subnets.rb +34 -0
- data/vendor/fog/lib/fog/openstack/models/storage/directories.rb +39 -0
- data/vendor/fog/lib/fog/openstack/models/storage/directory.rb +50 -0
- data/vendor/fog/lib/fog/openstack/models/storage/file.rb +152 -0
- data/vendor/fog/lib/fog/openstack/models/storage/files.rb +94 -0
- data/vendor/fog/lib/fog/openstack/models/volume/volume.rb +47 -0
- data/vendor/fog/lib/fog/openstack/models/volume/volumes.rb +27 -0
- data/vendor/fog/lib/fog/openstack/network.rb +247 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/add_fixed_ip.rb +29 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/allocate_address.rb +42 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/associate_address.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/attach_volume.rb +38 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/boot_from_snapshot.rb +41 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/change_server_password.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/confirm_resize_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_flavor.rb +85 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_image.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_key_pair.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_security_group.rb +52 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_security_group_rule.rb +59 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_server.rb +131 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_volume.rb +54 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/create_volume_snapshot.rb +47 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_flavor.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_image.rb +40 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_key_pair.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_metadata.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_security_group.rb +33 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_security_group_rule.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_server.rb +38 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_snapshot.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/delete_volume.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/detach_volume.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/disassociate_address.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_address.rb +41 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_console_output.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_flavor_details.rb +43 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_host_details.rb +74 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_image_details.rb +33 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_limits.rb +93 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_metadata.rb +29 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_quota.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_quota_defaults.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_security_group.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_server_details.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_server_volumes.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_snapshot_details.rb +39 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_usage.rb +53 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_vnc_console.rb +40 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/get_volume_details.rb +42 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_address_pools.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_addresses.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_all_addresses.rb +64 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_flavors.rb +38 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_flavors_detail.rb +38 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_hosts.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_images.rb +33 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_images_detail.rb +39 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_key_pairs.rb +39 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_metadata.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_private_addresses.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_public_addresses.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_security_groups.rb +50 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_servers.rb +37 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_servers_detail.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_snapshots.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_tenants.rb +45 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_usages.rb +43 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/list_volumes.rb +51 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/live_migrate_server.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/migrate_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/pause_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/reboot_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/rebuild_server.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/release_address.rb +34 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/remove_fixed_ip.rb +29 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/rescue_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/reset_server_state.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/resize_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/resume_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/revert_resize_server.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/server_action.rb +18 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/server_actions.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/server_diagnostics.rb +25 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/set_metadata.rb +45 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/set_tenant.rb +21 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/suspend_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/unpause_server.rb +24 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/update_metadata.rb +46 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/update_quota.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/compute/update_server.rb +35 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/add_user_to_tenant.rb +34 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/check_token.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/create_ec2_credential.rb +58 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/create_role.rb +37 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/create_tenant.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/create_user.rb +47 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/create_user_role.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/delete_ec2_credential.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/delete_role.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/delete_tenant.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/delete_user.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/delete_user_role.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_ec2_credential.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_role.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_tenant.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_tenants_by_id.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_tenants_by_name.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_user_by_id.rb +34 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/get_user_by_name.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_ec2_credentials.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_endpoints_for_token.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_roles.rb +36 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_roles_for_user_on_tenant.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_tenants.rb +45 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_user_global_roles.rb +22 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/list_users.rb +34 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/remove_user_from_tenant.rb +20 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/set_tenant.rb +21 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/update_tenant.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/update_user.rb +36 -0
- data/vendor/fog/lib/fog/openstack/requests/identity/validate_token.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/image/add_member_to_image.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/image/create_image.rb +79 -0
- data/vendor/fog/lib/fog/openstack/requests/image/delete_image.rb +25 -0
- data/vendor/fog/lib/fog/openstack/requests/image/get_image.rb +45 -0
- data/vendor/fog/lib/fog/openstack/requests/image/get_image_by_id.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/image/get_image_members.rb +29 -0
- data/vendor/fog/lib/fog/openstack/requests/image/get_shared_images.rb +29 -0
- data/vendor/fog/lib/fog/openstack/requests/image/list_public_images.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/image/list_public_images_detailed.rb +31 -0
- data/vendor/fog/lib/fog/openstack/requests/image/remove_member_from_image.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/image/set_tenant.rb +21 -0
- data/vendor/fog/lib/fog/openstack/requests/image/update_image.rb +70 -0
- data/vendor/fog/lib/fog/openstack/requests/image/update_image_members.rb +37 -0
- data/vendor/fog/lib/fog/openstack/requests/network/associate_floating_ip.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/network/create_floating_ip.rb +50 -0
- data/vendor/fog/lib/fog/openstack/requests/network/create_network.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/network/create_port.rb +52 -0
- data/vendor/fog/lib/fog/openstack/requests/network/create_subnet.rb +56 -0
- data/vendor/fog/lib/fog/openstack/requests/network/delete_floating_ip.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/network/delete_network.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/network/delete_port.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/network/delete_subnet.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/network/disassociate_floating_ip.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/network/get_floating_ip.rb +42 -0
- data/vendor/fog/lib/fog/openstack/requests/network/get_network.rb +42 -0
- data/vendor/fog/lib/fog/openstack/requests/network/get_port.rb +48 -0
- data/vendor/fog/lib/fog/openstack/requests/network/get_subnet.rb +49 -0
- data/vendor/fog/lib/fog/openstack/requests/network/list_floating_ips.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/network/list_networks.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/network/list_ports.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/network/list_subnets.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/network/set_tenant.rb +21 -0
- data/vendor/fog/lib/fog/openstack/requests/network/update_network.rb +41 -0
- data/vendor/fog/lib/fog/openstack/requests/network/update_port.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/network/update_subnet.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/copy_object.rb +27 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/delete_container.rb +22 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/delete_object.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/get_container.rb +44 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/get_containers.rb +33 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/get_object.rb +29 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/get_object_https_url.rb +51 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/head_container.rb +28 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/head_containers.rb +25 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/head_object.rb +23 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/post_set_meta_temp_url_key.rb +37 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/put_container.rb +22 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/put_object.rb +30 -0
- data/vendor/fog/lib/fog/openstack/requests/storage/put_object_manifest.rb +25 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/create_volume.rb +54 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/create_volume_snapshot.rb +47 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/delete_snapshot.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/delete_volume.rb +26 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/get_snapshot_details.rb +39 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/get_volume_details.rb +42 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/list_snapshots.rb +32 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/list_volumes.rb +55 -0
- data/vendor/fog/lib/fog/openstack/requests/volume/set_tenant.rb +21 -0
- data/vendor/fog/lib/fog/openstack/storage.rb +162 -0
- data/vendor/fog/lib/fog/openstack/volume.rb +219 -0
- data/vendor/fog/lib/fog/providers.rb +2 -0
- data/vendor/fog/lib/fog/schema/data_validator.rb +154 -0
- data/vendor/fog/lib/fog/storage.rb +97 -0
- data/vendor/fog/lib/fog/version.rb +3 -0
- data/vendor/fog/lib/fog/volume.rb +25 -0
- metadata +576 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
Shindo.tests('Cifrado | FileSplitter') do
|
2
|
+
|
3
|
+
obj = create_bin_payload 1
|
4
|
+
obj10 = create_bin_payload 10*1024
|
5
|
+
obj100 = create_bin_payload 100*1024
|
6
|
+
|
7
|
+
tests('#split') do
|
8
|
+
|
9
|
+
tests('10MB file') do
|
10
|
+
s = FileSplitter.new obj10, 10
|
11
|
+
count = 1
|
12
|
+
chunks = s.split
|
13
|
+
chunks.each do |chunk|
|
14
|
+
test "generates chunk ##{count}" do
|
15
|
+
File.exist?(chunk)
|
16
|
+
end
|
17
|
+
test "the chunk #{chunk} has the correct size" do
|
18
|
+
# Each chunk is 1K
|
19
|
+
File.size(chunk) == 1024*1024
|
20
|
+
end
|
21
|
+
count += 1
|
22
|
+
end
|
23
|
+
|
24
|
+
test 'md5 matches' do
|
25
|
+
t = tmpfile
|
26
|
+
chunks.each do |c|
|
27
|
+
`/bin/cat #{c} >> #{t}`
|
28
|
+
end
|
29
|
+
Digest::MD5.file(t) == Digest::MD5.file(obj10)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
test '8KB file' do
|
34
|
+
s = FileSplitter.new create_bin_payload(8), 2
|
35
|
+
s.split.size == 2
|
36
|
+
end
|
37
|
+
|
38
|
+
test '10KB file' do
|
39
|
+
s = FileSplitter.new create_bin_payload(10), 4
|
40
|
+
s.split.size == 3
|
41
|
+
end
|
42
|
+
|
43
|
+
test 'split 1K in 2 returns 1 chunk' do
|
44
|
+
s = FileSplitter.new obj, 2
|
45
|
+
s.split.size == 1
|
46
|
+
end
|
47
|
+
|
48
|
+
test 'calculate chunks' do
|
49
|
+
s = FileSplitter.new obj100
|
50
|
+
s.split.size == 10
|
51
|
+
end
|
52
|
+
|
53
|
+
test 'discard-chunks' do
|
54
|
+
s = FileSplitter.new obj100, 30
|
55
|
+
chunks = s.split
|
56
|
+
chunks.size == 30
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
data/tests/helper.rb
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
require 'cifrado'
|
2
|
+
require 'yaml'
|
3
|
+
require 'securerandom'
|
4
|
+
require 'fileutils'
|
5
|
+
require 'digest/md5'
|
6
|
+
|
7
|
+
include Cifrado
|
8
|
+
include Cifrado::Utils
|
9
|
+
|
10
|
+
unless ENV['DEBUG']
|
11
|
+
Cifrado::Log.level = Logger::ERROR
|
12
|
+
end
|
13
|
+
|
14
|
+
def client
|
15
|
+
conf = YAML.load_file File.expand_path("~/.config/cifrado/cifradorc")
|
16
|
+
client = SwiftClient.new :username => conf[:username],
|
17
|
+
:api_key => conf[:password],
|
18
|
+
:auth_url => conf[:auth_url],
|
19
|
+
:region => conf[:region],
|
20
|
+
:password_salt => conf[:secure_random],
|
21
|
+
:connection_options => { :ssl_verify_peer => false }
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_tmpdir
|
25
|
+
dir = "/tmp/cifrado-#{SecureRandom.hex}"
|
26
|
+
Dir.mkdir dir
|
27
|
+
dir
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_container
|
31
|
+
client.service.directories.create :key => test_container_name
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_container_name
|
35
|
+
'cifrado-tests'
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_container_segments_name
|
39
|
+
'cifrado-tests_segments'
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_container_segments
|
43
|
+
client.service.directories.create :key => test_container_segments_name
|
44
|
+
end
|
45
|
+
|
46
|
+
def populate_tmpdir
|
47
|
+
tmpdir = create_tmpdir
|
48
|
+
create_bin_payload 100, "#{tmpdir}/#{SecureRandom.hex}"
|
49
|
+
create_bin_payload 100, "#{tmpdir}/#{SecureRandom.hex}"
|
50
|
+
create_bin_payload 100, "#{tmpdir}/#{SecureRandom.hex}"
|
51
|
+
tmpdir
|
52
|
+
end
|
53
|
+
|
54
|
+
# Size in KB
|
55
|
+
def create_bin_payload size, filename = nil
|
56
|
+
if filename
|
57
|
+
tmp_file = filename
|
58
|
+
else
|
59
|
+
tmp_file = "/tmp/cifrado-test-payload-#{SecureRandom.hex}"
|
60
|
+
end
|
61
|
+
target_dir = File.dirname(tmp_file)
|
62
|
+
unless File.directory?(target_dir)
|
63
|
+
FileUtils.mkdir_p target_dir
|
64
|
+
end
|
65
|
+
out = `dd if=/dev/urandom of=#{tmp_file} bs=1K count=#{size} > /dev/null 2>&1`
|
66
|
+
raise "Error creating #{size}MB binary payload" unless $? == 0
|
67
|
+
tmp_file
|
68
|
+
end
|
69
|
+
|
70
|
+
def create_text_payload text
|
71
|
+
tmp_file = "/tmp/cifrado-test-payload-#{SecureRandom.hex}"
|
72
|
+
File.open tmp_file, 'w' do |f|
|
73
|
+
f.puts text
|
74
|
+
end
|
75
|
+
tmp_file
|
76
|
+
end
|
77
|
+
|
78
|
+
def clean_test_payloads
|
79
|
+
Dir["/tmp/cifrado-test-payload-*"].each do |f|
|
80
|
+
File.delete f
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def clean_test_container
|
85
|
+
if dir = test_container
|
86
|
+
dir.files.each do |f|
|
87
|
+
f.destroy
|
88
|
+
end
|
89
|
+
end
|
90
|
+
if dir = test_container_segments
|
91
|
+
dir.files.each do |f|
|
92
|
+
f.destroy
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def passphrase
|
98
|
+
'foobar'
|
99
|
+
end
|
100
|
+
|
101
|
+
def cleanup
|
102
|
+
clean_test_payloads
|
103
|
+
clean_test_container
|
104
|
+
Dir["/tmp/cifrado*"].each { |f| FileUtils.rm_rf f }
|
105
|
+
Dir[File.join(ENV['HOME'], ".cache/cifrado") + "/*segments*"].each { |f| FileUtils.rm_rf f }
|
106
|
+
end
|
107
|
+
|
108
|
+
def tmpfile
|
109
|
+
"/tmp/cifrado-tests-#{SecureRandom.hex}"
|
110
|
+
end
|
111
|
+
|
112
|
+
at_exit do
|
113
|
+
puts "Cleaning up..."
|
114
|
+
cleanup
|
115
|
+
test_container_segments.destroy
|
116
|
+
test_container.destroy
|
117
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Shindo.tests('Cifrado | SwiftClient#create_directory') do
|
2
|
+
|
3
|
+
tests '#create_directory' do
|
4
|
+
name = SecureRandom.hex
|
5
|
+
dir = client.create_directory name
|
6
|
+
test 'is a Fog::Storage::OpenStack::Directory' do
|
7
|
+
dir.is_a? Fog::Storage::OpenStack::Directory
|
8
|
+
end
|
9
|
+
test "dir name is #{name}" do
|
10
|
+
dir.key == name
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,208 @@
|
|
1
|
+
Shindo.tests('Cifrado | SwiftClient#download') do
|
2
|
+
|
3
|
+
cwd = Dir.pwd
|
4
|
+
cli_options = {
|
5
|
+
:insecure => true,
|
6
|
+
:no_progressbar => true
|
7
|
+
}
|
8
|
+
|
9
|
+
tests "#download" do
|
10
|
+
test "object" do
|
11
|
+
obj = create_bin_payload 1
|
12
|
+
md5 = Digest::MD5.file obj
|
13
|
+
client.upload('cifrado-tests', obj)
|
14
|
+
output = "/tmp/cifrado-tests-#{SecureRandom.hex}"
|
15
|
+
r = client.download 'cifrado-tests',
|
16
|
+
obj,
|
17
|
+
:output => output
|
18
|
+
r.status == 200 and Digest::MD5.file(output) == md5
|
19
|
+
end
|
20
|
+
|
21
|
+
tests "download and decrypt" do
|
22
|
+
test 'with output option' do
|
23
|
+
obj = create_text_payload 'foobar'
|
24
|
+
md5 = Digest::MD5.file obj
|
25
|
+
output = "/tmp/cifrado-tests-#{SecureRandom.hex}"
|
26
|
+
cli = Cifrado::CLI.new
|
27
|
+
cli.options = cli_options.merge({
|
28
|
+
:encrypt => 'a:rubiojr',
|
29
|
+
})
|
30
|
+
obj_path = cli.upload test_container_name, obj
|
31
|
+
r = client.download test_container_name,
|
32
|
+
obj_path,
|
33
|
+
:output => output,
|
34
|
+
:decrypt => true
|
35
|
+
r.status == 200 and \
|
36
|
+
Digest::MD5.file(output) == md5 and \
|
37
|
+
File.read(output).strip.chomp == 'foobar'
|
38
|
+
end
|
39
|
+
|
40
|
+
test 'witout output' do
|
41
|
+
obj = create_text_payload 'foobar'
|
42
|
+
md5 = Digest::MD5.file obj
|
43
|
+
output = "/tmp/cifrado-tests-#{SecureRandom.hex}"
|
44
|
+
Dir.mkdir output
|
45
|
+
Dir.chdir output
|
46
|
+
cli = Cifrado::CLI.new
|
47
|
+
cli.options = cli_options.merge({
|
48
|
+
:encrypt => 'a:rubiojr',
|
49
|
+
})
|
50
|
+
obj_path = cli.upload test_container_name, obj
|
51
|
+
r = client.download test_container_name,
|
52
|
+
obj_path,
|
53
|
+
:decrypt => true
|
54
|
+
downloaded_file = File.join(output, obj)
|
55
|
+
r.status == 200 and \
|
56
|
+
Digest::MD5.file(downloaded_file) == md5 and \
|
57
|
+
File.read(downloaded_file).strip.chomp == 'foobar'
|
58
|
+
end
|
59
|
+
Dir.chdir cwd
|
60
|
+
|
61
|
+
test 'not really encrypted' do
|
62
|
+
obj = create_text_payload 'foobar'
|
63
|
+
md5 = Digest::MD5.file obj
|
64
|
+
output = "/tmp/cifrado-tests-#{SecureRandom.hex}"
|
65
|
+
Dir.mkdir output
|
66
|
+
Dir.chdir output
|
67
|
+
cli = Cifrado::CLI.new
|
68
|
+
cli.options = cli_options
|
69
|
+
obj_path = cli.upload test_container_name, obj
|
70
|
+
r = client.download test_container_name,
|
71
|
+
obj_path,
|
72
|
+
:decrypt => true
|
73
|
+
downloaded_file = File.join(output, obj)
|
74
|
+
r.status == 200 and \
|
75
|
+
Digest::MD5.file(downloaded_file) == md5 and \
|
76
|
+
File.read(downloaded_file).strip.chomp == 'foobar'
|
77
|
+
end
|
78
|
+
Dir.chdir cwd
|
79
|
+
|
80
|
+
tests 'container' do
|
81
|
+
clean_test_container
|
82
|
+
|
83
|
+
container = test_container
|
84
|
+
obj = create_bin_payload 1
|
85
|
+
obj2 = create_bin_payload 1
|
86
|
+
obj3 = create_bin_payload 1, tmpfile + "/foo/bar/file1"
|
87
|
+
output = "/tmp/cifrado-objects-#{SecureRandom.hex}"
|
88
|
+
cli = Cifrado::CLI.new
|
89
|
+
cli.options = cli_options.merge({
|
90
|
+
:segments => 3,
|
91
|
+
:encrypt => "s:#{passphrase}"
|
92
|
+
})
|
93
|
+
[obj, obj2, obj3].each do |o|
|
94
|
+
cli.upload container.key, o
|
95
|
+
end
|
96
|
+
sleep 5
|
97
|
+
|
98
|
+
raises ArgumentError, 'download to invalid dir' do
|
99
|
+
client.download container.key,
|
100
|
+
nil,
|
101
|
+
:output => output,
|
102
|
+
:decrypt => true,
|
103
|
+
:passphrase => passphrase
|
104
|
+
end
|
105
|
+
|
106
|
+
tests "contents in #{output}" do
|
107
|
+
FileUtils.mkdir output
|
108
|
+
returns(Excon::Response,"download contents to #{output}") do
|
109
|
+
client.download(container.key,
|
110
|
+
nil,
|
111
|
+
:output => output,
|
112
|
+
:decrypt => true,
|
113
|
+
:passphrase => passphrase).class
|
114
|
+
end
|
115
|
+
[obj, obj2, obj3].each do |o|
|
116
|
+
test "includes #{o}" do
|
117
|
+
Dir["#{output}/**/*"].include?(File.join(output, obj))
|
118
|
+
end
|
119
|
+
end
|
120
|
+
test "file #{obj3} exist" do
|
121
|
+
File.exist?(File.join(output, obj3))
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
tests 'file MD5 digest' do
|
126
|
+
hashes = []
|
127
|
+
hashes << Digest::MD5.file(obj)
|
128
|
+
hashes << Digest::MD5.file(obj2)
|
129
|
+
hashes << Digest::MD5.file(obj3)
|
130
|
+
Dir["#{output}/**/*"].each do |f|
|
131
|
+
next if File.directory?(f)
|
132
|
+
digest = Digest::MD5.file(f)
|
133
|
+
test "includes #{digest}" do
|
134
|
+
hashes.include?(digest)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
end
|
141
|
+
|
142
|
+
test "to current dir" do
|
143
|
+
obj = create_bin_payload 1
|
144
|
+
md5 = Digest::MD5.file obj
|
145
|
+
client.upload(test_container_name, obj)
|
146
|
+
cwd = Dir.pwd
|
147
|
+
Dir.mkdir '/tmp/cifrado'
|
148
|
+
Dir.chdir '/tmp/cifrado'
|
149
|
+
r = client.download test_container_name,
|
150
|
+
obj
|
151
|
+
file = File.join(Dir.pwd, obj)
|
152
|
+
Digest::MD5.file(file) == md5
|
153
|
+
end
|
154
|
+
Dir.chdir cwd
|
155
|
+
|
156
|
+
test 'segmented file' do
|
157
|
+
obj = create_bin_payload 1
|
158
|
+
md5 = Digest::MD5.file obj
|
159
|
+
cli = Cifrado::CLI.new
|
160
|
+
cli.options = cli_options.merge({
|
161
|
+
:segments => 3
|
162
|
+
})
|
163
|
+
segments = cli.upload 'cifrado-tests', obj
|
164
|
+
sleep 5
|
165
|
+
output = "/tmp/cifrado-tests-#{SecureRandom.hex}"
|
166
|
+
r = client.download 'cifrado-tests',
|
167
|
+
obj,
|
168
|
+
:output => output
|
169
|
+
r.status == 200 and Digest::MD5.file(output) == md5
|
170
|
+
end
|
171
|
+
|
172
|
+
cleanup
|
173
|
+
|
174
|
+
test 'container' do
|
175
|
+
container = test_container
|
176
|
+
obj = create_bin_payload 1
|
177
|
+
obj2 = create_bin_payload 1
|
178
|
+
cli = Cifrado::CLI.new
|
179
|
+
cli.options = cli_options.merge({
|
180
|
+
:segments => 3,
|
181
|
+
})
|
182
|
+
cli.upload container.key, obj
|
183
|
+
cli.upload container.key, obj2
|
184
|
+
sleep 5
|
185
|
+
output = "/tmp/cifrado-objects-#{SecureRandom.hex}"
|
186
|
+
FileUtils.mkdir output
|
187
|
+
client.download container.key, nil, :output => output
|
188
|
+
Dir["#{output}/**/*"].size == 3
|
189
|
+
end
|
190
|
+
|
191
|
+
tests "progress callback" do
|
192
|
+
obj = create_bin_payload 1
|
193
|
+
chunks = []
|
194
|
+
cb = Proc.new do |length, read, data|
|
195
|
+
chunks << read
|
196
|
+
end
|
197
|
+
client.upload test_container_name, obj
|
198
|
+
client.download test_container_name,
|
199
|
+
obj,
|
200
|
+
:output => tmpfile,
|
201
|
+
:progress_callback => cb
|
202
|
+
test "chunks equal File.size" do
|
203
|
+
File.size(obj) == chunks.inject(:+)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Shindo.tests('Cifrado | SwiftClient#file_available?') do
|
2
|
+
|
3
|
+
obj1 = create_bin_payload 1
|
4
|
+
clean_object = clean_object_name(obj1)
|
5
|
+
tests 'success' do
|
6
|
+
test "object #{clean_object} available in #{test_container_name}" do
|
7
|
+
client.upload test_container_name, obj1
|
8
|
+
client.file_available? test_container_name, clean_object
|
9
|
+
end
|
10
|
+
test "object #{obj1} available in #{test_container_name}" do
|
11
|
+
client.upload test_container_name, obj1
|
12
|
+
!client.file_available? test_container_name, obj1
|
13
|
+
end
|
14
|
+
end
|
15
|
+
tests 'failures' do
|
16
|
+
container = SecureRandom.hex
|
17
|
+
test "object #{obj1} not available in #{container}" do
|
18
|
+
!(client.file_available? container, clean_object)
|
19
|
+
end
|
20
|
+
test "object #{container} not available in #{test_container_name}" do
|
21
|
+
!(client.file_available? test_container_name, container)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
Shindo.tests('Cifrado | SwiftClient#head') do
|
2
|
+
|
3
|
+
obj1 = create_bin_payload 1
|
4
|
+
clean_object = clean_object_name(obj1)
|
5
|
+
tests 'head object' do
|
6
|
+
test "object #{clean_object} headers available" do
|
7
|
+
client.upload test_container_name, obj1
|
8
|
+
(client.head test_container_name, clean_object_name(obj1)).is_a?(Hash)
|
9
|
+
end
|
10
|
+
test 'head invalid object' do
|
11
|
+
client.head(test_container_name, SecureRandom.hex).nil?
|
12
|
+
end
|
13
|
+
end
|
14
|
+
tests 'head account' do
|
15
|
+
test "head account bytes" do
|
16
|
+
!client.head['X-Account-Bytes-Used'].nil?
|
17
|
+
end
|
18
|
+
test "head account bytes" do
|
19
|
+
client.head['X-Account-Object-Count'].to_i >= 0
|
20
|
+
end
|
21
|
+
end
|
22
|
+
tests 'head container' do
|
23
|
+
test "head container bytes" do
|
24
|
+
!client.head(test_container_name)['X-Container-Bytes-Used'].nil?
|
25
|
+
end
|
26
|
+
test "head container bytes" do
|
27
|
+
client.head(test_container_name)['X-Container-Object-Count'].to_i >= 0
|
28
|
+
end
|
29
|
+
test 'head invalid container' do
|
30
|
+
client.head(SecureRandom.hex).nil?
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|