From dd8c6f01e592e2f4ba07b5f4bf2686f8080a4a15 Mon Sep 17 00:00:00 2001 From: ford prior Date: Tue, 22 Oct 2024 14:46:25 -0400 Subject: [PATCH] Ruby - All Services: Fixing merge conflicts (#6997) --- ruby/example_code/cloudwatch/alarm_actions.rb | 5 ----- ruby/example_code/cloudwatch/alarm_basics.rb | 5 ----- ruby/example_code/cloudwatch/create_alarm.rb | 5 ----- .../example_code/cloudwatch/spec/alarm_actions_spec.rb | 5 ----- ruby/example_code/cloudwatch/spec/alarm_basics_spec.rb | 5 ----- ruby/example_code/cloudwatch/spec/create_alarm_spec.rb | 5 ----- ruby/example_code/cloudwatch/spec/show_alarms_spec.rb | 5 ----- .../s3/auth_federation_token_request_test.rb | 6 ------ .../example_code/s3/auth_session_token_request_test.rb | 4 ---- ruby/example_code/s3/bucket_cors.rb | 4 ---- ruby/example_code/s3/bucket_create.rb | 5 ----- ruby/example_code/s3/bucket_list_objects.rb | 4 ---- ruby/example_code/s3/bucket_policy.rb | 5 ----- ruby/example_code/s3/bucket_put_encryption.rb | 4 ---- ruby/example_code/s3/bucket_put_website.rb | 6 ------ .../s3/encryption_v2/s3_add_csaes_encrypt_item.rb | 6 ------ .../s3/encryption_v2/s3_add_cskms_encrypt_item.rb | 7 ------- .../s3/encryption_v2/s3_get_csaes_decrypt_item.rb | 6 ------ .../s3/encryption_v2/s3_get_cskms_decrypt_item.rb | 7 ------- .../s3/encryption_v2/s3_ruby_example_add_cspk_item.rb | 8 -------- .../s3/encryption_v2/s3_ruby_example_get_cspk_item.rb | 7 ------- .../spec/test_s3_add_csaes_encrypt_item.rb | 7 ------- .../spec/test_s3_add_cskms_encrypt_item.rb | 8 -------- .../spec/test_s3_get_csaes_decrypt_item.rb | 8 -------- .../spec/test_s3_get_cskms_decrypt_item.rb | 10 ---------- .../spec/test_s3_ruby_example_add_cspk_item.rb | 7 ------- .../spec/test_s3_ruby_example_get_cspk_item.rb | 6 ------ ruby/example_code/s3/object_copy.rb | 7 ------- ruby/example_code/s3/object_copy_encrypt.rb | 8 -------- ruby/example_code/s3/object_exists.rb | 5 ----- ruby/example_code/s3/object_get.rb | 6 ------ ruby/example_code/s3/object_get_encryption.rb | 5 ----- ruby/example_code/s3/object_presigned_url_upload.rb | 6 ------ ruby/example_code/s3/object_put.rb | 6 ------ ruby/example_code/s3/object_put_sse.rb | 7 ------- ruby/example_code/s3/object_upload_file.rb | 6 ------ ruby/example_code/s3/spec/bucket_create_spec.rb | 4 ---- .../sns/tests/test_create_bucket_snippet.rb | 4 ---- 38 files changed, 224 deletions(-) diff --git a/ruby/example_code/cloudwatch/alarm_actions.rb b/ruby/example_code/cloudwatch/alarm_actions.rb index b2cd312672b..48845ec8aa0 100644 --- a/ruby/example_code/cloudwatch/alarm_actions.rb +++ b/ruby/example_code/cloudwatch/alarm_actions.rb @@ -127,13 +127,8 @@ def run_me statistic = 'Average' dimensions = [ { -<<<<<<< HEAD name: "BucketName", value: "amzn-s3-demo-bucket" -======= - name: 'BucketName', - value: 'doc-example-bucket' ->>>>>>> 999c6133e (fixes) }, { name: 'StorageType', diff --git a/ruby/example_code/cloudwatch/alarm_basics.rb b/ruby/example_code/cloudwatch/alarm_basics.rb index bafbbbbdac7..d25687601ab 100644 --- a/ruby/example_code/cloudwatch/alarm_basics.rb +++ b/ruby/example_code/cloudwatch/alarm_basics.rb @@ -148,13 +148,8 @@ def run_me statistic = 'Average' dimensions = [ { -<<<<<<< HEAD name: "BucketName", value: "amzn-s3-demo-bucket" -======= - name: 'BucketName', - value: 'doc-example-bucket' ->>>>>>> 999c6133e (fixes) }, { name: 'StorageType', diff --git a/ruby/example_code/cloudwatch/create_alarm.rb b/ruby/example_code/cloudwatch/create_alarm.rb index d40166c1def..bdf1c7d064b 100644 --- a/ruby/example_code/cloudwatch/create_alarm.rb +++ b/ruby/example_code/cloudwatch/create_alarm.rb @@ -99,13 +99,8 @@ def run_me statistic = 'Average' dimensions = [ { -<<<<<<< HEAD name: "BucketName", value: "amzn-s3-demo-bucket" -======= - name: 'BucketName', - value: 'doc-example-bucket' ->>>>>>> 999c6133e (fixes) }, { name: 'StorageType', diff --git a/ruby/example_code/cloudwatch/spec/alarm_actions_spec.rb b/ruby/example_code/cloudwatch/spec/alarm_actions_spec.rb index 18db5c2cea5..afb00fc58dc 100644 --- a/ruby/example_code/cloudwatch/spec/alarm_actions_spec.rb +++ b/ruby/example_code/cloudwatch/spec/alarm_actions_spec.rb @@ -14,13 +14,8 @@ let(:dimensions) do [ { -<<<<<<< HEAD name: "BucketName", value: "amzn-s3-demo-bucket" -======= - name: 'BucketName', - value: 'doc-example-bucket' ->>>>>>> 999c6133e (fixes) }, { name: 'StorageType', diff --git a/ruby/example_code/cloudwatch/spec/alarm_basics_spec.rb b/ruby/example_code/cloudwatch/spec/alarm_basics_spec.rb index da3b926ca39..bc6bf1fc0fc 100644 --- a/ruby/example_code/cloudwatch/spec/alarm_basics_spec.rb +++ b/ruby/example_code/cloudwatch/spec/alarm_basics_spec.rb @@ -34,13 +34,8 @@ let(:dimensions) do [ { -<<<<<<< HEAD name: "BucketName", value: "amzn-s3-demo-bucket" -======= - name: 'BucketName', - value: 'doc-example-bucket' ->>>>>>> 999c6133e (fixes) }, { name: 'StorageType', diff --git a/ruby/example_code/cloudwatch/spec/create_alarm_spec.rb b/ruby/example_code/cloudwatch/spec/create_alarm_spec.rb index e22f91f787c..c9f0d284373 100644 --- a/ruby/example_code/cloudwatch/spec/create_alarm_spec.rb +++ b/ruby/example_code/cloudwatch/spec/create_alarm_spec.rb @@ -14,13 +14,8 @@ let(:dimensions) do [ { -<<<<<<< HEAD name: "BucketName", value: "amzn-s3-demo-bucket" -======= - name: 'BucketName', - value: 'doc-example-bucket' ->>>>>>> 999c6133e (fixes) }, { name: 'StorageType', diff --git a/ruby/example_code/cloudwatch/spec/show_alarms_spec.rb b/ruby/example_code/cloudwatch/spec/show_alarms_spec.rb index 51b71bf2b65..27dd469d65e 100644 --- a/ruby/example_code/cloudwatch/spec/show_alarms_spec.rb +++ b/ruby/example_code/cloudwatch/spec/show_alarms_spec.rb @@ -33,13 +33,8 @@ ], dimensions: [ { -<<<<<<< HEAD name: "BucketName", value: "amzn-s3-demo-bucket" -======= - name: 'BucketName', - value: 'doc-example-bucket' ->>>>>>> 999c6133e (fixes) }, { name: 'StorageType', diff --git a/ruby/example_code/s3/auth_federation_token_request_test.rb b/ruby/example_code/s3/auth_federation_token_request_test.rb index e5cd79042ed..f53707f3a1d 100644 --- a/ruby/example_code/s3/auth_federation_token_request_test.rb +++ b/ruby/example_code/s3/auth_federation_token_request_test.rb @@ -104,15 +104,9 @@ def list_objects_in_bucket?(s3_client, bucket_name) # Example usage: def run_me -<<<<<<< HEAD region = "us-west-2" user_name = "my-user" bucket_name = "amzn-s3-demo-bucket" -======= - region = 'us-west-2' - user_name = 'my-user' - bucket_name = 'doc-example-bucket' ->>>>>>> 999c6133e (fixes) iam = Aws::IAM::Client.new(region: region) user = get_user(iam, user_name) diff --git a/ruby/example_code/s3/auth_session_token_request_test.rb b/ruby/example_code/s3/auth_session_token_request_test.rb index f03f1f63100..156c00cf9f5 100644 --- a/ruby/example_code/s3/auth_session_token_request_test.rb +++ b/ruby/example_code/s3/auth_session_token_request_test.rb @@ -176,11 +176,7 @@ def run_me role_session_name = 'ReadAmazonS3Bucket' duration_seconds = 3600 sts_client = Aws::STS::Client.new(region: region) -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" -======= - bucket_name = 'doc-example-bucket' ->>>>>>> 999c6133e (fixes) puts "Getting or creating user '#{user_name}'..." diff --git a/ruby/example_code/s3/bucket_cors.rb b/ruby/example_code/s3/bucket_cors.rb index e6fc1b71a45..530421acfc4 100644 --- a/ruby/example_code/s3/bucket_cors.rb +++ b/ruby/example_code/s3/bucket_cors.rb @@ -75,11 +75,7 @@ def delete_cors # Example usage: def run_demo -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" -======= - bucket_name = 'doc-example-bucket' ->>>>>>> 999c6133e (fixes) allowed_methods = %w[GET PUT] allowed_origins = %w[http://www.example.com] diff --git a/ruby/example_code/s3/bucket_create.rb b/ruby/example_code/s3/bucket_create.rb index 20f1a359b09..7babdef7605 100644 --- a/ruby/example_code/s3/bucket_create.rb +++ b/ruby/example_code/s3/bucket_create.rb @@ -46,13 +46,8 @@ def location # Example usage: def run_demo -<<<<<<< HEAD region = "us-west-2" wrapper = BucketCreateWrapper.new(Aws::S3::Bucket.new("amzn-s3-demo-bucket-#{Random.uuid}")) -======= - region = 'us-west-2' - wrapper = BucketCreateWrapper.new(Aws::S3::Bucket.new("doc-example-bucket-#{Random.uuid}")) ->>>>>>> 999c6133e (fixes) return unless wrapper.create?(region) puts "Created bucket #{wrapper.bucket.name}." diff --git a/ruby/example_code/s3/bucket_list_objects.rb b/ruby/example_code/s3/bucket_list_objects.rb index b3c04f0b195..e44c22849f5 100644 --- a/ruby/example_code/s3/bucket_list_objects.rb +++ b/ruby/example_code/s3/bucket_list_objects.rb @@ -38,11 +38,7 @@ def list_objects(max_objects) # Example usage: def run_demo -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" -======= - bucket_name = 'doc-example-bucket' ->>>>>>> 999c6133e (fixes) wrapper = BucketListObjectsWrapper.new(Aws::S3::Bucket.new(bucket_name)) count = wrapper.list_objects(25) diff --git a/ruby/example_code/s3/bucket_policy.rb b/ruby/example_code/s3/bucket_policy.rb index a6579a23bb6..bb0c2f8c35e 100644 --- a/ruby/example_code/s3/bucket_policy.rb +++ b/ruby/example_code/s3/bucket_policy.rb @@ -60,13 +60,8 @@ def delete_policy # Example usage: def run_demo -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" policy_user = "arn:aws:iam::111122223333:user/Martha" -======= - bucket_name = 'doc-example-bucket' - policy_user = 'arn:aws:iam::111122223333:user/Martha' ->>>>>>> 999c6133e (fixes) policy = { 'Version': '2012-10-17', 'Id': 'DemoBucketPolicy', diff --git a/ruby/example_code/s3/bucket_put_encryption.rb b/ruby/example_code/s3/bucket_put_encryption.rb index 518a76ed7f1..2047ce741de 100644 --- a/ruby/example_code/s3/bucket_put_encryption.rb +++ b/ruby/example_code/s3/bucket_put_encryption.rb @@ -41,11 +41,7 @@ def encryption(bucket_name) # Example usage: def run_demo -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" -======= - bucket_name = 'doc-example-bucket' ->>>>>>> 999c6133e (fixes) wrapper = BucketEncryptionWrapper.new(Aws::S3::Client.new) return unless wrapper.set_encryption(bucket_name) diff --git a/ruby/example_code/s3/bucket_put_website.rb b/ruby/example_code/s3/bucket_put_website.rb index 9f591ef9615..2456eb36d7b 100644 --- a/ruby/example_code/s3/bucket_put_website.rb +++ b/ruby/example_code/s3/bucket_put_website.rb @@ -38,15 +38,9 @@ def set_website(index_document, error_document) # Example usage: def run_demo -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" index_document = "index.html" error_document = "404.html" -======= - bucket_name = 'doc-example-bucket' - index_document = 'index.html' - error_document = '404.html' ->>>>>>> 999c6133e (fixes) wrapper = BucketWebsiteWrapper.new(Aws::S3::BucketWebsite.new(bucket_name)) return unless wrapper.set_website(index_document, error_document) diff --git a/ruby/example_code/s3/encryption_v2/s3_add_csaes_encrypt_item.rb b/ruby/example_code/s3/encryption_v2/s3_add_csaes_encrypt_item.rb index d0ae58b7017..fd91df23320 100644 --- a/ruby/example_code/s3/encryption_v2/s3_add_csaes_encrypt_item.rb +++ b/ruby/example_code/s3/encryption_v2/s3_add_csaes_encrypt_item.rb @@ -83,15 +83,9 @@ def random_aes_256_gcm_key # Example usage: def run_me -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-file.txt" region = "us-west-2" -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-file.txt' - region = 'us-west-2' ->>>>>>> 999c6133e (fixes) object_content = File.read(object_key) # The following call generates a random AES256-GCM key. Alternatively, you can diff --git a/ruby/example_code/s3/encryption_v2/s3_add_cskms_encrypt_item.rb b/ruby/example_code/s3/encryption_v2/s3_add_cskms_encrypt_item.rb index fe6ea8c6f8f..34133d27348 100644 --- a/ruby/example_code/s3/encryption_v2/s3_add_cskms_encrypt_item.rb +++ b/ruby/example_code/s3/encryption_v2/s3_add_cskms_encrypt_item.rb @@ -57,17 +57,10 @@ def encrypted_object_uploaded?( # Example usage: def run_me -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-file.txt" region = "us-west-2" kms_key_id = "9041e78c-7a20-4db3-929e-828abEXAMPLE" -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-file.txt' - region = 'us-west-2' - kms_key_id = '9041e78c-7a20-4db3-929e-828abEXAMPLE' ->>>>>>> 999c6133e (fixes) object_content = File.read(object_key) # Note that in the following call: diff --git a/ruby/example_code/s3/encryption_v2/s3_get_csaes_decrypt_item.rb b/ruby/example_code/s3/encryption_v2/s3_get_csaes_decrypt_item.rb index 6e370c4b2d9..9f5612044db 100644 --- a/ruby/example_code/s3/encryption_v2/s3_get_csaes_decrypt_item.rb +++ b/ruby/example_code/s3/encryption_v2/s3_get_csaes_decrypt_item.rb @@ -53,15 +53,9 @@ def get_decrypted_object_content( # Example usage: def run_me -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-file.txt" region = "us-west-2" -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-file.txt' - region = 'us-west-2' ->>>>>>> 999c6133e (fixes) # Provide a base64-encoded string representation of the key that # was originally used to encrypt the object. For example: diff --git a/ruby/example_code/s3/encryption_v2/s3_get_cskms_decrypt_item.rb b/ruby/example_code/s3/encryption_v2/s3_get_cskms_decrypt_item.rb index 63a2639b2b5..544d485fbef 100644 --- a/ruby/example_code/s3/encryption_v2/s3_get_cskms_decrypt_item.rb +++ b/ruby/example_code/s3/encryption_v2/s3_get_cskms_decrypt_item.rb @@ -51,17 +51,10 @@ def get_decrypted_object_content( # Example usage: def run_me -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-file.txt" region = "us-west-2" kms_key_id = "9041e78c-7a20-4db3-929e-828abEXAMPLE" -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-file.txt' - region = 'us-west-2' - kms_key_id = '9041e78c-7a20-4db3-929e-828abEXAMPLE' ->>>>>>> 999c6133e (fixes) # Note that in the following call: # - key_wrap_schema must be kms_context for AWS KMS. diff --git a/ruby/example_code/s3/encryption_v2/s3_ruby_example_add_cspk_item.rb b/ruby/example_code/s3/encryption_v2/s3_ruby_example_add_cspk_item.rb index 9b7d00dca70..58650a6da7f 100644 --- a/ruby/example_code/s3/encryption_v2/s3_ruby_example_add_cspk_item.rb +++ b/ruby/example_code/s3/encryption_v2/s3_ruby_example_add_cspk_item.rb @@ -55,19 +55,11 @@ def object_uploaded_with_public_key_encryption?( # Example usage: def run_me -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-file.txt" object_content = "This is the content of my-file.txt." region = "us-west-2" public_key_file = "my-public-key.pem" -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-file.txt' - object_content = 'This is the content of my-file.txt.' - region = 'us-west-2' - public_key_file = 'my-public-key.pem' ->>>>>>> 999c6133e (fixes) public_key = OpenSSL::PKey::RSA.new(File.read(public_key_file)) # When initializing this Amazon S3 encryption client, note: diff --git a/ruby/example_code/s3/encryption_v2/s3_ruby_example_get_cspk_item.rb b/ruby/example_code/s3/encryption_v2/s3_ruby_example_get_cspk_item.rb index 6a183a1488e..b71cb19f813 100644 --- a/ruby/example_code/s3/encryption_v2/s3_ruby_example_get_cspk_item.rb +++ b/ruby/example_code/s3/encryption_v2/s3_ruby_example_get_cspk_item.rb @@ -50,17 +50,10 @@ def download_object_with_private_key_encryption( # Example usage: def run_me -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-file.txt" region = "us-west-2" private_key_file = "my-private-key.pem" -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-file.txt' - region = 'us-west-2' - private_key_file = 'my-private-key.pem' ->>>>>>> 999c6133e (fixes) private_key = OpenSSL::PKey::RSA.new(File.read(private_key_file)) # When initializing this Amazon S3 encryption client, note: diff --git a/ruby/example_code/s3/encryption_v2/spec/test_s3_add_csaes_encrypt_item.rb b/ruby/example_code/s3/encryption_v2/spec/test_s3_add_csaes_encrypt_item.rb index 744796a3f61..c6fbc8b9d12 100644 --- a/ruby/example_code/s3/encryption_v2/spec/test_s3_add_csaes_encrypt_item.rb +++ b/ruby/example_code/s3/encryption_v2/spec/test_s3_add_csaes_encrypt_item.rb @@ -3,17 +3,10 @@ require_relative '../s3_add_csaes_encrypt_item' -<<<<<<< HEAD describe "#encrypted_object_uploaded?" do let(:bucket_name) { "amzn-s3-demo-bucket" } let(:object_key) { "my-file.txt" } let(:object_content) { "This is the content of my-file.txt." } -======= -describe '#encrypted_object_uploaded?' do - let(:bucket_name) { 'doc-example-bucket' } - let(:object_key) { 'my-file.txt' } - let(:object_content) { 'This is the content of my-file.txt.' } ->>>>>>> 999c6133e (fixes) let(:encryption_key) { get_random_aes_256_gcm_key } # Note that Aws::S3::EncryptionV2::Client is a wrapper around # Aws::S3::Client. So you must first stub Aws::S3::Client diff --git a/ruby/example_code/s3/encryption_v2/spec/test_s3_add_cskms_encrypt_item.rb b/ruby/example_code/s3/encryption_v2/spec/test_s3_add_cskms_encrypt_item.rb index 4b82c69ed37..20e9575d594 100644 --- a/ruby/example_code/s3/encryption_v2/spec/test_s3_add_cskms_encrypt_item.rb +++ b/ruby/example_code/s3/encryption_v2/spec/test_s3_add_cskms_encrypt_item.rb @@ -3,19 +3,11 @@ require_relative '../s3_add_cskms_encrypt_item' -<<<<<<< HEAD describe "#encrypted_object_uploaded?" do let(:bucket_name) { "amzn-s3-demo-bucket" } let(:object_key) { "my-file.txt" } let(:object_content) { "This is the content of my-file.txt." } let(:kms_key_id) { "9041e78c-7a20-4db3-929e-828abEXAMPLE" } -======= -describe '#encrypted_object_uploaded?' do - let(:bucket_name) { 'doc-example-bucket' } - let(:object_key) { 'my-file.txt' } - let(:object_content) { 'This is the content of my-file.txt.' } - let(:kms_key_id) { '9041e78c-7a20-4db3-929e-828abEXAMPLE' } ->>>>>>> 999c6133e (fixes) # Note that Aws::S3::EncryptionV2::Client is a wrapper around # Aws::S3::Client. So you must first stub Aws::S3::Client # and then pass it into Aws::S3::EncryptionV2::Client diff --git a/ruby/example_code/s3/encryption_v2/spec/test_s3_get_csaes_decrypt_item.rb b/ruby/example_code/s3/encryption_v2/spec/test_s3_get_csaes_decrypt_item.rb index 1454ef799ef..829704b1f96 100644 --- a/ruby/example_code/s3/encryption_v2/spec/test_s3_get_csaes_decrypt_item.rb +++ b/ruby/example_code/s3/encryption_v2/spec/test_s3_get_csaes_decrypt_item.rb @@ -36,19 +36,11 @@ def stub_get(s3_client, data, stub_auth_tag) ) end -<<<<<<< HEAD let(:bucket_name) { "amzn-s3-demo-bucket" } let(:object_key) { "my-file.txt" } let(:object_content) { "This is the content of my-file.txt." } let(:encryption_key_string) { "XSiKrmzhtDKR9tTwJRSLjgwLhiMA82TC2z3GEXAMPLE=" } let(:encryption_key) { encryption_key_string.unpack("m")[0] } -======= - let(:bucket_name) { 'doc-example-bucket' } - let(:object_key) { 'my-file.txt' } - let(:object_content) { 'This is the content of my-file.txt.' } - let(:encryption_key_string) { 'XSiKrmzhtDKR9tTwJRSLjgwLhiMA82TC2z3GEXAMPLE=' } - let(:encryption_key) { encryption_key_string.unpack1('m') } ->>>>>>> 999c6133e (fixes) # Note that Aws::S3::EncryptionV2::Client is a wrapper around # Aws::S3::Client. So you must first stub Aws::S3::Client # and then pass it into Aws::S3::EncryptionV2::Client diff --git a/ruby/example_code/s3/encryption_v2/spec/test_s3_get_cskms_decrypt_item.rb b/ruby/example_code/s3/encryption_v2/spec/test_s3_get_cskms_decrypt_item.rb index a592079023e..56073fd162b 100644 --- a/ruby/example_code/s3/encryption_v2/spec/test_s3_get_cskms_decrypt_item.rb +++ b/ruby/example_code/s3/encryption_v2/spec/test_s3_get_cskms_decrypt_item.rb @@ -52,21 +52,11 @@ def stub_decrypt(kms_client, opts) ) end -<<<<<<< HEAD let(:bucket_name) { "amzn-s3-demo-bucket" } let(:object_key) { "my-file.txt" } let(:object_content) { "This is the content of my-file.txt." } let(:kms_key_id) { "9041e78c-7a20-4db3-929e-828abEXAMPLE" } let(:kms_ciphertext_blob) { Base64.decode64("AQIDAHiWj6qDEnwihp7W7g6VZb1xqsat5jdSUdEaGhgZepHdLAGASCQI7LZz\nz7GzCpm6y4sHAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEH\nATAeBglghkgBZQMEAS4wEQQMJMJe6d8DkRTWwlvtAgEQgDtBCwiibCTS8pb7\n6BYKklVjy+CmO9q3r6y4u/9jJ8lk9eg5GwiskmcBtPMcWogMzx/vh+/65Cjb\nsQBpLQ==\n") } -======= - let(:bucket_name) { 'doc-example-bucket' } - let(:object_key) { 'my-file.txt' } - let(:object_content) { 'This is the content of my-file.txt.' } - let(:kms_key_id) { '9041e78c-7a20-4db3-929e-828abEXAMPLE' } - let(:kms_ciphertext_blob) do - Base64.decode64("AQIDAHiWj6qDEnwihp7W7g6VZb1xqsat5jdSUdEaGhgZepHdLAGASCQI7LZz\nz7GzCpm6y4sHAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEH\nATAeBglghkgBZQMEAS4wEQQMJMJe6d8DkRTWwlvtAgEQgDtBCwiibCTS8pb7\n6BYKklVjy+CmO9q3r6y4u/9jJ8lk9eg5GwiskmcBtPMcWogMzx/vh+/65Cjb\nsQBpLQ==\n") - end ->>>>>>> 999c6133e (fixes) let(:kms_plaintext) { Base64.decode64("5V7JWe+UDRhv66TaDg+tP6JONf/GkTdXk6Jq61weM+w=\n") } # Note that Aws::S3::EncryptionV2::Client is a wrapper around # Aws::S3::Client. So you must first stub Aws::S3::Client diff --git a/ruby/example_code/s3/encryption_v2/spec/test_s3_ruby_example_add_cspk_item.rb b/ruby/example_code/s3/encryption_v2/spec/test_s3_ruby_example_add_cspk_item.rb index 4d678d9da61..bb42a16f31c 100644 --- a/ruby/example_code/s3/encryption_v2/spec/test_s3_ruby_example_add_cspk_item.rb +++ b/ruby/example_code/s3/encryption_v2/spec/test_s3_ruby_example_add_cspk_item.rb @@ -3,17 +3,10 @@ require_relative '../s3-ruby-example-add-cspk-item' -<<<<<<< HEAD describe "#object_uploaded_with_public_key_encryption?" do let(:bucket_name) { "amzn-s3-demo-bucket" } let(:object_key) { "my-file.txt" } let(:object_content) { "This is the content of my-file.txt." } -======= -describe '#object_uploaded_with_public_key_encryption?' do - let(:bucket_name) { 'doc-example-bucket' } - let(:object_key) { 'my-file.txt' } - let(:object_content) { 'This is the content of my-file.txt.' } ->>>>>>> 999c6133e (fixes) # Note that Aws::S3::EncryptionV2::Client is a wrapper around # Aws::S3::Client. So you must first stub Aws::S3::Client # and then pass it into Aws::S3::EncryptionV2::Client diff --git a/ruby/example_code/s3/encryption_v2/spec/test_s3_ruby_example_get_cspk_item.rb b/ruby/example_code/s3/encryption_v2/spec/test_s3_ruby_example_get_cspk_item.rb index 4948672fb34..5170fc82645 100644 --- a/ruby/example_code/s3/encryption_v2/spec/test_s3_ruby_example_get_cspk_item.rb +++ b/ruby/example_code/s3/encryption_v2/spec/test_s3_ruby_example_get_cspk_item.rb @@ -36,15 +36,9 @@ def stub_get(s3_client, data, stub_auth_tag) ) end -<<<<<<< HEAD let(:bucket_name) { "amzn-s3-demo-bucket" } let(:object_key) { "my-file.txt" } let(:object_content) { "This is the content of my-file.txt." } -======= - let(:bucket_name) { 'doc-example-bucket' } - let(:object_key) { 'my-file.txt' } - let(:object_content) { 'This is the content of my-file.txt.' } ->>>>>>> 999c6133e (fixes) # Note that Aws::S3::EncryptionV2::Client is a wrapper around # Aws::S3::Client. So you must first stub Aws::S3::Client # and then pass it into Aws::S3::EncryptionV2::Client diff --git a/ruby/example_code/s3/object_copy.rb b/ruby/example_code/s3/object_copy.rb index 7f7a3fa172b..4c2fa7f25fb 100644 --- a/ruby/example_code/s3/object_copy.rb +++ b/ruby/example_code/s3/object_copy.rb @@ -33,17 +33,10 @@ def copy_object(target_bucket, target_object_key) # Example usage: def run_demo -<<<<<<< HEAD source_bucket_name = "amzn-s3-demo-bucket1" source_key = "my-source-file.txt" target_bucket_name = "amzn-s3-demo-bucket2" target_key = "my-target-file.txt" -======= - source_bucket_name = 'doc-example-bucket1' - source_key = 'my-source-file.txt' - target_bucket_name = 'doc-example-bucket2' - target_key = 'my-target-file.txt' ->>>>>>> 999c6133e (fixes) source_bucket = Aws::S3::Bucket.new(source_bucket_name) wrapper = ObjectCopyWrapper.new(source_bucket.object(source_key)) diff --git a/ruby/example_code/s3/object_copy_encrypt.rb b/ruby/example_code/s3/object_copy_encrypt.rb index df9e54f5eec..c87e8d12960 100644 --- a/ruby/example_code/s3/object_copy_encrypt.rb +++ b/ruby/example_code/s3/object_copy_encrypt.rb @@ -34,19 +34,11 @@ def copy_object(target_bucket, target_object_key, encryption) # Example usage: def run_demo -<<<<<<< HEAD source_bucket_name = "amzn-s3-demo-bucket1" source_key = "my-source-file.txt" target_bucket_name = "amzn-s3-demo-bucket2" target_key = "my-target-file.txt" target_encryption = "AES256" -======= - source_bucket_name = 'doc-example-bucket1' - source_key = 'my-source-file.txt' - target_bucket_name = 'doc-example-bucket2' - target_key = 'my-target-file.txt' - target_encryption = 'AES256' ->>>>>>> 999c6133e (fixes) source_bucket = Aws::S3::Bucket.new(source_bucket_name) wrapper = ObjectCopyEncryptWrapper.new(source_bucket.object(source_key)) diff --git a/ruby/example_code/s3/object_exists.rb b/ruby/example_code/s3/object_exists.rb index e58ccad4c10..6ce93fbc553 100644 --- a/ruby/example_code/s3/object_exists.rb +++ b/ruby/example_code/s3/object_exists.rb @@ -30,13 +30,8 @@ def exists? # Example usage: def run_demo -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-object.txt" -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-object.txt' ->>>>>>> 999c6133e (fixes) wrapper = ObjectExistsWrapper.new(Aws::S3::Object.new(bucket_name, object_key)) exists = wrapper.exists? diff --git a/ruby/example_code/s3/object_get.rb b/ruby/example_code/s3/object_get.rb index 40befcb45bb..ee3645fc3d2 100644 --- a/ruby/example_code/s3/object_get.rb +++ b/ruby/example_code/s3/object_get.rb @@ -30,15 +30,9 @@ def get_object(target_path) # Example usage: def run_demo -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-object.txt" target_path = "my-object-as-file.txt" -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-object.txt' - target_path = 'my-object-as-file.txt' ->>>>>>> 999c6133e (fixes) wrapper = ObjectGetWrapper.new(Aws::S3::Object.new(bucket_name, object_key)) obj_data = wrapper.get_object(target_path) diff --git a/ruby/example_code/s3/object_get_encryption.rb b/ruby/example_code/s3/object_get_encryption.rb index 607b804a250..f0a4c09d080 100644 --- a/ruby/example_code/s3/object_get_encryption.rb +++ b/ruby/example_code/s3/object_get_encryption.rb @@ -30,13 +30,8 @@ def object # Example usage: def run_demo -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-object.txt" -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-object.txt' ->>>>>>> 999c6133e (fixes) wrapper = ObjectGetEncryptionWrapper.new(Aws::S3::Object.new(bucket_name, object_key)) obj_data = wrapper.get_object diff --git a/ruby/example_code/s3/object_presigned_url_upload.rb b/ruby/example_code/s3/object_presigned_url_upload.rb index 1e3c2d913bc..71d0d920266 100644 --- a/ruby/example_code/s3/object_presigned_url_upload.rb +++ b/ruby/example_code/s3/object_presigned_url_upload.rb @@ -24,15 +24,9 @@ def get_presigned_url(bucket, object_key) # Example usage: def run_demo -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-file.txt" object_content = "This is the content of my-file.txt." -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-file.txt' - object_content = 'This is the content of my-file.txt.' ->>>>>>> 999c6133e (fixes) bucket = Aws::S3::Bucket.new(bucket_name) presigned_url = get_presigned_url(bucket, object_key) diff --git a/ruby/example_code/s3/object_put.rb b/ruby/example_code/s3/object_put.rb index 07fe2795442..c5ed90bee5c 100644 --- a/ruby/example_code/s3/object_put.rb +++ b/ruby/example_code/s3/object_put.rb @@ -30,15 +30,9 @@ def put_object(source_file_path) # Example usage: def run_demo -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-object-key" file_path = "my-local-file.txt" -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-object-key' - file_path = 'my-local-file.txt' ->>>>>>> 999c6133e (fixes) wrapper = ObjectPutWrapper.new(Aws::S3::Object.new(bucket_name, object_key)) success = wrapper.put_object(file_path) diff --git a/ruby/example_code/s3/object_put_sse.rb b/ruby/example_code/s3/object_put_sse.rb index a3f2770d103..382f0eda679 100644 --- a/ruby/example_code/s3/object_put_sse.rb +++ b/ruby/example_code/s3/object_put_sse.rb @@ -30,17 +30,10 @@ def put_object_encrypted(object_content, encryption) # Example usage: def run_demo -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-encrypted-content" object_content = "This is my super-secret content." encryption = "AES256" -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-encrypted-content' - object_content = 'This is my super-secret content.' - encryption = 'AES256' ->>>>>>> 999c6133e (fixes) wrapper = ObjectPutSseWrapper.new(Aws::S3::Object.new(bucket_name, object_content)) return unless wrapper.put_object_encrypted(object_content, encryption) diff --git a/ruby/example_code/s3/object_upload_file.rb b/ruby/example_code/s3/object_upload_file.rb index 83b022e7546..fc467b58e58 100644 --- a/ruby/example_code/s3/object_upload_file.rb +++ b/ruby/example_code/s3/object_upload_file.rb @@ -32,15 +32,9 @@ def upload_file(file_path) # Example usage: def run_demo -<<<<<<< HEAD bucket_name = "amzn-s3-demo-bucket" object_key = "my-uploaded-file" file_path = "object_upload_file.rb" -======= - bucket_name = 'doc-example-bucket' - object_key = 'my-uploaded-file' - file_path = 'object_upload_file.rb' ->>>>>>> 999c6133e (fixes) wrapper = ObjectUploadFileWrapper.new(Aws::S3::Object.new(bucket_name, object_key)) return unless wrapper.upload_file(file_path) diff --git a/ruby/example_code/s3/spec/bucket_create_spec.rb b/ruby/example_code/s3/spec/bucket_create_spec.rb index 1d7bfd53064..2e7d51b953c 100644 --- a/ruby/example_code/s3/spec/bucket_create_spec.rb +++ b/ruby/example_code/s3/spec/bucket_create_spec.rb @@ -5,11 +5,7 @@ require_relative '../bucket_create' describe BucketCreateWrapper do -<<<<<<< HEAD let(:bucket_name) { "amzn-s3-demo-bucket" } -======= - let(:bucket_name) { 'doc-example-bucket' } ->>>>>>> 999c6133e (fixes) let(:bucket) { Aws::S3::Bucket.new(bucket_name, stub_responses: true) } let(:wrapper) { BucketCreateWrapper.new(bucket) } diff --git a/ruby/example_code/sns/tests/test_create_bucket_snippet.rb b/ruby/example_code/sns/tests/test_create_bucket_snippet.rb index f14829ca2f0..ead056e5e0f 100644 --- a/ruby/example_code/sns/tests/test_create_bucket_snippet.rb +++ b/ruby/example_code/sns/tests/test_create_bucket_snippet.rb @@ -5,11 +5,7 @@ describe '#bucket_created?' do let(:s3_client) { Aws::S3::Client.new(stub_responses: true) } -<<<<<<< HEAD let(:bucket_name) { "amzn-s3-demo-bucket" } -======= - let(:bucket_name) { 'doc-example-bucket' } ->>>>>>> 999c6133e (fixes) it 'confirms the bucket was created' do bucket_data = s3_client.stub_data(