google-cloud-storage 1.22.0 → 1.23.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a67ef9bc41b662092abd0586681372ace9f9e55f8343d60d06309f2fd8f83616
4
- data.tar.gz: 4123df331b12abbe88a9d205233bb6c217f1a193dd6e224cf97c61d8d65f109d
3
+ metadata.gz: 52575f5ef15af2995be2e3b8598cc5bfae8d96468b1f56d2eb218f1ea53f4091
4
+ data.tar.gz: 5bbda2deb2729b4fb0046ae968d16ee22019363acf9ed511f43e36a3631d2f0e
5
5
  SHA512:
6
- metadata.gz: 2a7ca08ea73ed40b9fb36ff17c3402711366874651ef18f51da42d67232d153fa9067741a0dfe4cd7ea7200a730be992b3125b979c5490b99f42906b6398553f
7
- data.tar.gz: 290c14694bd1c37996a182ff8295434410c2efdc4ce41f5f3ef5f99cfc819a2d649380ed75f22aa9adfd6c8fea65e8318731403f8272e40ca269e975c971d3ca
6
+ metadata.gz: 7a7af41ef5155e1d9e272f7402194baef5559fdba501cc0c64e8bc17c276ac9a0c965b8772e422eb360d668344e8e83b4b6128b1a25cfa84a2d6c17eec7f8e7c
7
+ data.tar.gz: 6b31863d501097f76334100889953e02e3f3e643737fbca51c976317dc37c2cf06ba370f1e50d577e7dc3c46978b8bd270eb4d4c9f3f35430bed992c79ce1d36
@@ -1,5 +1,13 @@
1
1
  # Release History
2
2
 
3
+ ### 1.23.0 / 2019-11-05
4
+
5
+ #### Features
6
+
7
+ * Add support for Bucket#uniform_bucket_level_access
8
+ * Deprecate Bucket#policy_only=, #policy_only?, and #policy_only_locked_at,
9
+ which are now aliases for the uniform_bucket_level_access methods.
10
+
3
11
  ### 1.22.0 / 2019-10-28
4
12
 
5
13
  * Now requires Ruby 2.4 or later.
@@ -780,20 +780,12 @@ module Google
780
780
  end
781
781
 
782
782
  ##
783
- # Whether the bucket's file IAM configuration enables Bucket Policy
784
- # Only. The default is false. This value can be modified by calling
785
- # {Bucket#policy_only=}.
783
+ # Whether the bucket's file IAM configuration enables uniform bucket-level access. The default is false. This
784
+ # value can be modified by calling {Bucket#uniform_bucket_level_access=}.
786
785
  #
787
- # If true, access checks only use bucket-level IAM policies or above,
788
- # all object ACLs within the bucket are no longer evaluated, and
789
- # access-control is configured solely through the bucket's IAM policy.
790
- # Any requests which attempt to use the ACL API to view or manipulate
791
- # ACLs will fail with 400 errors.
792
- #
793
- # @return [Boolean] Returns `false` if the bucket has no IAM
794
- # configuration or if Bucket Policy Only is not enabled in the IAM
795
- # configuration. Returns `true` if Bucket Policy Only is enabled in
796
- # the IAM configuration.
786
+ # @return [Boolean] Returns `false` if the bucket has no IAM configuration or if uniform bucket-level access is
787
+ # not enabled in the IAM configuration. Returns `true` if uniform bucket-level access is enabled in the IAM
788
+ # configuration.
797
789
  #
798
790
  # @example
799
791
  # require "google/cloud/storage"
@@ -802,30 +794,27 @@ module Google
802
794
  #
803
795
  # bucket = storage.bucket "my-bucket"
804
796
  #
805
- # bucket.policy_only = true
806
- # bucket.policy_only? # true
797
+ # bucket.uniform_bucket_level_access = true
798
+ # bucket.uniform_bucket_level_access? # true
807
799
  #
808
- def policy_only?
809
- return false unless @gapi.iam_configuration &&
810
- @gapi.iam_configuration.bucket_policy_only
811
- !@gapi.iam_configuration.bucket_policy_only.enabled.nil? &&
812
- @gapi.iam_configuration.bucket_policy_only.enabled
800
+ def uniform_bucket_level_access?
801
+ return false unless @gapi.iam_configuration && @gapi.iam_configuration.uniform_bucket_level_access
802
+ !@gapi.iam_configuration.uniform_bucket_level_access.enabled.nil? &&
803
+ @gapi.iam_configuration.uniform_bucket_level_access.enabled
813
804
  end
814
805
 
815
806
  ##
816
- # If enabled, access checks only use bucket-level IAM policies or above,
817
- # all object ACLs within the bucket are no longer evaluated, and
818
- # access-control is configured solely through the bucket's IAM policy.
819
- # Any requests which attempt to use the ACL API to view or manipulate
820
- # ACLs will fail with 400 errors.
807
+ # Sets whether uniform bucket-level access is enabled for this bucket. When this is enabled, access to the
808
+ # bucket will be configured through IAM, and legacy ACL policies will not work. When it is first enabled,
809
+ # {#uniform_bucket_level_access_locked_at} will be set by the API automatically. The uniform bucket-level access
810
+ # can then be disabled until the time specified, after which it will become immutable and calls to change it
811
+ # will fail. If uniform bucket-level access is enabled, calls to access legacy ACL information will fail.
821
812
  #
822
- # Before enabling Bucket Policy Only please review [feature
823
- # documentation](https://cloud.google.com/storage/docs/bucket-policy-only),
824
- # as well as [Should you use Bucket Policy
825
- # Only?](https://cloud.google.com/storage/docs/bucket-policy-only#should-you-use).
813
+ # Before enabling uniform bucket-level access please review [uniform bucket-level
814
+ # access](https://cloud.google.com/storage/docs/uniform-bucket-level-access).
826
815
  #
827
- # @param [Boolean] new_policy_only When set to `true`, Bucket Policy
828
- # Only is enabled in the bucket's IAM configuration.
816
+ # @param [Boolean] new_uniform_bucket_level_access When set to `true`, uniform bucket-level access is enabled in
817
+ # the bucket's IAM configuration.
829
818
  #
830
819
  # @example
831
820
  # require "google/cloud/storage"
@@ -834,35 +823,29 @@ module Google
834
823
  #
835
824
  # bucket = storage.bucket "my-bucket"
836
825
  #
837
- # bucket.policy_only = true
838
- # bucket.policy_only? # true
826
+ # bucket.uniform_bucket_level_access = true
827
+ # bucket.uniform_bucket_level_access? # true
839
828
  #
840
829
  # bucket.default_acl.public! # Google::Cloud::InvalidArgumentError
841
830
  #
842
- # # The deadline for disabling Bucket Policy Only.
843
- # puts bucket.policy_only_locked_at
831
+ # # The deadline for disabling uniform bucket-level access.
832
+ # puts bucket.uniform_bucket_level_access_locked_at
844
833
  #
845
- def policy_only= new_policy_only
834
+ def uniform_bucket_level_access= new_uniform_bucket_level_access
846
835
  @gapi.iam_configuration ||= API::Bucket::IamConfiguration.new
847
- @gapi.iam_configuration.bucket_policy_only ||= \
848
- API::Bucket::IamConfiguration::BucketPolicyOnly.new
849
836
  @gapi.iam_configuration.uniform_bucket_level_access ||= \
850
837
  API::Bucket::IamConfiguration::UniformBucketLevelAccess.new
851
- @gapi.iam_configuration.bucket_policy_only.enabled = new_policy_only
852
- @gapi.iam_configuration.uniform_bucket_level_access.enabled = \
853
- new_policy_only
838
+ @gapi.iam_configuration.uniform_bucket_level_access.enabled = new_uniform_bucket_level_access
854
839
  patch_gapi! :iam_configuration
855
840
  end
856
841
 
857
842
  ##
858
- # The deadline time for disabling Bucket Policy Only by calling
859
- # {Bucket#policy_only=}. After the locked time the Bucket Policy Only
860
- # setting cannot be changed from true to false. Corresponds to the
861
- # property `locked_time`.
843
+ # The deadline time for disabling uniform bucket-level access by calling {Bucket#uniform_bucket_level_access=}.
844
+ # After the locked time the uniform bucket-level access setting cannot be changed from true to false.
845
+ # Corresponds to the property `locked_time`.
862
846
  #
863
- # @return [DateTime, nil] The deadline time for changing
864
- # {Bucket#policy_only=} from true to false, or `nil` if
865
- # {Bucket#policy_only?} is false.
847
+ # @return [DateTime, nil] The deadline time for changing {Bucket#uniform_bucket_level_access=} from true to
848
+ # false, or `nil` if {Bucket#uniform_bucket_level_access?} is false.
866
849
  #
867
850
  # @example
868
851
  # require "google/cloud/storage"
@@ -871,15 +854,35 @@ module Google
871
854
  #
872
855
  # bucket = storage.bucket "my-bucket"
873
856
  #
874
- # bucket.policy_only = true
857
+ # bucket.uniform_bucket_level_access = true
875
858
  #
876
- # # The deadline for disabling Bucket Policy Only.
877
- # puts bucket.policy_only_locked_at
859
+ # # The deadline for disabling uniform bucket-level access.
860
+ # puts bucket.uniform_bucket_level_access_locked_at
861
+ #
862
+ def uniform_bucket_level_access_locked_at
863
+ return nil unless @gapi.iam_configuration && @gapi.iam_configuration.uniform_bucket_level_access
864
+ @gapi.iam_configuration.uniform_bucket_level_access.locked_time
865
+ end
866
+
867
+ ##
868
+ # @deprecated Use {#uniform_bucket_level_access?} instead.
869
+ #
870
+ def policy_only?
871
+ uniform_bucket_level_access?
872
+ end
873
+
874
+ ##
875
+ # @deprecated Use {#uniform_bucket_level_access=} instead.
876
+ #
877
+ def policy_only= new_policy_only
878
+ self.uniform_bucket_level_access = new_policy_only
879
+ end
880
+
881
+ ##
882
+ # @deprecated Use {#uniform_bucket_level_access_locked_at} instead.
878
883
  #
879
884
  def policy_only_locked_at
880
- return nil unless @gapi.iam_configuration &&
881
- @gapi.iam_configuration.bucket_policy_only
882
- @gapi.iam_configuration.bucket_policy_only.locked_time
885
+ uniform_bucket_level_access_locked_at
883
886
  end
884
887
 
885
888
  ##
@@ -233,11 +233,9 @@ module Google
233
233
  # for the bucket, including a block that defines CORS rule. See
234
234
  # {Bucket::Cors} for details.
235
235
  #
236
- # Before enabling Bucket Policy Only (see {Bucket#policy_only=}) please
237
- # review [feature
238
- # documentation](https://cloud.google.com/storage/docs/bucket-policy-only),
239
- # as well as [Should you use Bucket Policy
240
- # Only?](https://cloud.google.com/storage/docs/bucket-policy-only#should-you-use).
236
+ # Before enabling uniform bucket-level access (see
237
+ # {Bucket#uniform_bucket_level_access=}) please review [uniform bucket-level
238
+ # access](https://cloud.google.com/storage/docs/uniform-bucket-level-access).
241
239
  #
242
240
  # @see https://cloud.google.com/storage/docs/cross-origin Cross-Origin
243
241
  # Resource Sharing (CORS)
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Storage
19
- VERSION = "1.22.0".freeze
19
+ VERSION = "1.23.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.22.0
4
+ version: 1.23.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: 2019-10-28 00:00:00.000000000 Z
12
+ date: 2019-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core