google-cloud-storage 1.32.0 → 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10f1fa9dd485d8891fa159b09b463fcf20d5320fd759f2dc92164c0a6f4647af
4
- data.tar.gz: 1734495bde125925f45fdaf9a2c2a9da421d9cb38c5b7ac1e5785a869594c09f
3
+ metadata.gz: 6900463b2861e35e33cef3bda84de638f0f9e7d80e8424755f5eef311bd20352
4
+ data.tar.gz: 6469082cd9d6b158a71a808874104e20128187c4c611a0fe71dbd80b0f68e54e
5
5
  SHA512:
6
- metadata.gz: 614c067fa9c914e07acf1473e36a78cb04fa6070ddd2d1d96fee3693a2b6cc650a9005af515cdcbb9e6db9c1816985656977934fb5f3fe75248730673dbda675
7
- data.tar.gz: b3f43b0193147e89de327734384e3a3b3581abfe921e0efcfdfd094e0373a76fb719f079fde3c3e6351216d2b9150af3b1a7a46249d35f7e170168a41e28175f
6
+ metadata.gz: 4d32314a8813b66cf6ec488be10c8ac174cb71a54d175cff9f33809a529f4851ff2482a43c646f114c91cac4bf7fbc90cc4135caab85d1a55ab8c732f11c1c5f
7
+ data.tar.gz: '08382f70eb5759b7ccb98ac0bb793bed114bd3fcc24b6ca8e3ecc02af2e60540f1761d36133d8299b043155d260d9a659ab2d5b0cda6a27eb40ead70d7b7d6d1'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Release History
2
2
 
3
+ ### 1.33.0 / 2021-06-29
4
+
5
+ #### Features
6
+
7
+ * Add support for PublicAccessPrevention
8
+ * Add Bucket#public_access_prevention
9
+ * Add Bucket#public_access_prevention=
10
+ * Add Bucket#public_access_prevention_enforced?
11
+ * Add Bucket#public_access_prevention_unspecified?
12
+ * Add samples for PublicAccessPrevention
13
+
3
14
  ### 1.32.0 / 2021-06-22
4
15
 
5
16
  #### Features
@@ -931,6 +931,108 @@ module Google
931
931
  uniform_bucket_level_access_locked_at
932
932
  end
933
933
 
934
+ ##
935
+ # The value for Public Access Prevention in the bucket's IAM configuration. Currently, `unspecified` and
936
+ # `enforced` are supported. When set to `enforced`, Public Access Prevention is enforced in the bucket's IAM
937
+ # configuration. This value can be modified by calling {#public_access_prevention=}.
938
+ #
939
+ # @return [String, nil] Currently, `unspecified` and `enforced` are supported. Returns `nil` if the bucket has
940
+ # no IAM configuration.
941
+ #
942
+ # @example
943
+ # require "google/cloud/storage"
944
+ #
945
+ # storage = Google::Cloud::Storage.new
946
+ #
947
+ # bucket = storage.bucket "my-bucket"
948
+ #
949
+ # bucket.public_access_prevention = :enforced
950
+ # bucket.public_access_prevention #=> "enforced"
951
+ #
952
+ def public_access_prevention
953
+ @gapi.iam_configuration&.public_access_prevention
954
+ end
955
+
956
+ ##
957
+ # Sets the value for Public Access Prevention in the bucket's IAM configuration. This value can be queried by
958
+ # calling {#public_access_prevention}.
959
+ #
960
+ # @param [Symbol, String] new_public_access_prevention The bucket's new Public Access Prevention configuration.
961
+ # Currently, `unspecified` and `enforced` are supported. When set to `enforced`, Public Access
962
+ # Prevention is enforced in the bucket's IAM configuration.
963
+ #
964
+ # @example Set Public Access Prevention to enforced:
965
+ # require "google/cloud/storage"
966
+ #
967
+ # storage = Google::Cloud::Storage.new
968
+ #
969
+ # bucket = storage.bucket "my-bucket"
970
+ #
971
+ # bucket.public_access_prevention = :enforced
972
+ # bucket.public_access_prevention #=> "enforced"
973
+ #
974
+ # @example Set Public Access Prevention to unspecified:
975
+ # require "google/cloud/storage"
976
+ #
977
+ # storage = Google::Cloud::Storage.new
978
+ #
979
+ # bucket = storage.bucket "my-bucket"
980
+ #
981
+ # bucket.public_access_prevention = :unspecified
982
+ # bucket.public_access_prevention #=> "unspecified"
983
+ #
984
+ def public_access_prevention= new_public_access_prevention
985
+ @gapi.iam_configuration ||= API::Bucket::IamConfiguration.new
986
+ @gapi.iam_configuration.public_access_prevention = new_public_access_prevention.to_s
987
+ patch_gapi! :iam_configuration
988
+ end
989
+
990
+ ##
991
+ # Whether the bucket's file IAM configuration enforces Public Access Prevention. The default is `false`. This
992
+ # value can be modified by calling {Bucket#public_access_prevention=}.
993
+ #
994
+ # @return [Boolean] Returns `false` if the bucket has no IAM configuration or if Public Access Prevention is
995
+ # not `enforced` in the IAM configuration. Returns `true` if Public Access Prevention is `enforced` in the IAM
996
+ # configuration.
997
+ #
998
+ # @example
999
+ # require "google/cloud/storage"
1000
+ #
1001
+ # storage = Google::Cloud::Storage.new
1002
+ #
1003
+ # bucket = storage.bucket "my-bucket"
1004
+ #
1005
+ # bucket.public_access_prevention = :enforced
1006
+ # bucket.public_access_prevention_enforced? # true
1007
+ #
1008
+ def public_access_prevention_enforced?
1009
+ return false unless @gapi.iam_configuration&.public_access_prevention
1010
+ @gapi.iam_configuration.public_access_prevention.to_s == "enforced"
1011
+ end
1012
+
1013
+ ##
1014
+ # Whether the value for Public Access Prevention in the bucket's IAM configuration is `unspecified`. The default
1015
+ # is `false`. This value can be modified by calling {Bucket#public_access_prevention=}.
1016
+ #
1017
+ # @return [Boolean] Returns `false` if the bucket has no IAM configuration or if Public Access Prevention is
1018
+ # not `unspecified` in the IAM configuration. Returns `true` if Public Access Prevention is `unspecified` in
1019
+ # the IAM configuration.
1020
+ #
1021
+ # @example
1022
+ # require "google/cloud/storage"
1023
+ #
1024
+ # storage = Google::Cloud::Storage.new
1025
+ #
1026
+ # bucket = storage.bucket "my-bucket"
1027
+ #
1028
+ # bucket.public_access_prevention = :unspecified
1029
+ # bucket.public_access_prevention_unspecified? # true
1030
+ #
1031
+ def public_access_prevention_unspecified?
1032
+ return false unless @gapi.iam_configuration&.public_access_prevention
1033
+ @gapi.iam_configuration.public_access_prevention.to_s == "unspecified"
1034
+ end
1035
+
934
1036
  ##
935
1037
  # Updates the bucket with changes made in the given block in a single
936
1038
  # PATCH request. The following attributes may be set: {#cors},
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Storage
19
- VERSION = "1.32.0".freeze
19
+ VERSION = "1.33.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.32.0
4
+ version: 1.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-06-22 00:00:00.000000000 Z
12
+ date: 2021-06-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core