google-cloud-storage 1.22.0 → 1.23.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/google/cloud/storage/bucket.rb +57 -54
- data/lib/google/cloud/storage/project.rb +3 -5
- data/lib/google/cloud/storage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52575f5ef15af2995be2e3b8598cc5bfae8d96468b1f56d2eb218f1ea53f4091
|
4
|
+
data.tar.gz: 5bbda2deb2729b4fb0046ae968d16ee22019363acf9ed511f43e36a3631d2f0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a7af41ef5155e1d9e272f7402194baef5559fdba501cc0c64e8bc17c276ac9a0c965b8772e422eb360d668344e8e83b4b6128b1a25cfa84a2d6c17eec7f8e7c
|
7
|
+
data.tar.gz: 6b31863d501097f76334100889953e02e3f3e643737fbca51c976317dc37c2cf06ba370f1e50d577e7dc3c46978b8bd270eb4d4c9f3f35430bed992c79ce1d36
|
data/CHANGELOG.md
CHANGED
@@ -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
|
784
|
-
#
|
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
|
-
#
|
788
|
-
#
|
789
|
-
#
|
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.
|
806
|
-
# bucket.
|
797
|
+
# bucket.uniform_bucket_level_access = true
|
798
|
+
# bucket.uniform_bucket_level_access? # true
|
807
799
|
#
|
808
|
-
def
|
809
|
-
return false unless @gapi.iam_configuration &&
|
810
|
-
|
811
|
-
|
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
|
-
#
|
817
|
-
#
|
818
|
-
#
|
819
|
-
#
|
820
|
-
#
|
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
|
823
|
-
#
|
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]
|
828
|
-
#
|
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.
|
838
|
-
# bucket.
|
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
|
843
|
-
# puts bucket.
|
831
|
+
# # The deadline for disabling uniform bucket-level access.
|
832
|
+
# puts bucket.uniform_bucket_level_access_locked_at
|
844
833
|
#
|
845
|
-
def
|
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.
|
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
|
859
|
-
#
|
860
|
-
#
|
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
|
-
#
|
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.
|
857
|
+
# bucket.uniform_bucket_level_access = true
|
875
858
|
#
|
876
|
-
# # The deadline for disabling
|
877
|
-
# puts bucket.
|
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
|
-
|
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
|
237
|
-
# review [
|
238
|
-
#
|
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)
|
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.
|
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-
|
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
|