Skip to content

Commit

Permalink
Ruby - All Services: Fixing merge conflicts (awsdocs#6997)
Browse files Browse the repository at this point in the history
  • Loading branch information
ford-at-aws authored Oct 22, 2024
1 parent 08ed7b6 commit dd8c6f0
Show file tree
Hide file tree
Showing 38 changed files with 0 additions and 224 deletions.
5 changes: 0 additions & 5 deletions ruby/example_code/cloudwatch/alarm_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 0 additions & 5 deletions ruby/example_code/cloudwatch/alarm_basics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 0 additions & 5 deletions ruby/example_code/cloudwatch/create_alarm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 0 additions & 5 deletions ruby/example_code/cloudwatch/spec/alarm_actions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 0 additions & 5 deletions ruby/example_code/cloudwatch/spec/alarm_basics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 0 additions & 5 deletions ruby/example_code/cloudwatch/spec/create_alarm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 0 additions & 5 deletions ruby/example_code/cloudwatch/spec/show_alarms_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,8 @@
],
dimensions: [
{
<<<<<<< HEAD
name: "BucketName",
value: "amzn-s3-demo-bucket"
=======
name: 'BucketName',
value: 'doc-example-bucket'
>>>>>>> 999c6133e (fixes)
},
{
name: 'StorageType',
Expand Down
6 changes: 0 additions & 6 deletions ruby/example_code/s3/auth_federation_token_request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions ruby/example_code/s3/auth_session_token_request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}'..."

Expand Down
4 changes: 0 additions & 4 deletions ruby/example_code/s3/bucket_cors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
5 changes: 0 additions & 5 deletions ruby/example_code/s3/bucket_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}."
Expand Down
4 changes: 0 additions & 4 deletions ruby/example_code/s3/bucket_list_objects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions ruby/example_code/s3/bucket_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 0 additions & 4 deletions ruby/example_code/s3/bucket_put_encryption.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 0 additions & 6 deletions ruby/example_code/s3/bucket_put_website.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit dd8c6f0

Please sign in to comment.