Class: S3Secure::Encryption::Show
- Inherits:
-
Base
show all
- Defined in:
- lib/s3_secure/encryption/show.rb
Instance Method Summary
collapse
Methods inherited from CLI::Base
#buckets, #initialize
Methods included from CLI::Say
#say
#sts
#check_bucket!, #new_s3_regional_client, #region, #region_map, #s3, #s3_client, #s3_regional_client
Instance Method Details
#enabled? ⇒ Boolean
13
14
15
|
# File 'lib/s3_secure/encryption/show.rb', line 13
def enabled?
!!(rules && !rules.empty?)
end
|
#rules ⇒ Object
17
18
19
20
21
|
# File 'lib/s3_secure/encryption/show.rb', line 17
def rules
resp = s3.get_bucket_encryption(bucket: @bucket)
resp.server_side_encryption_configuration.rules rescue Aws::S3::Errors::ServerSideEncryptionConfigurationNotFoundError
end
|
#run ⇒ Object
3
4
5
6
7
8
9
10
11
|
# File 'lib/s3_secure/encryption/show.rb', line 3
def run
if rules
say "Bucket #{@bucket} is configured with these encryption rules:"
say rules.map(&:to_h)
else
say "Bucket #{@bucket} is not configured with encryption at the bucket level"
end
rules
end
|