Sha256: 3148f2a422c6028f41204de2daddccdd3c2a9656fc83f43f1b5794d5472685fc

Contents?: true

Size: 712 Bytes

Versions: 2

Compression:

Stored size: 712 Bytes

Contents

module S3Secure::PublicAccess
  class Show < Base
    def run
      resp = s3.get_public_access_block(
        bucket: @bucket,
      )
      say(resp.to_h)
      resp
    rescue Aws::S3::Errors::NoSuchPublicAccessBlockConfiguration
      say "No public access block configuration found for bucket: #{@bucket}"
    end

    def blocked?
      resp = s3.get_public_access_block(
        bucket: @bucket,
      )
      resp.to_h[:public_access_block_configuration] == {
        block_public_acls: true,
        block_public_policy: true,
        ignore_public_acls: true,
        restrict_public_buckets: true,
      }
    rescue Aws::S3::Errors::NoSuchPublicAccessBlockConfiguration
      false
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
s3-secure-0.7.0 lib/s3_secure/public_access/show.rb
s3-secure-0.6.1 lib/s3_secure/public_access/show.rb